Akonadi Contacts

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

KDE's Doxygen guidelines are available online.