KContacts::Email Class

class KContacts::Email

Class that holds a Email for a contact. More...

Header: #include <KContacts/Email>
CMake: find_package(KF6 REQUIRED COMPONENTS Contacts)
target_link_libraries(mytarget PRIVATE KF6::Contacts)
Since: 4.14.5
In QML: email

Public Types

List
flags Type
enum TypeFlag { Unknown, Home, Work, Other }

Properties

Public Functions

Email()
Email(const QString &mail)
(since 5.12) bool isPreferred() const
bool isValid() const
QString mail() const
void setEmail(const QString &mail)
(since 5.12) void setPreferred(bool preferred)
(since 5.12) void setType(KContacts::Email::Type type)
QString toString() const
(since 5.12) KContacts::Email::Type type() const
bool operator!=(const KContacts::Email &other) const
bool operator==(const KContacts::Email &other) const
QDataStream &operator<<(QDataStream &stream, const KContacts::Email &object)
QDataStream &operator>>(QDataStream &stream, KContacts::Email &object)

Detailed Description

Member Type Documentation

Email::List

enum Email::TypeFlag
flags Email::Type

Email types.

ConstantValueDescription
KContacts::Email::Unknown0No or unknown email type is set
KContacts::Email::Home1Personal email
KContacts::Email::Work2Work email
KContacts::Email::Other4Other email

The Type type is a typedef for QFlags<TypeFlag>. It stores an OR combination of TypeFlag values.

Property Documentation

email : QString

Access functions:

QString mail() const
void setEmail(const QString &mail)

isPreferred : bool

Access functions:

bool isPreferred() const
void setPreferred(bool preferred)

[read-only] isValid : const bool

Access functions:

bool isValid() const

type : Type

Access functions:

KContacts::Email::Type type() const
void setType(KContacts::Email::Type type)

Member Function Documentation

Email::Email()

Creates an empty email object.

See also setEmail().

[invokable] Email::Email(const QString &mail)

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

[since 5.12] bool Email::isPreferred() const

Returns whether this is the preferred email address.

Note: Getter function for property isPreferred.

This function was introduced in 5.12.

bool Email::isValid() const

Note: Getter function for property isValid.

QString Email::mail() const

Note: Getter function for property email.

void Email::setEmail(const QString &mail)

Note: Setter function for property email.

[since 5.12] void Email::setPreferred(bool preferred)

Sets that this is the preferred email address.

Note: Setter function for property isPreferred.

This function was introduced in 5.12.

See also isPreferred().

[since 5.12] void Email::setType(KContacts::Email::Type type)

Sets the email type.

Note: Setter function for property type.

This function was introduced in 5.12.

See also type().

QString Email::toString() const

[since 5.12] KContacts::Email::Type Email::type() const

Returns the type of the email.

Note: Getter function for property type.

This function was introduced in 5.12.

See also setType().

bool Email::operator!=(const KContacts::Email &other) const

bool Email::operator==(const KContacts::Email &other) const

Related Non-Members

QDataStream &operator<<(QDataStream &stream, const KContacts::Email &object)

QDataStream &operator>>(QDataStream &stream, KContacts::Email &object)