KABC::Addressee Class Reference
#include <addressee.src.h>
Detailed Description
address book entryThis class represents an entry in the address book.
The data of this class is implicitly shared. You can pass this class by value.
If you need the name of a field for presenting it to the user you should use the functions ending in Label(). They return a translated string which can be used as label for the corresponding field.
About the name fields:
givenName() is the first name and familyName() the last name. In some countries the family name comes first, that's the reason for the naming. formattedName() is the full name with the correct formatting. It is used as an override, when the correct formatting can't be generated from the other name fields automatically.
realName() returns a fully formatted name(). It uses formattedName, if set, otherwise it constucts the name from the name fields. As fallback, if nothing else is set it uses name().
name() is the NAME type of RFC2426. It can be used as internal name for the data enty, but shouldn't be used for displaying the data to the user.
Definition at line 74 of file addressee.src.h.
Public Types | |
| typedef QValueList< Addressee > | List |
| typedef QMap< QString, Addressee > | Map |
Public Member Functions | |
| Addressee () | |
| Addressee (const Addressee &) | |
| Addressee & | operator= (const Addressee &) |
| bool | operator== (const Addressee &) const |
| bool | operator!= (const Addressee &) const |
| bool | isEmpty () const |
| void | setUid (const QString &uid) |
| QString | uid () const |
| DECLARATIONS void | setNameFromString (const QString &) |
| QString | realName () const |
| QString | assembledName () const |
| QString | fullEmail (const QString &email=QString::null) const |
| void | insertEmail (const QString &email, bool preferred=false) |
| void | removeEmail (const QString &email) |
| QString | preferredEmail () const |
| QStringList | emails () const |
| void | setEmails (const QStringList &list) |
| void | insertPhoneNumber (const PhoneNumber &phoneNumber) |
| void | removePhoneNumber (const PhoneNumber &phoneNumber) |
| PhoneNumber | phoneNumber (int type) const |
| PhoneNumber::List | phoneNumbers () const |
| PhoneNumber::List | phoneNumbers (int type) const |
| PhoneNumber | findPhoneNumber (const QString &id) const |
| void | insertKey (const Key &key) |
| void | removeKey (const Key &key) |
| Key | key (int type, QString customTypeString=QString::null) const |
| Key::List | keys () const |
| void | setKeys (const Key::List &keys) |
| Key::List | keys (int type, QString customTypeString=QString::null) const |
| Key | findKey (const QString &id) const |
| void | insertAddress (const Address &address) |
| void | removeAddress (const Address &address) |
| Address | address (int type) const |
| Address::List | addresses () const |
| Address::List | addresses (int type) const |
| Address | findAddress (const QString &id) const |
| void | insertCategory (const QString &) |
| void | removeCategory (const QString &) |
| bool | hasCategory (const QString &) const |
| void | setCategories (const QStringList &) |
| QStringList | categories () const |
| void | insertCustom (const QString &app, const QString &name, const QString &value) |
| void | removeCustom (const QString &app, const QString &name) |
| QString | custom (const QString &app, const QString &name) const |
| void | setCustoms (const QStringList &) |
| QStringList | customs () const |
| void | dump () const |
| QString | asString () const |
| void | setResource (Resource *resource) |
| Resource * | resource () const |
| void | setChanged (bool value) |
| bool | changed () const |
| bool | operator< (const Addressee &addr) |
Static Public Member Functions | |
| static QString | uidLabel () |
| static void | parseEmailAddress (const QString &rawEmail, QString &fullName, QString &email) |
| static void | setSortMode (KABC::SortMode *mode) |
Friends | |
| KABC_EXPORT QDataStream & | operator<< (QDataStream &, const Addressee &) |
| KABC_EXPORT QDataStream & | operator>> (QDataStream &, Addressee &) |
Constructor & Destructor Documentation
| KABC::Addressee::Addressee | ( | ) |
Construct an empty address book entry.
Member Function Documentation
| Address KABC::Addressee::address | ( | int | type | ) | const |
Return address, which matches the given type.
| Address::List KABC::Addressee::addresses | ( | int | type | ) | const |
Return list of addresses with a special type.
| Address::List KABC::Addressee::addresses | ( | ) | const |
Return list of all addresses.
| QString KABC::Addressee::assembledName | ( | ) | const |
Return the name that consists of all name parts.
| QString KABC::Addressee::asString | ( | ) | const |
Returns string representation of the addressee.
| QStringList KABC::Addressee::categories | ( | ) | const |
Return list of all set categories.
| bool KABC::Addressee::changed | ( | ) | const |
Return whether the addressee is changed.
Return value of custom entry, identified by app and entry name.
| QStringList KABC::Addressee::customs | ( | ) | const |
Return list of all custom entries.
| void KABC::Addressee::dump | ( | ) | const |
Debug output.
| QStringList KABC::Addressee::emails | ( | ) | const |
Return list of all email addresses.
| PhoneNumber KABC::Addressee::findPhoneNumber | ( | const QString & | id | ) | const |
Return phone number with the given id.
Return email address including real name.
- Parameters:
-
email Email address to be used to construct the full email string. If this is QString::null the preferred email address is used.
| bool KABC::Addressee::hasCategory | ( | const QString & | ) | const |
Return, if addressee has the given category.
| void KABC::Addressee::insertAddress | ( | const Address & | address | ) |
Insert an address.
If an address with the same id already exists in this addressee it is not duplicated.
| void KABC::Addressee::insertCategory | ( | const QString & | ) |
Insert category.
If the category already exists it is not duplicated.
| void KABC::Addressee::insertCustom | ( | const QString & | app, | |
| const QString & | name, | |||
| const QString & | value | |||
| ) |
Insert custom entry.
The entry is identified by the name of the inserting application and a unique name. If an entry with the given app and name already exists its value is replaced with the new given value.
An empty value isn't allowed (nothing happens if this is called with any of the three arguments being empty)
| void KABC::Addressee::insertEmail | ( | const QString & | email, | |
| bool | preferred = false | |||
| ) |
Insert an email address.
If the email address already exists in this addressee it is not duplicated.
- Parameters:
-
email Email address preferred Set to true, if this is the preferred email address of the addressee.
| void KABC::Addressee::insertKey | ( | const Key & | key | ) |
Insert a key.
If a key with the same id already exists in this addressee it is not duplicated.
| void KABC::Addressee::insertPhoneNumber | ( | const PhoneNumber & | phoneNumber | ) |
Insert a phone number.
If a phone number with the same id already exists in this addressee it is not duplicated.
| bool KABC::Addressee::isEmpty | ( | ) | const |
Return, if the address book entry is empty.
Return key, which matches the given type.
If type == Key::Custom you can specify a string that should match. If you leave the string empty, the first key with a custom value is returned.
Return list of keys with a special type.
If type == Key::Custom you can specify a string that should match. If you leave the string empty, all custom keys will be returned.
| Key::List KABC::Addressee::keys | ( | ) | const |
Return list of all keys.
| static void KABC::Addressee::parseEmailAddress | ( | const QString & | rawEmail, | |
| QString & | fullName, | |||
| QString & | ||||
| ) | [static] |
Parse full email address.
The result is given back in fullName and email.
| PhoneNumber KABC::Addressee::phoneNumber | ( | int | type | ) | const |
Return phone number, which matches the given type.
| PhoneNumber::List KABC::Addressee::phoneNumbers | ( | int | type | ) | const |
Return list of phone numbers with a special type.
| PhoneNumber::List KABC::Addressee::phoneNumbers | ( | ) | const |
Return list of all phone numbers.
| QString KABC::Addressee::preferredEmail | ( | ) | const |
Return preferred email address.
This is the first email address or the last one added with insertEmail() with a set preferred parameter.
| QString KABC::Addressee::realName | ( | ) | const |
Return the name of the addressee.
This is calculated from all the name fields.
| void KABC::Addressee::removeAddress | ( | const Address & | address | ) |
Remove address.
If no address with the given id exists for this addresse nothing happens.
| void KABC::Addressee::removeCategory | ( | const QString & | ) |
Remove category.
Remove custom entry.
| void KABC::Addressee::removeEmail | ( | const QString & | ) |
Remove email address.
If the email address doesn't exist, nothing happens.
| void KABC::Addressee::removeKey | ( | const Key & | key | ) |
Remove a key.
If no key with the given id exists for this addresse nothing happens.
| void KABC::Addressee::removePhoneNumber | ( | const PhoneNumber & | phoneNumber | ) |
Remove phone number.
If no phone number with the given id exists for this addresse nothing happens.
| Resource* KABC::Addressee::resource | ( | ) | const |
Return pointer to resource.
| void KABC::Addressee::setCategories | ( | const QStringList & | ) |
Set categories to given value.
| void KABC::Addressee::setChanged | ( | bool | value | ) |
Mark addressee as changed.
| void KABC::Addressee::setCustoms | ( | const QStringList & | ) |
Set all custom entries.
| void KABC::Addressee::setEmails | ( | const QStringList & | list | ) |
Set the emails to list.
The first email address gets the preferred one!
- Parameters:
-
list The list of email addresses.
| void KABC::Addressee::setKeys | ( | const Key::List & | keys | ) |
Set the list of keys.
- Parameters:
-
keys The keys to be set.
| DECLARATIONS void KABC::Addressee::setNameFromString | ( | const QString & | ) |
Set name fields by parsing the given string and trying to associate the parts of the string with according fields.
This function should probably be a bit more clever.
| void KABC::Addressee::setResource | ( | Resource * | resource | ) |
Set resource where the addressee is from.
| void KABC::Addressee::setUid | ( | const QString & | uid | ) |
Set unique identifier.
| QString KABC::Addressee::uid | ( | ) | const |
Return unique identifier.
| static QString KABC::Addressee::uidLabel | ( | ) | [static] |
Return translated label for uid field.
The documentation for this class was generated from the following file:

