libopie PIM API Documentation

OContact Class Reference

OContact class represents a specialised PIM Record for contacts. Contact Container. More...

#include <ocontact.h>

Inheritance diagram for OContact:

Inheritance graph
[legend]
Collaboration diagram for OContact:

Collaboration graph
[legend]
List of all members.

Public Types

enum  DateFormat { Zip_City_State = 0, City_State_Zip }

Public Member Functions

 OContact ()
 OContact (const QMap< int, QString > &fromMap)
virtual ~OContact ()
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 QDate &v)
void setAnniversary (const QDate &v)
void setNickname (const QString &v)
void setChildren (const QString &v)
void setNotes (const QString &v)
virtual bool match (const QRegExp &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
QDate birthday () const
QDate 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
 converts the internal structure to a map

QString field (int key) const
void setUid (int i)
 set the uid

QString toShortText () const
 a small one line summary

QString type () const
 the name of the Record

QString recordField (int) const
 the name for a recordField

QString emailSeparator () const
void setEmails (const QString &v)
QString emails () const

Static Public Member Functions

int rtti ()

Friends

class DataSet
class OContactAccessBackend_XML

Detailed Description

OContact class represents a specialised PIM Record for contacts. Contact Container.

It does store all kind of persopn related information.

Author:
TT, Stefan Eiler, Holger Freyther

Definition at line 44 of file ocontact.h.


Member Enumeration Documentation

enum OContact::DateFormat
 

Enumeration values:
Zip_City_State 
City_State_Zip 

Definition at line 52 of file ocontact.h.


Constructor & Destructor Documentation

OContact::OContact  ) 
 

Creates a new, empty contact.

Definition at line 53 of file ocontact.cpp.

OContact::OContact const QMap< int, QString > &  fromMap  ) 
 

Definition at line 63 of file ocontact.cpp.

References Qtopia::Record::idsFromString(), QString::isEmpty(), Qtopia::Record::setCategories(), setUid(), QString::toInt(), and OPimRecord::uidGen().

OContact::~OContact  )  [virtual]
 

Destroys a contact.

Definition at line 85 of file ocontact.cpp.


Member Function Documentation

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

Sets the title of the contact to str.

Definition at line 62 of file ocontact.h.

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

Sets the first name of the contact to str.

Definition at line 63 of file ocontact.h.

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

Sets the middle name of the contact to str.

Definition at line 64 of file ocontact.h.

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

Sets the last name of the contact to str.

Definition at line 65 of file ocontact.h.

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

Sets the suffix of the contact to str.

Definition at line 66 of file ocontact.h.

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

Sets the contact to filed as str.

Definition at line 67 of file ocontact.h.

void OContact::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 889 of file ocontact.cpp.

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

void OContact::setDefaultEmail const QString v  ) 
 

Sets the default email of the contact to str.

Definition at line 1183 of file ocontact.cpp.

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

Referenced by insertEmail(), removeEmail(), and setEmails().

void OContact::insertEmail const QString v  ) 
 

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 1129 of file ocontact.cpp.

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

Referenced by insertEmails(), and setDefaultEmail().

void OContact::removeEmail const QString v  ) 
 

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 1151 of file ocontact.cpp.

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

void OContact::clearEmails  ) 
 

Clears the email list.

Definition at line 1178 of file ocontact.cpp.

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

Referenced by removeEmail().

void OContact::insertEmails const QStringList v  ) 
 

Appends the emailList to the exiting email list

Definition at line 1195 of file ocontact.cpp.

References QValueList::begin(), QValueList::end(), and insertEmail().

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

Sets the home street address of the contact to str.

Definition at line 79 of file ocontact.h.

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

Sets the home city of the contact to str.

Definition at line 80 of file ocontact.h.

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

Sets the home state of the contact to str.

Definition at line 81 of file ocontact.h.

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

Sets the home zip code of the contact to str.

Definition at line 82 of file ocontact.h.

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

Sets the home country of the contact to str.

Definition at line 83 of file ocontact.h.

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

Sets the home phone number of the contact to str.

Definition at line 84 of file ocontact.h.

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

Sets the home fax number of the contact to str.

Definition at line 85 of file ocontact.h.

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

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

Definition at line 86 of file ocontact.h.

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

Sets the home webpage of the contact to str.

Definition at line 87 of file ocontact.h.

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

Sets the company for contact to str.

Definition at line 90 of file ocontact.h.

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

Sets the business street address of the contact to str.

Definition at line 91 of file ocontact.h.

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

