Akonadi Contacts

emailaddressselection.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 <QSharedDataPointer>
15 #include <QString>
16 #include <QVector>
17 
18 namespace Akonadi
19 {
20 class Item;
21 
22 /**
23  * @short An selection of an email address and corresponding name.
24  *
25  * This class encapsulates the selection of an email address and name
26  * as it is returned by EmailAddressSelectionWidget or EmailAddressSelectionDialog.
27  *
28  * It offers convenience methods to retrieve the quoted version of the
29  * email address and access to the Akonadi item that is associated with
30  * this address.
31  *
32  * @author Tobias Koenig <[email protected]>
33  * @since 4.5
34  */
35 class AKONADI_CONTACT_EXPORT EmailAddressSelection
36 {
37 public:
38  /**
39  * A list of email address selection objects.
40  */
42 
43  /**
44  * Creates a new email address selection.
45  */
47 
48  /**
49  * Creates a new email address selection from an @p other selection.
50  */
52 
53  /**
54  * Replaces this email address selection with the @p other selection.
55  */
56  EmailAddressSelection &operator=(const EmailAddressSelection &other);
57 
58  /**
59  * Destroys the email address selection.
60  */
62 
63  /**
64  * Returns whether the selection is valid.
65  */
66  Q_REQUIRED_RESULT bool isValid() const;
67 
68  /**
69  * Returns the name that is associated with the selected email address.
70  */
71  Q_REQUIRED_RESULT QString name() const;
72 
73  /**
74  * Returns the address part of the selected email address.
75  *
76  * @note If a contact group has been selected, the name of the contact
77  * group is returned here and must be expanded by the caller.
78  */
79  Q_REQUIRED_RESULT QString email() const;
80 
81  /**
82  * Returns the name and email address together, properly quoted if needed.
83  *
84  * @note If a contact group has been selected, the name of the contact
85  * group is returned here and must be expanded by the caller.
86  */
87  Q_REQUIRED_RESULT QString quotedEmail() const;
88 
89  /**
90  * Returns the Akonadi item that is associated with the selected email address.
91  */
92  Q_REQUIRED_RESULT Akonadi::Item item() const;
93 
94 private:
95  //@cond PRIVATE
96  friend class EmailAddressSelectionWidget;
97 
98  class Private;
100  //@endcond
101 };
102 }
103 
104 Q_DECLARE_TYPEINFO(Akonadi::EmailAddressSelection, Q_MOVABLE_TYPE);
105 
An selection of an email address and corresponding name.
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 Tue Jun 22 2021 23:08:52 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.