#include <addressee.src.h>
Public Types | |
typedef TQValueList< Addressee > | List |
typedef TQMap< TQString, 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 TQString &uid) |
TQString | uid () const |
void | setUri (const TQString &uid) |
TQString | uri () const |
DECLARATIONS void | setNameFromString (const TQString &) |
TQString | realName () const |
TQString | assembledName () const |
TQString | fullEmail (const TQString &email=TQString::null) const |
void | insertEmail (const TQString &email, bool preferred=false) |
void | removeEmail (const TQString &email) |
TQString | preferredEmail () const |
TQStringList | emails () const |
void | setEmails (const TQStringList &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 TQString &id) const |
void | insertKey (const Key &key) |
void | removeKey (const Key &key) |
Key | key (int type, TQString customTypeString=TQString::null) const |
Key::List | keys () const |
void | setKeys (const Key::List &keys) |
Key::List | keys (int type, TQString customTypeString=TQString::null) const |
Key | findKey (const TQString &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 TQString &id) const |
void | insertCategory (const TQString &) |
void | removeCategory (const TQString &) |
bool | hasCategory (const TQString &) const |
void | setCategories (const TQStringList &) |
TQStringList | categories () const |
void | insertCustom (const TQString &app, const TQString &name, const TQString &value) |
void | removeCustom (const TQString &app, const TQString &name) |
TQString | custom (const TQString &app, const TQString &name) const |
void | setCustoms (const TQStringList &) |
TQStringList | customs () const |
void | dump () const |
TQString | 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 TQString | uidLabel () |
static TQString | uriLabel () |
static void | parseEmailAddress (const TQString &rawEmail, TQString &fullName, TQString &email) |
static void | setSortMode (TDEABC::SortMode *mode) |
Friends | |
KABC_EXPORT TQDataStream & | operator<< (TQDataStream &, const Addressee &) |
KABC_EXPORT TQDataStream & | operator>> (TQDataStream &, 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 74 of file addressee.src.h.
Constructor & Destructor Documentation
◆ Addressee()
Addressee::Addressee | ( | ) |
Construct an empty address book entry.
Definition at line 78 of file addressee.src.cpp.
Member Function Documentation
◆ address()
Address Addressee::address | ( | int | type | ) | const |
Return address, which matches the given type.
Definition at line 707 of file addressee.src.cpp.
◆ addresses() [1/2]
Address::List Addressee::addresses | ( | ) | const |
Return list of all addresses.
Definition at line 723 of file addressee.src.cpp.
◆ addresses() [2/2]
Address::List Addressee::addresses | ( | int | type | ) | const |
Return list of addresses with a special type.
Definition at line 728 of file addressee.src.cpp.
◆ assembledName()
TQString Addressee::assembledName | ( | ) | const |
Return the name that consists of all name parts.
Definition at line 378 of file addressee.src.cpp.
◆ asString()
TQString Addressee::asString | ( | ) | const |
Returns string representation of the addressee.
Definition at line 626 of file addressee.src.cpp.
◆ categories()
TQStringList Addressee::categories | ( | ) | const |
Return list of all set categories.
Definition at line 786 of file addressee.src.cpp.
◆ changed()
bool Addressee::changed | ( | ) | const |
Return whether the addressee is changed.
Definition at line 1030 of file addressee.src.cpp.
◆ custom()
TQString Addressee::custom | ( | const TQString & | app, |
const TQString & | name | ||
) | const |
Return value of custom entry, identified by app and entry name.
Definition at line 827 of file addressee.src.cpp.
◆ customs()
TQStringList Addressee::customs | ( | ) | const |
Return list of all custom entries.
Definition at line 851 of file addressee.src.cpp.
◆ dump()
void Addressee::dump | ( | ) | const |
Debug output.
Definition at line 631 of file addressee.src.cpp.
◆ emails()
TQStringList Addressee::emails | ( | ) | const |
Return list of all email addresses.
Definition at line 451 of file addressee.src.cpp.
◆ findAddress()
Address Addressee::findAddress | ( | const TQString & | id | ) | const |
Return address with the given id.
Definition at line 742 of file addressee.src.cpp.
◆ findKey()
Key Addressee::findKey | ( | const TQString & | id | ) | const |
Return key with the given id.
Definition at line 615 of file addressee.src.cpp.
◆ findPhoneNumber()
PhoneNumber Addressee::findPhoneNumber | ( | const TQString & | id | ) | const |
Return phone number with the given id.
Definition at line 523 of file addressee.src.cpp.
◆ fullEmail()
TQString Addressee::fullEmail | ( | const TQString & | email = TQString::null | ) | const |
Return email address including real name.
- Parameters
-
email Email address to be used to construct the full email string. If this is TQString::null the preferred email address is used.
Definition at line 386 of file addressee.src.cpp.
◆ hasCategory()
bool Addressee::hasCategory | ( | const TQString & | c | ) | const |
Return, if addressee has the given category.
Definition at line 773 of file addressee.src.cpp.
◆ insertAddress()
void Addressee::insertAddress | ( | const Address & | address | ) |
Insert an address.
If an address with the same id already exists in this addressee it is not duplicated.
Definition at line 675 of file addressee.src.cpp.
◆ insertCategory()
void Addressee::insertCategory | ( | const TQString & | c | ) |
Insert category.
If the category already exists it is not duplicated.
Definition at line 753 of file addressee.src.cpp.
◆ insertCustom()
void Addressee::insertCustom | ( | const TQString & | app, |
const TQString & | name, | ||
const TQString & | 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)
Definition at line 791 of file addressee.src.cpp.
◆ insertEmail()
void Addressee::insertEmail | ( | const TQString & | 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.
Definition at line 412 of file addressee.src.cpp.
◆ insertKey()
void Addressee::insertKey | ( | const Key & | key | ) |
Insert a key.
If a key with the same id already exists in this addressee it is not duplicated.
Definition at line 534 of file addressee.src.cpp.
◆ insertPhoneNumber()
void 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.
Definition at line 460 of file addressee.src.cpp.
◆ isEmpty()
bool Addressee::isEmpty | ( | ) | const |
Return, if the address book entry is empty.
Definition at line 161 of file addressee.src.cpp.
◆ key()
Key Addressee::key | ( | int | type, |
TQString | customTypeString = TQString::null |
||
) | const |
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.
Definition at line 562 of file addressee.src.cpp.
◆ keys() [1/2]
Key::List Addressee::keys | ( | ) | const |
Return list of all keys.
Definition at line 588 of file addressee.src.cpp.
◆ keys() [2/2]
Key::List Addressee::keys | ( | int | type, |
TQString | customTypeString = TQString::null |
||
) | const |
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.
Definition at line 593 of file addressee.src.cpp.
◆ parseEmailAddress()
|
static |
Parse full email address.
The result is given back in fullName and email.
Definition at line 856 of file addressee.src.cpp.
◆ phoneNumber()
PhoneNumber Addressee::phoneNumber | ( | int | type | ) | const |
Return phone number, which matches the given type.
Definition at line 489 of file addressee.src.cpp.
◆ phoneNumbers() [1/2]
PhoneNumber::List Addressee::phoneNumbers | ( | ) | const |
Return list of all phone numbers.
Definition at line 505 of file addressee.src.cpp.
◆ phoneNumbers() [2/2]
PhoneNumber::List Addressee::phoneNumbers | ( | int | type | ) | const |
Return list of phone numbers with a special type.
Definition at line 510 of file addressee.src.cpp.
◆ preferredEmail()
TQString 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.
Definition at line 445 of file addressee.src.cpp.
◆ realName()
TQString Addressee::realName | ( | ) | const |
Return the name of the addressee.
This is calculated from all the name fields.
Definition at line 361 of file addressee.src.cpp.
◆ removeAddress()
void Addressee::removeAddress | ( | const Address & | address | ) |
Remove address.
If no address with the given id exists for this addresse nothing happens.
Definition at line 694 of file addressee.src.cpp.
◆ removeCategory()
void Addressee::removeCategory | ( | const TQString & | c | ) |
Remove category.
Definition at line 763 of file addressee.src.cpp.
◆ removeCustom()
void Addressee::removeCustom | ( | const TQString & | app, |
const TQString & | name | ||
) |
Remove custom entry.
Definition at line 812 of file addressee.src.cpp.
◆ removeEmail()
void Addressee::removeEmail | ( | const TQString & | ) |
Remove email address.
If the email address doesn't exist, nothing happens.
Definition at line 435 of file addressee.src.cpp.
◆ removeKey()
void Addressee::removeKey | ( | const Key & | key | ) |
Remove a key.
If no key with the given id exists for this addresse nothing happens.
Definition at line 549 of file addressee.src.cpp.
◆ removePhoneNumber()
void Addressee::removePhoneNumber | ( | const PhoneNumber & | phoneNumber | ) |
Remove phone number.
If no phone number with the given id exists for this addresse nothing happens.
Definition at line 476 of file addressee.src.cpp.
◆ resource()
Resource * Addressee::resource | ( | ) | const |
Return pointer to resource.
Definition at line 1019 of file addressee.src.cpp.
◆ setCategories()
void Addressee::setCategories | ( | const TQStringList & | c | ) |
Set categories to given value.
Definition at line 778 of file addressee.src.cpp.
◆ setChanged()
void Addressee::setChanged | ( | bool | value | ) |
Mark addressee as changed.
Definition at line 1024 of file addressee.src.cpp.
◆ setCustoms()
void Addressee::setCustoms | ( | const TQStringList & | l | ) |
Set all custom entries.
Definition at line 843 of file addressee.src.cpp.
◆ setEmails()
void Addressee::setEmails | ( | const TQStringList & | list | ) |
Set the emails to list
.
The first email address gets the preferred one!
- Parameters
-
list The list of email addresses.
Definition at line 455 of file addressee.src.cpp.
◆ setKeys()
void Addressee::setKeys | ( | const Key::List & | keys | ) |
Set the list of keys.
- Parameters
-
keys The keys to be set.
Definition at line 582 of file addressee.src.cpp.
◆ setNameFromString()
DEFINITIONS void Addressee::setNameFromString | ( | const TQString & | s | ) |
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 204 of file addressee.src.cpp.
◆ setResource()
void Addressee::setResource | ( | Resource * | resource | ) |
Set resource where the addressee is from.
Definition at line 1013 of file addressee.src.cpp.
◆ setUid()
void Addressee::setUid | ( | const TQString & | uid | ) |
Set unique identifier.
Definition at line 166 of file addressee.src.cpp.
◆ setUri()
void Addressee::setUri | ( | const TQString & | uid | ) |
Set unique resource identifier.
Definition at line 184 of file addressee.src.cpp.
◆ uid()
TQString Addressee::uid | ( | ) | const |
Return unique identifier.
Definition at line 174 of file addressee.src.cpp.
◆ uidLabel()
|
static |
Return translated label for uid field.
Definition at line 179 of file addressee.src.cpp.
◆ uri()
TQString Addressee::uri | ( | ) | const |
Return unique resource identifier.
Definition at line 192 of file addressee.src.cpp.
◆ uriLabel()
|
static |
Return translated label for uri field.
Definition at line 197 of file addressee.src.cpp.
The documentation for this class was generated from the following files: