Qtopia library API Documentation

Contact Class Reference

The Contact class holds the data of an address book entry. More...

#include <contact.h>

Inheritance diagram for Contact:

Inheritance graph
[legend]
Collaboration diagram for Contact:

Collaboration graph
[legend]
List of all members.

Public Types

enum  journal_action { ACTION_ADD, ACTION_REMOVE, ACTION_REPLACE }

Public Member Functions

 Contact ()
 Contact (const QMap< int, QString > &fromMap)
virtual ~Contact ()
void setTitle (const QString &v)
void setFirstName (const QString &v)
void setMiddleName (const QString &v)
void setLastName (const QString &v)
void setSuffix (const QString &v)
void setFileAs (const QString &v)
void setFileAs ()
void setDefaultEmail (const QString &v)
void insertEmail (const QString &v)
void removeEmail (const QString &v)
void clearEmails ()
void insertEmails (const QStringList &v)
void setHomeStreet (const QString &v)
void setHomeCity (const QString &v)
void setHomeState (const QString &v)
void setHomeZip (const QString &v)
void setHomeCountry (const QString &v)
void setHomePhone (const QString &v)
void setHomeFax (const QString &v)
void setHomeMobile (const QString &v)
void setHomeWebpage (const QString &v)
void setCompany (const QString &v)
void setBusinessStreet (const QString &v)
void setBusinessCity (const QString &v)
void setBusinessState (const QString &v)
void setBusinessZip (const QString &v)
void setBusinessCountry (const QString &v)
void setBusinessWebpage (const QString &v)
void setJobTitle (const QString &v)
void setDepartment (const QString &v)
void setOffice (const QString &v)
void setBusinessPhone (const QString &v)
void setBusinessFax (const QString &v)
void setBusinessMobile (const QString &v)
void setBusinessPager (const QString &v)
void setProfession (const QString &v)
void setAssistant (const QString &v)
void setManager (const QString &v)
void setSpouse (const QString &v)
void setGender (const QString &v)
void setBirthday (const QString &v)
void setAnniversary (const QString &v)
void setNickname (const QString &v)
void setChildren (const QString &v)
void setNotes (const QString &v)
bool match (const QString &regexp) const
QString fullName () const
QString title () const
QString firstName () const
QString middleName () const
QString lastName () const
QString suffix () const
QString fileAs () const
QString defaultEmail () const
QStringList emailList () const
QString homeStreet () const
QString homeCity () const
QString homeState () const
QString homeZip () const
QString homeCountry () const
QString homePhone () const
QString homeFax () const
QString homeMobile () const
QString homeWebpage () const
QString displayHomeAddress () const
 Multi line string containing all non-empty address info in the form Street City, State Zip Country.

QString company () const
QString businessStreet () const
QString businessCity () const
QString businessState () const
QString businessZip () const
QString businessCountry () const
QString businessWebpage () const
QString jobTitle () const
QString department () const
QString office () const
QString businessPhone () const
QString businessFax () const
QString businessMobile () const
QString businessPager () const
QString profession () const
QString assistant () const
QString manager () const
QString displayBusinessAddress () const
 Multi line string containing all non-empty address info in the form Street City, State Zip Country.

QString spouse () const
QString gender () const
QString birthday () const
QString anniversary () const
QString nickname () const
QString children () const
QStringList childrenList () const
QString notes () const
QString groups () const
QStringList groupList () const
QString toRichText () const
QMap< int, QStringtoMap () const
QString field (int key) const
void saveJournal (journal_action action, const QString &key=QString::null)
void save (QString &buf) const
void setUid (int i)

Static Public Member Functions

void writeVCard (const QString &filename, const QValueList< Contact > &contacts)
void writeVCard (const QString &filename, const Contact &c)
QValueList< ContactreadVCard (const QString &filename)
QStringList fields ()
QStringList trfields ()

Friends

class DataSet
class AbEditor
class AbTable
class AddressBookAccessPrivate
class XMLIO

Detailed Description

The Contact class holds the data of an address book entry.

This data includes information the name of the person, contact information, and business information such as deparment and job title.

Definition at line 36 of file contact.h.


Constructor & Destructor Documentation

