Akonadi Contacts

emailaddressselectiondialog.h
1 /*
2  This file is part of Akonadi Contact.
3 
4  SPDX-FileCopyrightText: 2010 KDAB
5  SPDX-FileContributor: Tobias Koenig <[email protected]>
6 
7  SPDX-License-Identifier: LGPL-2.0-or-later
8 */
9 
10 #pragma once
11 
12 #include "akonadi-contact_export.h"
13 
14 #include "abstractemailaddressselectiondialog.h"
15 #include "emailaddressselectionwidget.h"
16 
17 namespace Akonadi
18 {
19 /**
20  * @short A dialog to select email addresses from Akonadi.
21  *
22  * This dialog allows the user to select an name and email address from
23  * the Akonadi storage.
24  * The selected addresses are returned as EmailAddressSelectionWidget::Selection objects
25  * which encapsulate the name, email address and the Akonadi item that has been selected.
26  *
27  * Example:
28  *
29  * @code
30  *
31  * Akonadi::EmailAddressSelectionDialog dlg( this );
32  * if ( dlg.exec() ) {
33  * const Akonadi::EmailAddressSelectionWidget::Selection::List selections = dlg.selectedAddresses();
34  * foreach ( const Akonadi::EmailAddressSelectionWidget::Selection &selection, selections ) {
35  * qCDebug(AKONADICONTACT_LOG) << "Name:" << selection.name() << "Email:" << selection.email();
36  * }
37  * }
38  *
39  * @endcode
40  *
41  * @author Tobias Koenig <[email protected]>
42  * @since 4.5
43  */
44 class AKONADI_CONTACT_EXPORT EmailAddressSelectionDialog : public AbstractEmailAddressSelectionDialog
45 {
46  Q_OBJECT
47 
48 public:
49  /**
50  * Creates a new email address selection dialog.
51  *
52  * @param parent The parent widget.
53  */
54  explicit EmailAddressSelectionDialog(QWidget *parent = nullptr);
55 
56  /**
57  * Creates a new email address selection dialog.
58  *
59  * @param model A custom, ContactsTreeModel based model to use.
60  * @param parent The parent widget.
61  */
62  explicit EmailAddressSelectionDialog(QAbstractItemModel *model, QWidget *parent = nullptr);
63 
64  /**
65  * Destroys the email address selection dialog.
66  */
67  ~EmailAddressSelectionDialog() override;
68 
69  /**
70  * Returns the list of selected email addresses.
71  */
72  Q_REQUIRED_RESULT EmailAddressSelection::List selectedAddresses() const override;
73 
74  /**
75  * Returns the email address selection view that is used.
76  */
77  Q_REQUIRED_RESULT EmailAddressSelectionWidget *view() const override;
78 
79 private:
80  //@cond PRIVATE
81  class Private;
82  Private *const d;
83  //@endcond
84 };
85 }
86 
A dialog to select email addresses from Akonadi.
A widget to select email addresses from Akonadi.
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Thu Jun 17 2021 23:09:02 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.