Sets the business city of the contact to str.

Definition at line 92 of file ocontact.h.

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

Sets the business state of the contact to str.

Definition at line 93 of file ocontact.h.

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

Sets the business zip code of the contact to str.

Definition at line 94 of file ocontact.h.

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

Sets the business country of the contact to str.

Definition at line 95 of file ocontact.h.

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

Sets the business webpage of the contact to str.

Definition at line 96 of file ocontact.h.

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

Sets the job title of the contact to str.

Definition at line 97 of file ocontact.h.

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

Sets the department for contact to str.

Definition at line 98 of file ocontact.h.

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

Sets the office for contact to str.

Definition at line 99 of file ocontact.h.

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

Sets the business phone number of the contact to str.

Definition at line 100 of file ocontact.h.

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

Sets the business fax number of the contact to str.

Definition at line 101 of file ocontact.h.

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

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

Definition at line 102 of file ocontact.h.

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

Sets the business pager number of the contact to str.

Definition at line 103 of file ocontact.h.

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

Sets the profession of the contact to str.

Definition at line 104 of file ocontact.h.

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

Sets the assistant of the contact to str.

Definition at line 105 of file ocontact.h.

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

Sets the manager of the contact to str.

Definition at line 106 of file ocontact.h.

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

Sets the spouse of the contact to str.

Definition at line 109 of file ocontact.h.

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

Sets the gender of the contact to str.

Definition at line 110 of file ocontact.h.

void OContact::setBirthday const QDate v  ) 
 

Sets the birthday for the contact to date. If date is null the current stored date will be removed.

Definition at line 1070 of file ocontact.cpp.

References QDate::isNull(), and QDate::isValid().

void OContact::setAnniversary const QDate v  ) 
 

Sets the anniversary of the contact to date. If date is null, the current stored date will be removed.

Definition at line 1088 of file ocontact.cpp.

References QDate::isNull(), and QDate::isValid().

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

Sets the nickname of the contact to str.

Definition at line 113 of file ocontact.h.

void OContact::setChildren const QString str  ) 
 

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

Definition at line 1018 of file ocontact.cpp.

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

Sets the notes about the contact to str.

Definition at line 117 of file ocontact.h.

bool OContact::match const QRegExp r  )  const [virtual]
 

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

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

Reimplemented from Qtopia::Record.

Definition at line 1028 of file ocontact.cpp.

References QMap< int, QString >::begin(), QMap< int, QString >::end(), match(), and OPimRecord::setLastHitField().

Referenced by match().

QString OContact::fullName  )  const
 

Returns the full name of the contact

Definition at line 801 of file ocontact.cpp.

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

Referenced by OContactFields::loadFromRecord(), toRichText(), and toShortText().

QString OContact::title  )  const [inline]
 

Returns the title of the contact.

Definition at line 127 of file ocontact.h.

Referenced by fullName().

QString OContact::firstName  )  const [inline]
 

Returns the first name of the contact.

Definition at line 128 of file ocontact.h.

Referenced by fullName(), and setFileAs().

QString OContact::middleName  )  const [inline]
 

Returns the middle name of the contact.

Definition at line 129 of file ocontact.h.

Referenced by fullName(), and setFileAs().

QString OContact::lastName  )  const [inline]
 

Returns the last name of the contact.

Definition at line 130 of file ocontact.h.

Referenced by fullName(), and setFileAs().

QString OContact::suffix  )  const [inline]
 

Returns the suffix of the contact.

Definition at line 131 of file ocontact.h.

Referenced by fullName().

QString OContact::fileAs  )  const [inline]
 

Returns the string the contact is filed as.

Definition at line 132 of file ocontact.h.

QString OContact::defaultEmail  )  const [inline]
 

Returns the default email address of the contact.

Definition at line 135 of file ocontact.h.

Referenced by insertEmail(), removeEmail(), and toRichText().

QStringList OContact::emailList  )  const
 

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

Definition at line 868 of file ocontact.cpp.

References QValueList::begin(), emails(), emailSeparator(), QValueList::end(), QString::isEmpty(), and QStringList::split().

Referenced by removeEmail().

QString OContact::homeStreet  )  const [inline]
 

Returns the home street address of the contact.

Definition at line 144 of file ocontact.h.

Referenced by displayHomeAddress(), and toRichText().

QString OContact::homeCity  )  const [inline]
 

Returns the home city of the contact.

Definition at line 145 of file ocontact.h.

Referenced by displayHomeAddress(), and toRichText().