Contact::Contact  ) 
 

Creates a new, empty contact.

Definition at line 53 of file contact.cpp.

Contact::~Contact  )  [virtual]
 

Destroys a contact.

Definition at line 83 of file contact.cpp.


Member Function Documentation

void Contact::writeVCard const QString filename,
const QValueList< Contact > &  contacts
[static]
 

Writes the list of contacts as a set of VCards to the file filename.

Definition at line 1324 of file contact.cpp.

References QValueList::begin(), QValueList::end(), and QString::utf8().

void Contact::writeVCard const QString filename,
const Contact contact
[static]
 

writes contact as a VCard to the file filename.

Definition at line 1344 of file contact.cpp.

References QString::utf8().

QValueList< Contact > Contact::readVCard const QString filename  )  [static]
 

Returns the set of contacts read as VCards from the file filename.

Definition at line 1362 of file contact.cpp.

References QValueList::append(), and QString::utf8().

void Contact::setTitle const QString str  )  [inline]
 

Sets the title of the contact to str.

Definition at line 50 of file contact.h.

void Contact::setFirstName const QString str  )  [inline]
 

Sets the first name of the contact to str.

Definition at line 51 of file contact.h.

void Contact::setMiddleName const QString str  )  [inline]
 

Sets the middle name of the contact to str.

Definition at line 52 of file contact.h.

void Contact::setLastName const QString str  )  [inline]
 

Sets the last name of the contact to str.

Definition at line 53 of file contact.h.

void Contact::setSuffix const QString str  )  [inline]
 

Sets the suffix of the contact to str.

Definition at line 54 of file contact.h.

void Contact::setFileAs const QString str  )  [inline]
 

Sets the contact to filed as str.

Definition at line 55 of file contact.h.

void Contact::setFileAs  ) 
 

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Generates the string for the contact to be filed as from the first, middle and last name of the contact.

Definition at line 780 of file contact.cpp.

References firstName(), QString::isEmpty(), lastName(), and middleName().

void Contact::setDefaultEmail const QString v  )  [inline]
 

Sets the default email of the contact to str.

Definition at line 288 of file contact.h.

References insertEmail(), and QString::isEmpty().

Referenced by insertEmail(), and removeEmail().

void Contact::insertEmail const QString v  )  [inline]
 

Insert email into the email list. Ensures email can only be added once. If there is no default email address set, it sets it to the email.

Definition at line 234 of file contact.h.

References QString::contains(), defaultEmail(), QString::isEmpty(), and setDefaultEmail().

Referenced by insertEmails(), and setDefaultEmail().

void Contact::removeEmail const QString v  )  [inline]
 

Removes the email from the email list. If the default email was email, then the default email address is assigned to the first email in the email list

Definition at line 256 of file contact.h.

References clearEmails(), QString::contains(), QValueList::count(), defaultEmail(), emailList(), QValueList::first(), QStringList::join(), QValueList::remove(), and setDefaultEmail().

void Contact::clearEmails  )  [inline]
 

Clears the email list.

Definition at line 283 of file contact.h.

References QMap< int, QString >::remove().

Referenced by removeEmail().

void Contact::insertEmails const QStringList v  )  [inline]
 

Appends the emailList to the exiting email list

Definition at line 300 of file contact.h.

References insertEmail().

void Contact::setHomeStreet const QString str  )  [inline]
 

Sets the home street address of the contact to str.

Definition at line 67 of file contact.h.

void Contact::setHomeCity const QString str  )  [inline]
 

Sets the home city of the contact to str.

Definition at line 68 of file contact.h.

void Contact::setHomeState const QString str  )  [inline]
 

Sets the home state of the contact to str.

Definition at line 69 of file contact.h.

void Contact::setHomeZip const QString str  )  [inline]
 

Sets the home zip code of the contact to str.

Definition at line 70 of file contact.h.

void Contact::setHomeCountry const QString str  )  [inline]
 

Sets the home country of the contact to str.

Definition at line 71 of file contact.h.

void Contact::setHomePhone const QString str  )  [inline]
 

Sets the home phone number of the contact to str.

Definition at line 72 of file contact.h.

