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 namespace KContacts
14 {
15 class Addressee;
16 }
17 
18 /**
19  * @short A widget for editing a contact.
20  *
21  * @author Tobias Koenig <[email protected]>
22  */
23 class CONTACTEDITOR_EXPORT ContactEditorWidget : public ContactEditor::AbstractContactEditorWidget
24 {
25  Q_OBJECT
26 public:
27  enum DisplayMode {
28  FullMode, ///< Show all pages
29  VCardMode ///< Show just pages with elements stored in vcard.
30  };
31 
32  /**
33  * Creates a new contact editor widget.
34  *
35  * @param parent The parent widget.
36  */
37  explicit ContactEditorWidget(QWidget *parent = nullptr);
38 
39  ContactEditorWidget(DisplayMode displayMode, QWidget *parent);
40 
41  /**
42  * Destroys the contact editor widget.
43  */
44  ~ContactEditorWidget() override;
45 
46  /**
47  * Initializes the fields of the contact editor
48  * with the values from a @p contact.
49  */
50  void loadContact(const KContacts::Addressee &contact, const ContactEditor::ContactMetaDataBase &metaData) override;
51 
52  /**
53  * Stores back the fields of the contact editor
54  * into the given @p contact.
55  */
56  void storeContact(KContacts::Addressee &contact, ContactEditor::ContactMetaDataBase &metaData) const override;
57 
58  /**
59  * Sets whether the contact in the editor allows
60  * the user to edit the contact or not.
61  */
62  void setReadOnly(bool readOnly) override;
63 
64  Q_REQUIRED_RESULT bool hasNoSavedData() const override;
65 
66 private:
67  class Private;
68  Private *const d;
69 };
70 
A widget for editing a contact.
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Thu Jun 17 2021 23:09:01 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.