Akonadi Contacts

contacteditorwidget.h
1 /*
2  This file is part of Contact Editor.
3 
4  SPDX-FileCopyrightText: 2009 Tobias Koenig <[email protected]>
5 
6  SPDX-License-Identifier: LGPL-2.0-or-later
7 */
8 
9 #pragma once
10 
11 #include "abstractcontacteditorwidget_p.h"
12 #include "contacteditor_export.h"
13 
14 #include <memory>
15 
16 namespace KContacts
17 {
18 class Addressee;
19 }
20 
21 class ContactEditorWidgetPrivate;
22 
23 /**
24  * @short A widget for editing a contact.
25  *
26  * @author Tobias Koenig <[email protected]>
27  */
28 class CONTACTEDITOR_EXPORT ContactEditorWidget : public ContactEditor::AbstractContactEditorWidget
29 {
30  Q_OBJECT
31 public:
32  enum DisplayMode {
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  */
49  ~ContactEditorWidget() override;
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 ContactEditor::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, ContactEditor::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  Q_REQUIRED_RESULT bool hasNoSavedData() const override;
70 
71 private:
72  std::unique_ptr<ContactEditorWidgetPrivate> const d;
73 };
A widget for editing a contact.
@ FullMode
Show all pages.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sat Apr 1 2023 04:09:04 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.