void Contact::setHomeFax const QString str  )  [inline]
 

Sets the home fax number of the contact to str.

Definition at line 73 of file contact.h.

void Contact::setHomeMobile const QString str  )  [inline]
 

Sets the home mobile phone number of the contact to str.

Definition at line 74 of file contact.h.

void Contact::setHomeWebpage const QString str  )  [inline]
 

Sets the home webpage of the contact to str.

Definition at line 75 of file contact.h.

void Contact::setCompany const QString str  )  [inline]
 

Sets the company for contact to str.

Definition at line 78 of file contact.h.

void Contact::setBusinessStreet const QString str  )  [inline]
 

Sets the business street address of the contact to str.

Definition at line 79 of file contact.h.

void Contact::setBusinessCity const QString str  )  [inline]
 

Sets the business city of the contact to str.

Definition at line 80 of file contact.h.

void Contact::setBusinessState const QString str  )  [inline]
 

Sets the business state of the contact to str.

Definition at line 81 of file contact.h.

void Contact::setBusinessZip const QString str  )  [inline]
 

Sets the business zip code of the contact to str.

Definition at line 82 of file contact.h.

void Contact::setBusinessCountry const QString str  )  [inline]
 

Sets the business country of the contact to str.

Definition at line 83 of file contact.h.

void Contact::setBusinessWebpage const QString str  )  [inline]
 

Sets the business webpage of the contact to str.

Definition at line 84 of file contact.h.

void Contact::setJobTitle const QString str  )  [inline]
 

Sets the job title of the contact to str.

Definition at line 85 of file contact.h.

void Contact::setDepartment const QString str  )  [inline]
 

Sets the department for contact to str.

Definition at line 86 of file contact.h.

void Contact::setOffice const QString str  )  [inline]
 

Sets the office for contact to str.

Definition at line 87 of file contact.h.

void Contact::setBusinessPhone const QString str  )  [inline]
 

Sets the business phone number of the contact to str.

Definition at line 88 of file contact.h.

void Contact::setBusinessFax const QString str  )  [inline]
 

Sets the business fax number of the contact to str.

Definition at line 89 of file contact.h.

void Contact::setBusinessMobile const QString str  )  [inline]
 

Sets the business mobile phone number of the contact to str.

Definition at line 90 of file contact.h.

void Contact::setBusinessPager const QString str  )  [inline]
 

Sets the business pager number of the contact to str.

Definition at line 91 of file contact.h.

void Contact::setProfession const QString str  )  [inline]
 

Sets the profession of the contact to str.

Definition at line 92 of file contact.h.

void Contact::setAssistant const QString str  )  [inline]
 

Sets the assistant of the contact to str.

Definition at line 93 of file contact.h.

void Contact::setManager const QString str  )  [inline]
 

Sets the manager of the contact to str.

Definition at line 94 of file contact.h.

void Contact::setSpouse const QString str  )  [inline]
 

Sets the spouse of the contact to str.

Definition at line 97 of file contact.h.

void Contact::setGender const QString str  )  [inline]
 

Sets the gender of the contact to str.

Definition at line 98 of file contact.h.

void Contact::setBirthday const QString str  )  [inline]
 

Sets the birthday for the contact to str.

Definition at line 99 of file contact.h.

void Contact::setAnniversary const QString str  )  [inline]
 

Sets the anniversary of the contact to str.

Definition at line 100 of file contact.h.

void Contact::setNickname const QString str  )  [inline]
 

Sets the nickname of the contact to str.

Definition at line 101 of file contact.h.

void Contact::setChildren const QString str  ) 
 

Sets the list of children for the contact to those contained in str.

Definition at line 967 of file contact.cpp.

void Contact::setNotes const QString str  )  [inline]
 

Sets the notes about the contact to str.

Definition at line 105 of file contact.h.

bool Contact::match const QString regexp  )  const
 

Returns TRUE if the contact matches the regular expression regexp. Otherwise returns FALSE.

Definition at line 1386 of file contact.cpp.

QString Contact::fullName  )  const
 

Returns the full name of the contact

Definition at line 692 of file contact.cpp.

