Akonadi Contacts

contactviewerdialog.h
1 /*
2  This file is part of Akonadi Contact.
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 "akonadi-contact_export.h"
12 
13 #include <QDialog>
14 
15 #include <memory>
16 
17 namespace KContacts
18 {
19 }
20 
21 namespace Akonadi
22 {
23 class Item;
24 
25 class ContactViewer;
26 class ContactViewerDialogPrivate;
27 
28 /**
29  * @short A dialog for displaying a contact in Akonadi.
30  *
31  * This dialog provides a way to show a contact from the
32  * Akonadi storage.
33  *
34  * Example:
35  *
36  * @code
37  *
38  * using namespace Akonadi;
39  *
40  * const Item contact = ...
41  *
42  * ContactViewerDialog *dlg = new ContactViewerDialog( this );
43  * dlg->setContact( contact );
44  * dlg->show();
45  *
46  * @endcode
47  *
48  * @author Tobias Koenig <[email protected]>
49  * @since 4.4
50  */
51 class AKONADI_CONTACT_EXPORT ContactViewerDialog : public QDialog
52 {
53  Q_OBJECT
54 
55 public:
56  /**
57  * Creates a new contact viewer dialog.
58  *
59  * @param parent The parent widget of the dialog.
60  */
61  explicit ContactViewerDialog(QWidget *parent = nullptr);
62 
63  /**
64  * Destroys the contact viewer dialog.
65  */
66  ~ContactViewerDialog() override;
67 
68  /**
69  * Returns the contact that is currently displayed.
70  */
71  Q_REQUIRED_RESULT Akonadi::Item contact() const;
72 
73  /**
74  * Returns the ContactViewer that is used by this dialog.
75  */
76  ContactViewer *viewer() const;
77 
78 public Q_SLOTS:
79  /**
80  * Sets the @p contact that shall be displayed in the dialog.
81  */
82  void setContact(const Akonadi::Item &contact);
83 
84 private:
85  //@cond PRIVATE
86  std::unique_ptr<ContactViewerDialogPrivate> const d;
87  //@endcond
88 };
89 }
A dialog for displaying a contact in Akonadi.
A viewer component for contacts in Akonadi.
Definition: contactviewer.h:64
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.