• Skip to content
  • Skip to link menu
KDE 4.1 API Reference
  • KDE API Reference
  • KDE-PIM Libraries
  • Sitemap
  • Contact Us
 

kabc

KABC::Addressee

KABC::Addressee Class Reference

#include <addressee.h>

List of all members.


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 72 of file addressee.h.


Public Types

typedef AddresseeList List
typedef QMap< QString, Addressee > Map

Public Member Functions

QString additionalName () const
Address address (Address::Type type) const
 Addressee (const Addressee &)
 Addressee ()
Address::List addresses (Address::Type type) const
Address::List addresses () const
QString assembledName () const
QDateTime birthday () const
QStringList categories () const
bool changed () const
QString custom (const QString &app, const QString &name) const
QStringList customs () const
QString department () const
QStringList emails () const
QString familyName () const
Address findAddress (const QString &id) const
Key findKey (const QString &id) const
PhoneNumber findPhoneNumber (const QString &id) const
QString formattedName () const
QString fullEmail (const QString &email=QString()) const
Geo geo () const
QString givenName () const
bool hasCategory (const QString &) const
void insertAddress (const Address &address)
void insertCategory (const QString &)
void insertCustom (const QString &app, const QString &name, const QString &value)
void insertEmail (const QString &email, bool preferred=false)
void insertKey (const Key &key)
void insertPhoneNumber (const PhoneNumber &phoneNumber)
bool isEmpty () const
Key key (Key::Type type, QString customTypeString=QString()) const
Key::List keys (Key::Type type, QString customTypeString=QString()) const
Key::List keys () const
Picture logo () const
QString mailer () const
QString name () const
QString nickName () const
QString note () const
bool operator!= (const Addressee &) const
bool operator< (const Addressee &addr) const
Addressee & operator= (const Addressee &)
bool operator== (const Addressee &) const
QString organization () const
PhoneNumber phoneNumber (PhoneNumber::Type type) const
PhoneNumber::List phoneNumbers (PhoneNumber::Type type) const
PhoneNumber::List phoneNumbers () const
Picture photo () const
QString preferredEmail () const
QString prefix () const
QString productId () const
QString realName () const
void removeAddress (const Address &address)
void removeCategory (const QString &)
void removeCustom (const QString &app, const QString &name)
void removeEmail (const QString &email)
void removeKey (const Key &key)
void removePhoneNumber (const PhoneNumber &phoneNumber)
Resource * resource () const
QDateTime revision () const
QString role () const
Secrecy secrecy () const
void setAdditionalName (const QString &additionalName)
void setBirthday (const QDateTime &birthday)
void setCategories (const QStringList &)
void setChanged (bool value)
void setCustoms (const QStringList &)
void setDepartment (const QString &department)
void setEmails (const QStringList &list)
void setFamilyName (const QString &familyName)
void setFormattedName (const QString &formattedName)
void setGeo (const Geo &geo)
void setGivenName (const QString &givenName)
void setKeys (const Key::List &keys)
void setLogo (const Picture &logo)
void setMailer (const QString &mailer)
void setName (const QString &name)
void setNameFromString (const QString &)
void setNickName (const QString &nickName)
void setNote (const QString &note)
void setOrganization (const QString &organization)
void setPhoto (const Picture &photo)
void setPrefix (const QString &prefix)
void setProductId (const QString &productId)
void setResource (Resource *resource)
void setRevision (const QDateTime &revision)
void setRole (const QString &role)
void setSecrecy (const Secrecy &secrecy)
void setSortString (const QString &sortString)
void setSound (const Sound &sound)
void setSuffix (const QString &suffix)
void setTimeZone (const TimeZone &timeZone)
void setTitle (const QString &title)
void setUid (const QString &uid)
void setUrl (const KUrl &url)
QString sortString () const
Sound sound () const
QString suffix () const
TimeZone timeZone () const
QString title () const
QString toString () const
QString uid () const
KUrl url () const
 ~Addressee ()

Static Public Member Functions

static QString additionalNameLabel ()
static QString birthdayLabel ()
static QString businessAddressCountryLabel ()
static QString businessAddressLabelLabel ()
static QString businessAddressLocalityLabel ()
static QString businessAddressPostalCodeLabel ()
static QString businessAddressRegionLabel ()
static QString businessAddressStreetLabel ()
static QString businessFaxLabel ()
static QString businessPhoneLabel ()
static QString carPhoneLabel ()
static QString departmentLabel ()
static QString emailLabel ()
static QString familyNameLabel ()
static QString formattedNameLabel ()
static QString geoLabel ()
static QString givenNameLabel ()
static QString homeAddressCountryLabel ()
static QString homeAddressLabelLabel ()
static QString homeAddressLocalityLabel ()
static QString homeAddressPostalCodeLabel ()
static QString homeAddressRegionLabel ()
static QString homeAddressStreetLabel ()
static QString homeFaxLabel ()
static QString homePhoneLabel ()
static QString isdnLabel ()
static QString logoLabel ()
static QString mailerLabel ()
static QString mobilePhoneLabel ()
static QString nameLabel ()
static QString nickNameLabel ()
static QString noteLabel ()
static QString organizationLabel ()
static QString pagerLabel ()
static void parseEmailAddress (const QString &rawEmail, QString &fullName, QString &email)
static QString photoLabel ()
static QString prefixLabel ()
static QString productIdLabel ()
static QString revisionLabel ()
static QString roleLabel ()
static QString secrecyLabel ()
static void setSortMode (KABC::SortMode *mode)
static QString sortStringLabel ()
static QString soundLabel ()
static QString suffixLabel ()
static QString timeZoneLabel ()
static QString titleLabel ()
static QString uidLabel ()
static QString urlLabel ()