QString OContact::homeState  )  const [inline]
 

Returns the home state of the contact.

Definition at line 146 of file ocontact.h.

Referenced by displayHomeAddress(), and toRichText().

QString OContact::homeZip  )  const [inline]
 

Returns the home zip of the contact.

Definition at line 147 of file ocontact.h.

Referenced by displayHomeAddress(), and toRichText().

QString OContact::homeCountry  )  const [inline]
 

Returns the home country of the contact.

Definition at line 148 of file ocontact.h.

Referenced by displayHomeAddress(), and toRichText().

QString OContact::homePhone  )  const [inline]
 

Returns the home phone number of the contact.

Definition at line 149 of file ocontact.h.

Referenced by toRichText().

QString OContact::homeFax  )  const [inline]
 

Returns the home fax number of the contact.

Definition at line 150 of file ocontact.h.

Referenced by toRichText().

QString OContact::homeMobile  )  const [inline]
 

Returns the home mobile number of the contact.

Definition at line 151 of file ocontact.h.

Referenced by toRichText().

QString OContact::homeWebpage  )  const [inline]
 

Returns the home webpage of the contact.

Definition at line 152 of file ocontact.h.

Referenced by toRichText().

QString OContact::displayHomeAddress  )  const
 

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

Definition at line 791 of file ocontact.cpp.

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

QString OContact::company  )  const [inline]
 

Returns the company for the contact.

Definition at line 161 of file ocontact.h.

Referenced by toRichText().

QString OContact::businessStreet  )  const [inline]
 

Returns the business street address of the contact.

Definition at line 162 of file ocontact.h.

Referenced by displayBusinessAddress(), and toRichText().

QString OContact::businessCity  )  const [inline]
 

Returns the business city of the contact.

Definition at line 163 of file ocontact.h.

Referenced by displayBusinessAddress(), and toRichText().

QString OContact::businessState  )  const [inline]
 

Returns the business state of the contact.

Definition at line 164 of file ocontact.h.

Referenced by displayBusinessAddress(), and toRichText().

QString OContact::businessZip  )  const [inline]
 

Returns the business zip of the contact.

Definition at line 165 of file ocontact.h.

Referenced by displayBusinessAddress(), and toRichText().

QString OContact::businessCountry  )  const [inline]
 

Returns the business country of the contact.

Definition at line 166 of file ocontact.h.

Referenced by displayBusinessAddress(), and toRichText().

QString OContact::businessWebpage  )  const [inline]
 

Returns the business webpage of the contact.

Definition at line 167 of file ocontact.h.

Referenced by toRichText().

QString OContact::jobTitle  )  const [inline]
 

Returns the job title of the contact.

Definition at line 168 of file ocontact.h.

Referenced by toRichText().

QString OContact::department  )  const [inline]
 

Returns the department for the contact.

Definition at line 169 of file ocontact.h.

Referenced by toRichText().

QString OContact::office  )  const [inline]
 

Returns the office for the contact.

Definition at line 170 of file ocontact.h.

Referenced by toRichText().

QString OContact::businessPhone  )  const [inline]
 

Returns the business phone number of the contact.

Definition at line 171 of file ocontact.h.

Referenced by toRichText().

QString OContact::businessFax  )  const [inline]
 

Returns the business fax number of the contact.

Definition at line 172 of file ocontact.h.

Referenced by toRichText().

QString OContact::businessMobile  )  const [inline]
 

Returns the business mobile number of the contact.

Definition at line 173 of file ocontact.h.

Referenced by toRichText().

QString OContact::businessPager  )  const [inline]
 

Returns the business pager number of the contact.

Definition at line 174 of file ocontact.h.

Referenced by toRichText().

QString OContact::profession  )  const [inline]
 

Returns the profession of the contact.

Definition at line 175 of file ocontact.h.

Referenced by toRichText().

QString OContact::assistant  )  const [inline]
 

Returns the assistant of the contact.

Definition at line 176 of file ocontact.h.

Referenced by toRichText().

QString OContact::manager  )  const [inline]
 

Returns the manager of the contact.

Definition at line 177 of file ocontact.h.

Referenced by toRichText().

QString OContact::displayBusinessAddress  )  const
 

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

Definition at line 781 of file ocontact.cpp.

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

QString OContact::spouse  )  const [inline]
 

Returns the spouse of the contact.

Definition at line 186 of file ocontact.h.

Referenced by toRichText().

QString OContact::gender  )  const [inline]
 

Returns the gender of the contact.

Definition at line 187 of file ocontact.h.

