Akonadi::EmailAddressSelection Class

An selection of an email address and corresponding name. More...

Header: #include <Akonadi/EmailAddressSelection>
CMake: find_package(KPim6AkonadiContactCore REQUIRED)
target_link_libraries(mytarget PRIVATE KPim6::AkonadiContactCore)

Public Functions

EmailAddressSelection()
EmailAddressSelection(const Akonadi::EmailAddressSelection &other)
~EmailAddressSelection()
QString email() const
bool isValid() const
Akonadi::Item item() const
QString name() const
QString quotedEmail() const
void setItem(const Akonadi::Item &item)
Akonadi::EmailAddressSelection &operator=(const Akonadi::EmailAddressSelection &other)

Detailed Description

This class encapsulates the selection of an email address and name as it is returned by EmailAddressSelectionWidget or EmailAddressSelectionDialog.

It offers convenience methods to retrieve the quoted version of the email address and access to the Akonadi item that is associated with this address.

Author: Tobias Koenig <tokoe@kde.org>

Member Function Documentation

EmailAddressSelection::EmailAddressSelection()

Creates a new email address selection.

EmailAddressSelection::EmailAddressSelection(const Akonadi::EmailAddressSelection &other)

Creates a new email address selection from an other selection.

[noexcept] EmailAddressSelection::~EmailAddressSelection()

Destroys the email address selection.

QString EmailAddressSelection::email() const

Returns the address part of the selected email address.

Note: If a contact group has been selected, the name of the contact group is returned here and must be expanded by the caller.

bool EmailAddressSelection::isValid() const

Returns whether the selection is valid.

Akonadi::Item EmailAddressSelection::item() const

Returns the Akonadi item that is associated with the selected email address.

See also setItem().

QString EmailAddressSelection::name() const

Returns the name that is associated with the selected email address.

QString EmailAddressSelection::quotedEmail() const

Returns the name and email address together, properly quoted if needed.

Note: If a contact group has been selected, the name of the contact group is returned here and must be expanded by the caller.

void EmailAddressSelection::setItem(const Akonadi::Item &item)

Sets the Akonadi item that is associated with the selected email address.

See also item().

Akonadi::EmailAddressSelection &EmailAddressSelection::operator=(const Akonadi::EmailAddressSelection &other)

Replaces this email address selection with the other selection.