Classes | |
class | IdMapper |
class | NetworkStatus |
Enumerations | |
enum | EmailParseResult { AddressOk , AddressEmpty , UnexpectedEnd , UnbalancedParens , MissingDomainPart , UnclosedAngleAddr , UnopenedAngleAddr , TooManyAts , UnexpectedComma , TooFewAts , MissingLocalPart , UnbalancedQuote , NoAddressSpec , DisallowedChar , InvalidDisplayName } |
Functions | |
TDE_EXPORT TQStringList | splitEmailAddrList (const TQString &aStr) |
TDE_EXPORT EmailParseResult | splitAddress (const TQCString &address, TQCString &displayName, TQCString &addrSpec, TQCString &comment) |
TDE_EXPORT EmailParseResult | splitAddress (const TQString &address, TQString &displayName, TQString &addrSpec, TQString &comment) |
TDE_EXPORT EmailParseResult | isValidEmailAddress (const TQString &aStr) |
TDE_EXPORT TQString | emailParseResultToString (EmailParseResult errorCode) |
TDE_EXPORT bool | isValidSimpleEmailAddress (const TQString &aStr) |
TDE_EXPORT TQString | simpleEmailAddressErrorMsg () |
TDE_EXPORT TQCString | getEmailAddress (const TQCString &address) |
TDE_EXPORT TQString | getEmailAddress (const TQString &address) |
TDE_EXPORT TQCString | getFirstEmailAddress (const TQCString &addresses) |
TDE_EXPORT TQString | getFirstEmailAddress (const TQString &addresses) |
TDE_EXPORT bool | getNameAndMail (const TQString &aStr, TQString &name, TQString &mail) |
TDE_EXPORT bool | compareEmail (const TQString &email1, const TQString &email2, bool matchName) |
TDE_EXPORT TQString | normalizedAddress (const TQString &displayName, const TQString &addrSpec, const TQString &comment) |
TDE_EXPORT TQString | decodeIDN (const TQString &addrSpec) |
TDE_EXPORT TQString | encodeIDN (const TQString &addrSpec) |
TDE_EXPORT TQString | normalizeAddressesAndDecodeIDNs (const TQString &addresses) |
TDE_EXPORT TQString | normalizeAddressesAndEncodeIDNs (const TQString &str) |
TDE_EXPORT TQString | quoteNameIfNecessary (const TQString &str) |
Detailed Description
KPIM holds all kinds of functions specific to KDE PIM.
The KPIM namespace hides away functions, enums, and other things that are KDE PIM specific and that we don't want to have polluting the global namespace.
Enumeration Type Documentation
◆ EmailParseResult
Function Documentation
◆ compareEmail()
bool KPIM::compareEmail | ( | const TQString & | email1, |
const TQString & | email2, | ||
bool | matchName | ||
) |
◆ decodeIDN()
TQString KPIM::decodeIDN | ( | const TQString & | addrSpec | ) |
◆ emailParseResultToString()
TQString KPIM::emailParseResultToString | ( | EmailParseResult | errorCode | ) |
◆ encodeIDN()
TQString KPIM::encodeIDN | ( | const TQString & | addrSpec | ) |
◆ getEmailAddress() [1/2]
TQCString KPIM::getEmailAddress | ( | const TQCString & | address | ) |
Returns the pure email address (addr-spec in RFC2822) of the given address (mailbox in RFC2822).
- Parameters
-
address an email address, e.g. "Joe User <joe.user@example.org>"
- Returns
- the addr-spec of address, i.e. joe.u.nosp@m.ser@.nosp@m.examp.nosp@m.le.o.nosp@m.rg in the example
◆ getEmailAddress() [2/2]
TQString KPIM::getEmailAddress | ( | const TQString & | 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).
- Parameters
-
address an email address, e.g. "Joe User <joe.user@example.org>"
- Returns
- the addr-spec of address, i.e. joe.u.nosp@m.ser@.nosp@m.examp.nosp@m.le.o.nosp@m.rg in the example
◆ getFirstEmailAddress() [1/2]
TQCString KPIM::getFirstEmailAddress | ( | const TQCString & | addresses | ) |
Returns the pure email address (addr-spec in RFC2822) of the first email address of a list of addresses.
- Parameters
-
addresses an email address, e.g. "Joe User <joe.user@example.org>"
- Returns
- the addr-spec of addresses, i.e. joe.u.nosp@m.ser@.nosp@m.examp.nosp@m.le.o.nosp@m.rg in the example
◆ getFirstEmailAddress() [2/2]
TQString KPIM::getFirstEmailAddress | ( | const TQString & | 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.
- Parameters
-
addresses an email address, e.g. "Joe User <joe.user@example.org>"
- Returns
- the addr-spec of addresses, i.e. joe.u.nosp@m.ser@.nosp@m.examp.nosp@m.le.o.nosp@m.rg in the example
◆ getNameAndMail()
bool KPIM::getNameAndMail | ( | const TQString & | aStr, |
TQString & | name, | ||
TQString & | |||
) |
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.
◆ isValidEmailAddress()
KPIM::EmailParseResult KPIM::isValidEmailAddress | ( | const TQString & | aStr | ) |
Validates an email address in the form of "Joe User" joe@e.nosp@m.xamp.nosp@m.le.or.nosp@m.g.
Returns AddressOk if no error was encountered. Otherwise an appropriate error code is returned.
- Parameters
-
aStr a single email address, example: Joe User (comment1) joe.u.nosp@m.ser@.nosp@m.examp.nosp@m.le.o.nosp@m.rg
- Returns
- AddressOk if no error was encountered. Otherwise an appropriate error code is returned.
◆ isValidSimpleEmailAddress()
bool KPIM::isValidSimpleEmailAddress | ( | const TQString & | aStr | ) |
Validates an email address in the form of joe@e.nosp@m.xamp.nosp@m.le.or.nosp@m.g.
Returns true if no error was encountered. This method should be used when the input field should not allow a "full" email address with comments and other special cases that normally are valid in an email address.
- Parameters
-
aStr a single email address, example: joe.u.nosp@m.ser@.nosp@m.examp.nosp@m.le.o.nosp@m.rg
- Returns
- true if no error was encountered.
◆ normalizeAddressesAndDecodeIDNs()
TQString KPIM::normalizeAddressesAndDecodeIDNs | ( | const TQString & | addresses | ) |
◆ normalizeAddressesAndEncodeIDNs()
TQString KPIM::normalizeAddressesAndEncodeIDNs | ( | const TQString & | str | ) |
◆ normalizedAddress()
TQString KPIM::normalizedAddress | ( | const TQString & | displayName, |
const TQString & | addrSpec, | ||
const TQString & | comment | ||
) |
Returns a normalized address built from the given parts.
The normalized address is of one the following forms:
- displayName (comment) <addrSpec>
- displayName <addrSpec>
- comment <addrSpec>
- addrSpec
- Parameters
-
displayName the display name of the address addrSpec the actual email address (addr-spec in RFC 2822) comment a comment
- Returns
- a normalized address built from the given parts
◆ quoteNameIfNecessary()
TQString KPIM::quoteNameIfNecessary | ( | const TQString & | str | ) |
◆ simpleEmailAddressErrorMsg()
TQString KPIM::simpleEmailAddressErrorMsg | ( | ) |
◆ splitAddress() [1/2]
KPIM::EmailParseResult KPIM::splitAddress | ( | const TQCString & | address, |
TQCString & | displayName, | ||
TQCString & | addrSpec, | ||
TQCString & | comment | ||
) |
Splits the given address into display name, email address and comment.
Returns AddressOk if no error was encountered. Otherwise an appropriate error code is returned. In case of an error the values of displayName, addrSpec and comment are undefined.
- Parameters
-
address a single email address, example: Joe User (comment1) joe.u.nosp@m.ser@.nosp@m.examp.nosp@m.le.o.nosp@m.rg (comment2) displayName only out: the display-name of the email address, i.e. "Joe User" in the example; in case of an error the return value is undefined addrSpec only out: the addr-spec, i.e. "joe.user@example.org" in the example; in case of an error the return value is undefined comment only out: the space-separated comments, i.e. "comment1 comment2" in the example; in case of an error the return value is undefined
- Returns
- AddressOk if no error was encountered. Otherwise an appropriate error code is returned.
◆ splitAddress() [2/2]
KPIM::EmailParseResult KPIM::splitAddress | ( | const TQString & | address, |
TQString & | displayName, | ||
TQString & | addrSpec, | ||
TQString & | comment | ||
) |
This is an overloaded member function, provided for convenience.
It behaves essentially like the above function.
Splits the given address into display name, email address and comment. Returns AddressOk if no error was encountered. Otherwise an appropriate error code is returned. In case of an error the values of displayName, addrSpec and comment are undefined.
- Parameters
-
address a single email address, example: Joe User (comment1) joe.u.nosp@m.ser@.nosp@m.examp.nosp@m.le.o.nosp@m.rg (comment2) displayName only out: the display-name of the email address, i.e. "Joe User" in the example; in case of an error the return value is undefined addrSpec only out: the addr-spec, i.e. "joe.user@example.org" in the example; in case of an error the return value is undefined comment only out: the space-separated comments, i.e. "comment1 comment2" in the example; in case of an error the return value is undefined
- Returns
- AddressOk if no error was encountered. Otherwise an appropriate error code is returned.