KCodecs 5.109.0
|
Functions | |
bool | KEmailAddress::compareEmail (const QString &email1, const QString &email2, bool matchName) |
Compare two email addresses. | |
QByteArray | KEmailAddress::extractEmailAddress (const QByteArray &address) |
Returns the pure email address (addr-spec in RFC2822) of the given address (mailbox in RFC2822). | |
QByteArray | KEmailAddress::extractEmailAddress (const QByteArray &address, QString &errorMessage) |
Returns the pure email address (addr-spec in RFC2822) of the given address (mailbox in RFC2822). | |
QString | KEmailAddress::extractEmailAddress (const QString &address) |
This is an overloaded member function, provided for convenience. | |
QString | KEmailAddress::extractEmailAddress (const QString &address, QString &errorMessage) |
Returns the pure email address (addr-spec in RFC2822) of the first email address of a list of addresses. | |
bool | KEmailAddress::extractEmailAddressAndName (const QString &aStr, QString &mail, QString &name) |
Return email address and name from string. | |
QByteArray | KEmailAddress::firstEmailAddress (const QByteArray &addresses) |
Returns the pure email address (addr-spec in RFC2822) of the first email address of a list of addresses. | |
QByteArray | KEmailAddress::firstEmailAddress (const QByteArray &addresses, QString &errorMessage) |
Returns the pure email address (addr-spec in RFC2822) of the first email address of a list of addresses. | |
QString | KEmailAddress::firstEmailAddress (const QString &addresses) |
This is an overloaded member function, provided for convenience. | |
QString | KEmailAddress::firstEmailAddress (const QString &addresses, QString &errorMessage) |
This is an overloaded member function, provided for convenience. | |
QString | KEmailAddress::normalizedAddress (const QString &displayName, const QString &addrSpec, const QString &comment=QString()) |
Returns a normalized address built from the given parts. | |
QString | KEmailAddress::quoteNameIfNecessary (const QString &str) |
Add quote characters around the given string if it contains a character that makes that necessary, in an email name, such as ",". | |
bool KEmailAddress::compareEmail | ( | const QString & | email1, |
const QString & | email2, | ||
bool | matchName | ||
) |
Compare two email addresses.
If matchName is false, it just checks the email address, and returns true if this matches. If matchName is true, both the name and the email must be the same.
email1 | the first email address to use for comparison |
email2 | the second email address to use for comparison |
matchName | if set to true email address and displayname must match |
QByteArray KEmailAddress::extractEmailAddress | ( | const QByteArray & | address | ) |
Returns the pure email address (addr-spec in RFC2822) of the given address (mailbox in RFC2822).
address | an email address, e.g. "Joe User <joe.user@example.org>" |
QByteArray KEmailAddress::extractEmailAddress | ( | const QByteArray & | address, |
QString & | errorMessage | ||
) |
Returns the pure email address (addr-spec in RFC2822) of the given address (mailbox in RFC2822).
address | an email address, e.g. "Joe User <joe.user@example.org>" |
errorMessage | return error message when we can't parse email |
QString KEmailAddress::extractEmailAddress | ( | const QString & | address | ) |
This is an overloaded member function, provided for convenience.
It behaves essentially like the above function.
Returns the pure email address (addr-spec in RFC2822) of the given address (mailbox in RFC2822).
address | an email address, e.g. "Joe User <joe.user@example.org>" |
QString KEmailAddress::extractEmailAddress | ( | const QString & | address, |
QString & | errorMessage | ||
) |
Returns the pure email address (addr-spec in RFC2822) of the first email address of a list of addresses.
addresses | an email address, e.g. "Joe User <joe.user@example.org>" |
errorMessage | return error message when we can't parse email |
bool KEmailAddress::extractEmailAddressAndName | ( | const QString & | aStr, |
QString & | mail, | ||
QString & | name | ||
) |
Return email address and name from string.
Examples: "Stefan Taferner <taferner@example.org>" returns "taferner@example.org" and "Stefan Taferner". "joe@example.com" returns "joe@example.com" and "". Note that this only returns the first address.
Also note that the return value is true if both the name and the mail are not empty: this does NOT tell you if mail contains a valid email address or just some rubbish.
aStr | an email address, e.g "Joe User <joe.user@example.org>" |
name | only out: returns the displayname, "Joe User" in the example |
only out: returns the email address "joe.user@example.org" in the example |
QByteArray KEmailAddress::firstEmailAddress | ( | const QByteArray & | addresses | ) |
Returns the pure email address (addr-spec in RFC2822) of the first email address of a list of addresses.
addresses | an email address, e.g. "Joe User <joe.user@example.org>" |
QByteArray KEmailAddress::firstEmailAddress | ( | const QByteArray & | addresses, |
QString & | errorMessage | ||
) |
Returns the pure email address (addr-spec in RFC2822) of the first email address of a list of addresses.
addresses | an email address, e.g. "Joe User <joe.user@example.org>" |
errorMessage | return error message when we can't parse email |
QString KEmailAddress::firstEmailAddress | ( | const QString & | addresses | ) |
This is an overloaded member function, provided for convenience.
It behaves essentially like the above function.
Returns the pure email address (addr-spec in RFC2822) of the first email address of a list of addresses.
addresses | an email address, e.g. "Joe User <joe.user@example.org>" |
QString KEmailAddress::firstEmailAddress | ( | const QString & | addresses, |
QString & | errorMessage | ||
) |
This is an overloaded member function, provided for convenience.
It behaves essentially like the above function.
Returns the pure email address (addr-spec in RFC2822) of the first email address of a list of addresses.
addresses | an email address, e.g. "Joe User <joe.user@example.org>" |
errorMessage | return error message when we can't parse email |
QString KEmailAddress::normalizedAddress | ( | const QString & | displayName, |
const QString & | addrSpec, | ||
const QString & | comment = QString() |
||
) |
Returns a normalized address built from the given parts.
The normalized address is of one the following forms:
displayName | the display name of the address |
addrSpec | the actual email address (addr-spec in RFC 2822) |
comment | a comment |
QString KEmailAddress::quoteNameIfNecessary | ( | const QString & | str | ) |
Add quote characters around the given string if it contains a character that makes that necessary, in an email name, such as ",".
str | a string that may need quoting |