Akonadi Contacts

contacteditorwidget.h
1/*
2 This file is part of Contact Editor.
3
4 SPDX-FileCopyrightText: 2009 Tobias Koenig <tokoe@kde.org>
5
6 SPDX-License-Identifier: LGPL-2.0-or-later
7*/
8
9#pragma once
10
11#include "abstractcontacteditorwidget_p.h"
12#include "akonadi-contact-widgets_export.h"
13
14#include <memory>
15
16namespace KContacts
17{
18class Addressee;
19}
20
21class ContactEditorWidgetPrivate;
22
23/**
24 * @short A widget for editing a contact.
25 *
26 * @author Tobias Koenig <tokoe@kde.org>
27 */
28class AKONADI_CONTACT_WIDGETS_EXPORT ContactEditorWidget : public Akonadi::AbstractContactEditorWidget
29{
30 Q_OBJECT
31public:
33 FullMode, ///< Show all pages
34 VCardMode ///< Show just pages with elements stored in vcard.
35 };
36
37 /**
38 * Creates a new contact editor widget.
39 *
40 * @param parent The parent widget.
41 */
42 explicit ContactEditorWidget(QWidget *parent = nullptr);
43
44 ContactEditorWidget(DisplayMode displayMode, QWidget *parent);
45
46 /**
47 * Destroys the contact editor widget.
48 */
50
51 /**
52 * Initializes the fields of the contact editor
53 * with the values from a @p contact.
54 */
55 void loadContact(const KContacts::Addressee &contact, const Akonadi::ContactMetaDataBase &metaData) override;
56
57 /**
58 * Stores back the fields of the contact editor
59 * into the given @p contact.
60 */
61 void storeContact(KContacts::Addressee &contact, Akonadi::ContactMetaDataBase &metaData) const override;
62
63 /**
64 * Sets whether the contact in the editor allows
65 * the user to edit the contact or not.
66 */
67 void setReadOnly(bool readOnly) override;
68
69 [[nodiscard]] bool hasNoSavedData() const override;
70
71private:
72 std::unique_ptr<ContactEditorWidgetPrivate> const d;
73};
A widget for editing a contact.
~ContactEditorWidget() override
Destroys the contact editor widget.
@ FullMode
Show all pages.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:05:46 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.