References firstName(), QString::isEmpty(), lastName(), middleName(), QString::simplifyWhiteSpace(), suffix(), and title().

Referenced by toRichText().

QString Contact::title  )  const [inline]
 

Returns the title of the contact.

Definition at line 120 of file contact.h.

Referenced by fullName().

QString Contact::firstName  )  const [inline]
 

Returns the first name of the contact.

Definition at line 121 of file contact.h.

Referenced by fullName(), and setFileAs().

QString Contact::middleName  )  const [inline]
 

Returns the middle name of the contact.

Definition at line 122 of file contact.h.

Referenced by fullName(), and setFileAs().

QString Contact::lastName  )  const [inline]
 

Returns the last name of the contact.

Definition at line 123 of file contact.h.

Referenced by fullName(), and setFileAs().

QString Contact::suffix  )  const [inline]
 

Returns the suffix of the contact.

Definition at line 124 of file contact.h.

Referenced by fullName().

QString Contact::fileAs  )  const [inline]
 

Returns the string the contact is filed as.

Definition at line 125 of file contact.h.

QString Contact::defaultEmail  )  const [inline]
 

Returns the default email address of the contact.

Definition at line 128 of file contact.h.

Referenced by insertEmail(), and removeEmail().

QStringList Contact::emailList  )  const
 

Returns a list of email addresses belonging to the contact, including the default email address.

Definition at line 759 of file contact.cpp.

References QString::isEmpty(), and QStringList::split().

Referenced by removeEmail().

QString Contact::homeStreet  )  const [inline]
 

Returns the home street address of the contact.

Definition at line 132 of file contact.h.

Referenced by displayHomeAddress(), and toRichText().

QString Contact::homeCity  )  const [inline]
 

Returns the home city of the contact.

Definition at line 133 of file contact.h.

Referenced by displayHomeAddress(), and toRichText().

QString Contact::homeState  )  const [inline]
 

Returns the home state of the contact.

Definition at line 134 of file contact.h.

Referenced by displayHomeAddress(), and toRichText().

QString Contact::homeZip  )  const [inline]
 

Returns the home zip of the contact.

Definition at line 135 of file contact.h.

Referenced by displayHomeAddress(), and toRichText().

QString Contact::homeCountry  )  const [inline]
 

Returns the home country of the contact.

Definition at line 136 of file contact.h.

Referenced by displayHomeAddress(), and toRichText().

QString Contact::homePhone  )  const [inline]
 

Returns the home phone number of the contact.

Definition at line 137 of file contact.h.

Referenced by toRichText().

QString Contact::homeFax  )  const [inline]
 

Returns the home fax number of the contact.

Definition at line 138 of file contact.h.

Referenced by toRichText().

QString Contact::homeMobile  )  const [inline]
 

Returns the home mobile number of the contact.

Definition at line 139 of file contact.h.

Referenced by toRichText().

QString Contact::homeWebpage  )  const [inline]
 

Returns the home webpage of the contact.

Definition at line 140 of file contact.h.

Referenced by toRichText().

QString Contact::displayHomeAddress  )  const
 

Multi line string containing all non-empty address info in the form Street City, State Zip Country.

Definition at line 682 of file contact.cpp.

References homeCity(), homeCountry(), homeState(), homeStreet(), and homeZip().

QString Contact::company  )  const [inline]
 

Returns the company for the contact.

Definition at line 149 of file contact.h.

Referenced by toRichText().

QString Contact::businessStreet  )  const [inline]
 

Returns the business street address of the contact.

Definition at line 150 of file contact.h.

Referenced by displayBusinessAddress(), and toRichText().

QString Contact::businessCity  )  const [inline]
 

Returns the business city of the contact.

Definition at line 151 of file contact.h.

Referenced by displayBusinessAddress(), and toRichText().

QString Contact::businessState  )  const [inline]
 

Returns the business state of the contact.

Definition at line 152 of file contact.h.

Referenced by displayBusinessAddress(), and toRichText().

QString Contact::businessZip  )  const [inline]
 

Returns the business zip of the contact.

Definition at line 153 of file contact.h.

Referenced by displayBusinessAddress(), and toRichText().

QString Contact::businessCountry  )  const [inline]
 