Friends

QDataStream & operator<< (QDataStream &, const Addressee &)
QDataStream & operator>> (QDataStream &, Addressee &)

Member Typedef Documentation

typedef AddresseeList KABC::Addressee::List

A list of addressee objects.

Definition at line 81 of file addressee.h.

typedef QMap<QString, Addressee> KABC::Addressee::Map

A map from unique identifier to addressee.

See also:
uid()

Definition at line 87 of file addressee.h.


Constructor & Destructor Documentation

Addressee::Addressee (  ) 

Construct an empty address book entry.

Definition at line 147 of file addressee.cpp.

Addressee::~Addressee (  ) 

Destroys the address book entry.

Definition at line 152 of file addressee.cpp.

Addressee::Addressee ( const Addressee &  other  ) 

Copy constructor.

Definition at line 156 of file addressee.cpp.


Member Function Documentation

QString Addressee::additionalName (  )  const

Return additional names.

Definition at line 422 of file addressee.cpp.

QString Addressee::additionalNameLabel (  )  [static]

Return translated label for additionalName field.

Definition at line 427 of file addressee.cpp.

Address Addressee::address ( Address::Type  type  )  const

Return address, which matches the given type.

Parameters:
type The type of address to look for

Definition at line 1423 of file addressee.cpp.

Address::List Addressee::addresses ( Address::Type  type  )  const

Return list of addresses with a special type.

Parameters:
type The type of addresses to look for

Definition at line 1444 of file addressee.cpp.

Address::List Addressee::addresses (  )  const

Return list of all addresses.

Definition at line 1439 of file addressee.cpp.

QString Addressee::assembledName (  )  const

Return the name that consists of all name parts.

Definition at line 1086 of file addressee.cpp.

QDateTime Addressee::birthday (  )  const

Return birthday.

Definition at line 494 of file addressee.cpp.

QString Addressee::birthdayLabel (  )  [static]

Return translated label for birthday field.

Definition at line 499 of file addressee.cpp.

QString Addressee::businessAddressCountryLabel (  )  [static]

Return translated label for businessAddressCountry field.

Definition at line 565 of file addressee.cpp.

QString Addressee::businessAddressLabelLabel (  )  [static]

Return translated label for businessAddressLabel field.

Definition at line 571 of file addressee.cpp.

QString Addressee::businessAddressLocalityLabel (  )  [static]

Return translated label for businessAddressLocality field.

Definition at line 547 of file addressee.cpp.

QString Addressee::businessAddressPostalCodeLabel (  )  [static]

Return translated label for businessAddressPostalCode field.

Definition at line 559 of file addressee.cpp.

QString Addressee::businessAddressRegionLabel (  )  [static]

Return translated label for businessAddressRegion field.

Definition at line 553 of file addressee.cpp.

QString Addressee::businessAddressStreetLabel (  )  [static]

Return translated label for businessAddressStreet field.

Definition at line 541 of file addressee.cpp.

QString Addressee::businessFaxLabel (  )  [static]

Return translated label for businessFax field.

Definition at line 601 of file addressee.cpp.

QString Addressee::businessPhoneLabel (  )  [static]

Return translated label for businessPhone field.

Definition at line 583 of file addressee.cpp.

QString Addressee::carPhoneLabel (  )  [static]

Return translated label for carPhone field.

Definition at line 607 of file addressee.cpp.

QStringList Addressee::categories (  )  const

Return list of all set categories.

Definition at line 1498 of file addressee.cpp.

bool Addressee::changed (  )  const

Return whether the addressee is changed.

Definition at line 1735 of file addressee.cpp.

QString Addressee::custom ( const QString &  app,
const QString &  name 
) const

Return value of custom entry, identified by app and entry name.

Parameters:
app Name of the application which has inserted this custom entry
name Name of this application specific custom entry

Definition at line 1536 of file addressee.cpp.

QStringList Addressee::customs (  )  const

Return list of all custom entries.

Definition at line 1558 of file addressee.cpp.

QString Addressee::department (  )  const

Return department.

Definition at line 746 of file addressee.cpp.

QString Addressee::departmentLabel (  )  [static]

Return translated label for department field.

Definition at line 751 of file addressee.cpp.

QString Addressee::emailLabel (  )  [static]

Return translated label for email field.

Definition at line 625 of file addressee.cpp.

QStringList Addressee::emails (  )  const

Return list of all email addresses.

Definition at line 1155 of file addressee.cpp.

QString Addressee::familyName (  )  const

Return family name.

Definition at line 386 of file addressee.cpp.

QString Addressee::familyNameLabel (  )  [static]

Return translated label for familyName field.

Definition at line 391 of file addressee.cpp.

Address Addressee::findAddress ( const QString &  id  )  const

Return address with the given id.

Parameters:
id The identifier of the address to look for. See Address::id()

Definition at line 1458 of file addressee.cpp.

Key Addressee::findKey ( const QString &  id  )  const

Return key with the given id.

Parameters:
id The identifier of the key to look for. See Key::id()

Definition at line 1312 of file addressee.cpp.

PhoneNumber Addressee::findPhoneNumber ( const QString &  id  )  const

Return phone number with the given id.

Parameters:
id The identifier of the phone number to look for. See PhoneNumber::id()

Definition at line 1224 of file addressee.cpp.

QString Addressee::formattedName (  )  const

Return formatted name.

Definition at line 368 of file addressee.cpp.

QString Addressee::formattedNameLabel (  )  [static]

Return translated label for formattedName field.

Definition at line 373 of file addressee.cpp.

QString Addressee::fullEmail ( const QString &  email = QString()  )  const

Return email address including real name.

Parameters:
email Email address to be used to construct the full email string. If this is QString() the preferred email address is used.

Definition at line 1094 of file addressee.cpp.

Geo Addressee::geo (  )  const

Return geographic position.

Definition at line 674 of file addressee.cpp.

QString Addressee::geoLabel (  )  [static]

Return translated label for geo field.

Definition at line 679 of file addressee.cpp.

QString Addressee::givenName (  )  const

Return given name.

Definition at line 404 of file addressee.cpp.

QString Addressee::givenNameLabel (  )  [static]

Return translated label for givenName field.

Definition at line 409 of file addressee.cpp.

bool Addressee::hasCategory ( const QString &  category  )  const

Return, if addressee has the given category.

Definition at line 1486 of file addressee.cpp.

QString Addressee::homeAddressCountryLabel (  )  [static]

Return translated label for homeAddressCountry field.

Definition at line 529 of file addressee.cpp.

QString Addressee::homeAddressLabelLabel (  )  [static]

Return translated label for homeAddressLabel field.

Definition at line 535 of file addressee.cpp.

QString Addressee::homeAddressLocalityLabel (  )  [static]

Return translated label for homeAddressLocality field.

Definition at line 511 of file addressee.cpp.

QString Addressee::homeAddressPostalCodeLabel (  )  [static]

Return translated label for homeAddressPostalCode field.

Definition at line 523 of file addressee.cpp.

QString Addressee::homeAddressRegionLabel (  )  [static]

Return translated label for homeAddressRegion field.

Definition at line 517 of file addressee.cpp.

QString Addressee::homeAddressStreetLabel (  )  [static]

Return translated label for homeAddressStreet field.

Definition at line 505 of file addressee.cpp.

QString Addressee::homeFaxLabel (  )  [static]

Return translated label for homeFax field.

Definition at line 595 of file addressee.cpp.

QString Addressee::homePhoneLabel (  )  [static]

Return translated label for homePhone field.

Definition at line 577 of file addressee.cpp.

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.

Parameters:
address The address to insert

Definition at line 1394 of file addressee.cpp.

void Addressee::insertCategory ( const QString &  c  ) 

Insert category.

If the category already exists it is not duplicated.

Definition at line 1469 of file addressee.cpp.

void 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)

Parameters:
app Name of the application inserting this custom entry
name Name of this application specific custom entry
value Value of this application specific custom entry

Definition at line 1503 of file addressee.cpp.

void 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.

Definition at line 1120 of file addressee.cpp.

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.

Parameters:
key The key to insert

Definition at line 1235 of file addressee.cpp.

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.

Parameters:
phoneNumber The telephone number to insert to the addressee

Definition at line 1164 of file addressee.cpp.

QString Addressee::isdnLabel (  )  [static]

Return translated label for isdn field.

Definition at line 613 of file addressee.cpp.

bool Addressee::isEmpty (  )  const

Return, if the address book entry is empty.

Definition at line 321 of file addressee.cpp.

Key Addressee::key ( Key::Type  type,
QString  customTypeString = QString() 
) 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.

Parameters:
type The type of key to look for
customTypeString A string to match custom keys against when type is Key::Custom

Definition at line 1260 of file addressee.cpp.

Key::List Addressee::keys ( Key::Type  type,
QString  customTypeString = QString() 
) 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.

Parameters:
type The type of key to look for
customTypeString A string to match custom keys against when type is Key::Custom

Definition at line 1290 of file addressee.cpp.

Key::List Addressee::keys (  )  const

Return list of all keys.

Definition at line 1285 of file addressee.cpp.

Picture Addressee::logo (  )  const

Return logo.

Definition at line 872 of file addressee.cpp.

QString Addressee::logoLabel (  )  [static]

Return translated label for logo field.

Definition at line 877 of file addressee.cpp.

QString Addressee::mailer (  )  const

Return mail client.

Definition at line 638 of file addressee.cpp.