Referenced by toRichText().

QDate OContact::birthday  )  const
 

Returns the birthday of the contact.

Definition at line 1103 of file ocontact.cpp.

References OConversion::dateFromString(), and QString::isEmpty().

Referenced by OContactAccessBackend_XML::queryByExample(), and toRichText().

QDate OContact::anniversary  )  const
 

Returns the anniversary of the contact.

Definition at line 1117 of file ocontact.cpp.

References OConversion::dateFromString(), and QString::isEmpty().

Referenced by OContactAccessBackend_XML::queryByExample(), and toRichText().

QString OContact::nickname  )  const [inline]
 

Returns the nickname of the contact.

Definition at line 190 of file ocontact.h.

Referenced by toRichText().

QString OContact::children  )  const [inline]
 

Returns the children of the contact.

Definition at line 191 of file ocontact.h.

Referenced by toRichText().

QStringList OContact::childrenList  )  const
 

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

Definition at line 836 of file ocontact.cpp.

References QStringList::split().

QString OContact::notes  )  const [inline]
 

Returns the notes relating to the the contact.

Definition at line 195 of file ocontact.h.

Referenced by toRichText().

QString OContact::groups  )  const [inline]
 

Definition at line 196 of file ocontact.h.

QStringList OContact::groupList  )  const
 

QString OContact::toRichText  )  const [virtual]
 

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

Implements OPimRecord.

Definition at line 435 of file ocontact.cpp.

References anniversary(), assistant(), birthday(), businessCity(), businessCountry(), businessFax(), businessMobile(), businessPager(), businessPhone(), businessState(), businessStreet(), businessWebpage(), businessZip(), OPimRecord::categoryNames(), children(), City_State_Zip, company(), QStyleSheet::convertFromPlainText(), QValueList::count(), defaultEmail(), department(), emails(), Qtopia::escapeString(), fullName(), gender(), homeCity(), homeCountry(), homeFax(), homeMobile(), homePhone(), homeState(), homeStreet(), homeWebpage(), homeZip(), QString::isEmpty(), QDate::isValid(), jobTitle(), QStringList::join(), manager(), nickname(), notes(), office(), profession(), Config::readNumEntry(), Config::setGroup(), spouse(), QString::toInt(), QObject::tr(), and Zip_City_State.

QMap< int, QString > OContact::toMap  )  const [virtual]
 

converts the internal structure to a map

Implements OPimRecord.

Definition at line 423 of file ocontact.cpp.

References Qtopia::Record::categories(), Qtopia::Record::idsToString(), QMap::insert(), and QString::isEmpty().

Referenced by OContactAccessBackend_SQL::queryByExample().

QString OContact::field int  key  )  const [inline]
 

Definition at line 201 of file ocontact.h.

Referenced by OContactAccessBackend_XML::queryByExample().

void OContact::setUid int  i  )  [virtual]
 

set the uid

Reimplemented from OPimRecord.

Definition at line 1203 of file ocontact.cpp.

References OPimRecord::setUid().

Referenced by OContactAccessBackend_VCard::load(), and OContact().

QString OContact::toShortText  )  const [virtual]
 

a small one line summary

Implements OPimRecord.

Definition at line 1045 of file ocontact.cpp.

References fullName().

QString OContact::type  )  const [virtual]
 

the name of the Record

Implements OPimRecord.

Definition at line 1049 of file ocontact.cpp.

References QString::fromLatin1().

class QString OContact::recordField int   )  const [virtual]
 

the name for a recordField

Implements OPimRecord.

Definition at line 1056 of file ocontact.cpp.

QString OContact::emailSeparator  )  const [inline]
 

Definition at line 211 of file ocontact.h.

Referenced by emailList(), insertEmail(), and removeEmail().

void OContact::setEmails const QString str  ) 
 

Sets the list of email address for contact to those contained in str. Email address should be separated by ';'s.

Definition at line 1008 of file ocontact.cpp.

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

QString OContact::emails  )  const [inline]
 

Returns the list of email address for a contact separated by ';'s in a single string.

Definition at line 215 of file ocontact.h.

Referenced by emailList(), removeEmail(), and toRichText().

int OContact::rtti  )  [static]
 

Reimplemented from OPimRecord.

Definition at line 1200 of file ocontact.cpp.


Friends And Related Function Documentation

friend class DataSet [friend]
 

Definition at line 46 of file ocontact.h.

friend class OContactAccessBackend_XML [friend]
 

Definition at line 220 of file ocontact.h.


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