Returns the business country of the contact.

Definition at line 154 of file contact.h.

Referenced by displayBusinessAddress(), and toRichText().

QString Contact::businessWebpage  )  const [inline]
 

Returns the business webpage of the contact.

Definition at line 155 of file contact.h.

Referenced by toRichText().

QString Contact::jobTitle  )  const [inline]
 

Returns the job title of the contact.

Definition at line 156 of file contact.h.

Referenced by toRichText().

QString Contact::department  )  const [inline]
 

Returns the department for the contact.

Definition at line 157 of file contact.h.

Referenced by toRichText().

QString Contact::office  )  const [inline]
 

Returns the office for the contact.

Definition at line 158 of file contact.h.

Referenced by toRichText().

QString Contact::businessPhone  )  const [inline]
 

Returns the business phone number of the contact.

Definition at line 159 of file contact.h.

Referenced by toRichText().

QString Contact::businessFax  )  const [inline]
 

Returns the business fax number of the contact.

Definition at line 160 of file contact.h.

Referenced by toRichText().

QString Contact::businessMobile  )  const [inline]
 

Returns the business mobile number of the contact.

Definition at line 161 of file contact.h.

Referenced by toRichText().

QString Contact::businessPager  )  const [inline]
 

Returns the business pager number of the contact.

Definition at line 162 of file contact.h.

Referenced by toRichText().

QString Contact::profession  )  const [inline]
 

Returns the profession of the contact.

Definition at line 163 of file contact.h.

Referenced by toRichText().

QString Contact::assistant  )  const [inline]
 

Returns the assistant of the contact.

Definition at line 164 of file contact.h.

Referenced by toRichText().

QString Contact::manager  )  const [inline]
 

Returns the manager of the contact.

Definition at line 165 of file contact.h.

Referenced by toRichText().

QString Contact::displayBusinessAddress  )  const
 

Multi line string containing all non-empty address info in the form Street City, State Zip Country.

Definition at line 672 of file contact.cpp.

References businessCity(), businessCountry(), businessState(), businessStreet(), and businessZip().

QString Contact::spouse  )  const [inline]
 

Returns the spouse of the contact.

Definition at line 174 of file contact.h.

Referenced by toRichText().

QString Contact::gender  )  const [inline]
 

Returns the gender of the contact.

Definition at line 175 of file contact.h.

Referenced by toRichText().

QString Contact::birthday  )  const [inline]
 

Returns the birthday of the contact.

Definition at line 176 of file contact.h.

Referenced by toRichText().

QString Contact::anniversary  )  const [inline]
 

Returns the anniversary of the contact.

Definition at line 177 of file contact.h.

Referenced by toRichText().

QString Contact::nickname  )  const [inline]
 

Returns the nickname of the contact.

Definition at line 178 of file contact.h.

Referenced by toRichText().

QString Contact::children  )  const [inline]
 

Returns the children of the contact.

Definition at line 179 of file contact.h.

QStringList Contact::childrenList  )  const
 

Returns a list of the names of the children of the contact.

Definition at line 727 of file contact.cpp.

References QStringList::split().

QString Contact::notes  )  const [inline]
 

Returns the notes relating to the the contact.

Definition at line 183 of file contact.h.

Referenced by toRichText().

QString Contact::toRichText  )  const
 

Returns a rich text formatted QString representing the contents the contact.

Definition at line 449 of file contact.cpp.

References anniversary(), assistant(), birthday(), businessCity(), businessCountry(), businessFax(), businessMobile(), businessPager(), businessPhone(), businessState(), businessStreet(), businessWebpage(), businessZip(), company(), QStyleSheet::convertFromPlainText(), department(), fullName(), gender(), homeCity(), homeCountry(), homeFax(), homeMobile(), homePhone(), homeState(), homeStreet(), homeWebpage(), homeZip(), QString::isEmpty(), jobTitle(), manager(), nickname(), notes(), office(), profession(), spouse(), QString::toInt(), and QObject::tr().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for OPIE Version 1.5.5.
Documentation copyright © 1997-2003 the KDE developers. 2003 OPIE developers
Generated on Tue Feb 10 20:24:15 2004 by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2001