KABC::Addressee Class Reference
address book entry. More...
#include <addressee.src.h>
Public Types | |
typedef QValueList< Addressee > | List |
typedef QMap< QString, Addressee > | Map |
Public Methods | |
Addressee () | |
~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 Methods | |
QString | uidLabel () |
void | parseEmailAddress (const QString &rawEmail, QString &fullName, QString &email) |
void | setSortKey (KABC::Field *field) |
Friends | |
QDataStream & | operator<< (QDataStream &, const Addressee &) |
QDataStream & | operator>> (QDataStream &, Addressee &) |
Detailed Description
address book entry.This 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 73 of file addressee.src.h.
Constructor & Destructor Documentation
|
Construct an empty address book entry.
Definition at line 70 of file addressee.src.cpp. |
Member Function Documentation
|
Return, if the address book entry is empty.
Definition at line 125 of file addressee.src.cpp. Referenced by KABC::AddressBook::findByUid(), KABC::AddressBook::insertAddressee(), and KABC::DistributionListManager::load(). |
|
Set unique identifier.
Definition at line 130 of file addressee.src.cpp. |
|
Return unique identifier.
Definition at line 138 of file addressee.src.cpp. References KApplication::randomString(). Referenced by dump(), KABC::AddressBook::find(), KABC::AddressBook::insertAddressee(), KABC::DistributionList::insertEntry(), KABC::ResourceFile::removeAddressee(), KABC::DistributionList::removeEntry(), and KABC::StdAddressBook::setWhoAmI(). |
|
Return translated label for uid field.
Definition at line 146 of file addressee.src.cpp. |
|
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. Definition at line 153 of file addressee.src.cpp. References QString::append(), QString::find(), QString::isEmpty(), QString::left(), QString::mid(), QString::prepend(), and QStringList::split(). |
|
Return the name of the addressee. This is calculated from all the name fields. Definition at line 293 of file addressee.src.cpp. References assembledName(), and QString::isEmpty(). Referenced by KABC::AddresseeItem::AddresseeItem(), and fullEmail(). |
|
Return the name that consists of all name parts.
Definition at line 306 of file addressee.src.cpp. References QString::simplifyWhiteSpace(). Referenced by realName(). |
|
Return email address including real name.
Definition at line 314 of file addressee.src.cpp. References QString::find(), QString::isEmpty(), QString::isNull(), preferredEmail(), and realName(). Referenced by KABC::DistributionList::emails(). |
|
Insert an email address. If the email address already exists in this addressee it is not duplicated.
Definition at line 338 of file addressee.src.cpp. References QString::simplifyWhiteSpace(). Referenced by KABC::VCard21Parser::readFromString(). |
|
Remove email address. If the email address doesn't exist, nothing happens. Definition at line 359 of file addressee.src.cpp. |
|
Return preferred email address. This is the first email address or the last one added with insertEmail() with a set preferred parameter. Definition at line 369 of file addressee.src.cpp. References KSharedPtr< AddresseeData >::count(). Referenced by KABC::AddresseeItem::AddresseeItem(), and fullEmail(). |
|
Return list of all email addresses.
Definition at line 375 of file addressee.src.cpp. Referenced by dump(). |
|
Set the emails to.
Definition at line 379 of file addressee.src.cpp. |
|
Insert a phone number. If a phone number with the same id already exists in this addressee it is not duplicated. Definition at line 383 of file addressee.src.cpp. References KABC::PhoneNumber::id(), KABC::PhoneNumber::number(), and QString::simplifyWhiteSpace(). Referenced by KABC::VCard21Parser::readFromString(). |
|
Remove phone number. If no phone number with the given id exists for this addresse nothing happens. Definition at line 399 of file addressee.src.cpp. References KABC::PhoneNumber::id(). |
|
Return phone number, which matches the given type.
Definition at line 412 of file addressee.src.cpp. References QString::isEmpty(), and KABC::PhoneNumber::number(). |
|
Return list of all phone numbers.
Definition at line 428 of file addressee.src.cpp. Referenced by dump(). |
|
Return list of phone numbers with a special type.
Definition at line 433 of file addressee.src.cpp. |
|
Return phone number with the given id.
Definition at line 446 of file addressee.src.cpp. |
|
Insert a key. If a key with the same id already exists in this addressee it is not duplicated. Definition at line 457 of file addressee.src.cpp. References KABC::Key::id(), and KStdAccel::key(). |
|
Remove a key. If no key with the given id exists for this addresse nothing happens. Definition at line 472 of file addressee.src.cpp. References KABC::Key::id(), and KStdAccel::key(). |
|
Return key, which matches the given type.
If Definition at line 485 of file addressee.src.cpp. References QString::isEmpty(). |
|
Return list of all keys.
Definition at line 511 of file addressee.src.cpp. Referenced by dump(). |
|
Set the list of keys.
Definition at line 505 of file addressee.src.cpp. |
|
Return list of keys with a special type.
If Definition at line 516 of file addressee.src.cpp. References QString::isEmpty(). |
|
Return key with the given id.
Definition at line 538 of file addressee.src.cpp. |
|
Insert an address. If an address with the same id already exists in this addressee it is not duplicated. Definition at line 598 of file addressee.src.cpp. References KABC::Address::id(). Referenced by KABC::VCard21Parser::readFromString(). |
|
Remove address. If no address with the given id exists for this addresse nothing happens. Definition at line 613 of file addressee.src.cpp. References KABC::Address::id(). |
|
Return address, which matches the given type.
Definition at line 626 of file addressee.src.cpp. References KABC::Address::isEmpty(). |
|
Return list of all addresses.
Definition at line 642 of file addressee.src.cpp. Referenced by dump(). |
|
Return list of addresses with a special type.
Definition at line 647 of file addressee.src.cpp. |
|
Return address with the given id.
Definition at line 661 of file addressee.src.cpp. |
|
Insert category. If the category already exists it is not duplicated. Definition at line 672 of file addressee.src.cpp. |
|
Remove category.
Definition at line 682 of file addressee.src.cpp. |
|
Return, if addressee has the given category.
Definition at line 692 of file addressee.src.cpp. |
|
Set categories to given value.
Definition at line 697 of file addressee.src.cpp. |
|
Return list of all set categories.
Definition at line 705 of file addressee.src.cpp. |
|
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. Definition at line 710 of file addressee.src.cpp. References QString::isEmpty(), and QString::isNull(). |
|
Remove custom entry.
Definition at line 731 of file addressee.src.cpp. |
|
Return value of custom entry, identified by app and entry name.
Definition at line 746 of file addressee.src.cpp. References QString::mid(). |
|
Set all custom entries.
Definition at line 762 of file addressee.src.cpp. |
|
Return list of all custom entries.
Definition at line 770 of file addressee.src.cpp. |
|
Parse full email address. The result is given back in fullName and email. Definition at line 775 of file addressee.src.cpp. References QString::find(), QString::left(), QString::length(), and QString::mid(). |
|
Debug output.
Definition at line 554 of file addressee.src.cpp. References addresses(), emails(), keys(), phoneNumbers(), and uid(). |
|
Returns string representation of the addressee.
Definition at line 549 of file addressee.src.cpp. |
|
Set resource where the addressee is from.
Definition at line 835 of file addressee.src.cpp. Referenced by KABC::AddressBook::insertAddressee(), KABC::VCardFormatPlugin::loadAll(), and KABC::BinaryFormat::loadAll(). |
|
Return pointer to resource.
Definition at line 841 of file addressee.src.cpp. Referenced by KABC::AddressBook::insertAddressee(), and KABC::AddressBook::removeAddressee(). |
|
Mark addressee as changed.
Definition at line 846 of file addressee.src.cpp. Referenced by KABC::AddressBook::insertAddressee(), KABC::VCardFormatPlugin::loadAll(), and KABC::BinaryFormat::loadAll(). |
|
Return whether the addressee is changed.
Definition at line 852 of file addressee.src.cpp. |
The documentation for this class was generated from the following files: