Home · All Classes · Annotated · Functions

QContact Class Reference

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

#include <QContact>

Inherits QPimRecord.

Public Types

Public Functions

Static Public Members

Protected Functions


Detailed Description

The QContact 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.


Member Type Documentation

enum QContact::GenderType

This enum describes the three possible choices for gender.

ConstantValue
QContact::UnspecifiedGender0
QContact::Male1
QContact::Female2

enum QContact::Location

Enumerates the types of addresses a contact can have. For instance Home mailing address.

ConstantValueDescription
QContact::Home0x01Residential contact information
QContact::Business0x02Business contact information
QContact::Other0x00Contact information that does not fit into other Location types

enum QContact::PhoneType

Enumerates the types of phone numbers that can be assigned to a contact.

ConstantValueDescription
QContact::HomePhone0x01A non-business land line.
QContact::HomeMobileMobile | HomePhoneA non-business mobile phone number.
QContact::HomeFaxFax | HomePhoneA non-business fax number.
QContact::HomePagerPager | HomePhoneA non-business pager number.
QContact::BusinessPhone0x02A business land line.
QContact::BusinessMobileMobile | BusinessPhoneA business mobile phone number.
QContact::BusinessFaxFax | BusinessPhoneA business fax number.
QContact::BusinessPagerPager | BusinessPhoneA business pager number.
QContact::OtherPhone0x00A land line. Whether the phone number is for Home or Business use is unspecified.
QContact::Mobile0x0100A mobile phone number. Whether the phone is for Home or Business use is unspecified.
QContact::Fax0x0200A fax number. Whether the phone is for Home or Business use is unspecified.
QContact::Pager0x0400A pager number. Whether the phone is for Home or Business use is unspecified.


Member Function Documentation

QContact::QContact ()

Constructs a new QContact.

QContact::QContact ( const QContact & contact )

Constructs a new QContact that is a copy of contact.

QContact::~QContact ()   [virtual]

Destroys the contact.

QContactAddress QContact::address ( Location location ) const

Returns the contacts address for the specified location.

See also setAddress().

QMap<Location, QContactAddress> QContact::addresses () const

Returns the list of phone numbers of the contact.

QDate QContact::anniversary () const

Return the person's anniversary date. QDate will be null if there is anniversary has not been set.

See also setAnniversary().

QString QContact::assistant () const

Returns the assistant of the contact.

See also setAssistant().

QDate QContact::birthday () const

Return the person's birthday. QDate will be null if there is birthday has not been set.

See also setBirthday().

QString QContact::businessCity () const

Returns the business city of the contact.

See also setBusinessCity().

QString QContact::businessCountry () const

Returns the business country of the contact.

See also setBusinessCountry().

QString QContact::businessFax () const

Returns the business fax number of the contact.

See also setBusinessFax().

QString QContact::businessMobile () const

Returns the business mobile number of the contact.

See also setBusinessMobile().

QString QContact::businessPager () const

Returns the business pager number of the contact.

See also setBusinessPager().

QString QContact::businessPhone () const

Returns the business phone number of the contact.

See also setBusinessPhone().

QString QContact::businessState () const

Returns the business state of the contact.

See also setBusinessState().

QString QContact::businessStreet () const

Returns the business street address of the contact.

See also setBusinessStreet().

QString QContact::businessWebpage () const

Returns the business webpage of the contact.

See also setBusinessWebpage().

QString QContact::businessZip () const

Returns the business zip of the contact.

See also setBusinessZip().

QList<QString> & QContact::categoriesRef ()   [virtual protected]

Reimplemented from QPimRecord.

const QList<QString> & QContact::categoriesRef () const   [virtual protected]

This is an overloaded member function, provided for convenience.

Reimplemented from QPimRecord.

void QContact::changePortrait ( const QPixmap & p )

Changes the contacts portrait to the given pixmap p. The pixmap is saved to the contactimages directory, and replaces the file currently used as the contact's portrait.

QString QContact::children () const

Returns the children of the contact.

See also setChildren().

void QContact::clearEmailList ()

Clear the email list for the contact, including the default email.

QString QContact::company () const

Returns the company for the contact.

See also setCompany().

QString QContact::companyPronunciation () const

Returns the pronunciation of the contacts company name.

See also setCompanyPronunciation().

QMap<QString, QString> & QContact::customFieldsRef ()   [virtual protected]

Reimplemented from QPimRecord.

const QMap<QString, QString> & QContact::customFieldsRef () const   [virtual protected]

This is an overloaded member function, provided for convenience.

Reimplemented from QPimRecord.

QString QContact::defaultEmail () const

Returns the default email address of the contact.

See also setDefaultEmail().

QString QContact::defaultPhoneNumber () const

Return the default phone number of the contact. If no default phone number is set returns the null string.

See also setDefaultPhoneNumber().

QString QContact::department () const

Returns the department for the contact.

See also setDepartment().

QString QContact::displayAddress ( Location location ) const

Returns the formated address of the contact of type location.

QString QContact::displayBusinessAddress () const

Returns the formatted address of the contacts business address.

QString QContact::displayHomeAddress () const

Returns the formatted address of the contacts home address.

QStringList QContact::emailList () const

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

See also setEmailList().

QString QContact::firstName () const

Returns the first name of the contact.

See also setFirstName().

QString QContact::firstNamePronunciation () const

Returns the pronunciation of the contacts first name.

See also setFirstNamePronunciation().

GenderType QContact::gender () const

Returns the gender of the contact as type GenderType.

See also setGender().

QString QContact::homeCity () const

Returns the home city of the contact.

See also setHomeCity().

QString QContact::homeCountry () const

Returns the home country of the contact.

See also setHomeCountry().

QString QContact::homeFax () const

Returns the home fax number of the contact.

See also setHomeFax().

QString QContact::homeMobile () const

Returns the home mobile number of the contact.

See also setHomeMobile().

QString QContact::homePhone () const

Returns the home phone number of the contact.

See also setHomePhone().

QString QContact::homeState () const

Returns the home state of the contact.

See also setHomeState().

QString QContact::homeStreet () const

Returns the home street address of the contact.

See also setHomeStreet().

QString QContact::homeWebpage () const

Returns the home webpage of the contact.

See also setHomeWebpage().

QString QContact::homeZip () const

Returns the home zip of the contact.

See also setHomeZip().

void QContact::insertEmail ( const QString & email )

Adds email to the list of email address for the contact. If no default email is set, the default email will be set to email.

QString QContact::jobTitle () const

Returns the job title of the contact.

See also setJobTitle().

QString QContact::label () const

Returns a suitable display string for the contact.

QStringList QContact::labelFields ()   [static]

Returns the string identifiers suitable for describing the format for the contact label.

QString QContact::labelFormat ()   [static]

Returns the format for contact labels.

The format is a set of pattern separated by '|'s. Each pattern is a set of space separated tokens. A token can either be _ for a space, an identifier as from indentifierKey(), or any string. The format for label will the first pattern for which all fields specified are non null for the contact.

For example:

LastName , _ FirstName | LastName | FirstName | Company

See also setLabelFormat().

QString QContact::lastName () const

Returns the last name of the contact.

See also setLastName().

QString QContact::lastNamePronunciation () const

Returns the pronunciation of the contacts last name.

See also setLastNamePronunciation().

QString QContact::manager () const

Returns the manager of the contact.

See also setManager().

bool QContact::match ( const QString & regexp ) const

Returns true if the part of contact matches regexp. Otherwise returns false.

bool QContact::match ( const QRegExp & r ) const

This is an overloaded member function, provided for convenience.

Returns true if the part of contact matches r. Otherwise returns false.

QString QContact::middleName () const

Returns the middle name of the contact.

See also setMiddleName().

QString QContact::nameTitle () const

Returns the title of the contact.

See also setNameTitle().

QString QContact::nickname () const

Returns the nickname of the contact.

See also setNickname().

QString QContact::notes () const   [virtual]

Returns the notes relating to the the contact.

Reimplemented from QPimRecord.

See also setNotes().

QString QContact::office () const

Returns the office for the contact.

See also setOffice().

QIcon QContact::phoneIcon ( PhoneType type )   [static]

Returns an icon representing the phone number type Returns a null icon if no icon is available for the phone number type.

See also phoneIconResource().

QString QContact::phoneIconResource ( PhoneType type )   [static]

Returns the resource location for an icon representing the phone number type. Returns a null string if no icon is available for the phone number type.

See also phoneIcon().

QString QContact::phoneNumber ( PhoneType type ) const

Returns the phone number of type for the contact.

See also setPhoneNumber().

QMap<PhoneType, QString> QContact::phoneNumbers () const

Returns the list of phone numbers of the contact.

QList<PhoneType> QContact::phoneTypes ()   [static]

Returns a list of phone types that can be assigned as a contact phone number.

QPixmap QContact::portrait () const

Returns the pixmap portrait of the contact. If there is no portrait set for the contact will return a default pixmap

QString QContact::portraitFile () const

Returns the path for the portrait file of the contact.

See also setPortraitFile().

QString QContact::profession () const

Returns the profession of the contact.

See also setProfession().

QList<QContact> QContact::readVCard ( const QString & filename )   [static]

Reads the file specified by filename as a list of vCards objects and returns the list of near equivalent contacts.

See also writeVCard().

QList<QContact> QContact::readVCard ( const QByteArray & vcard )   [static]

This is an overloaded member function, provided for convenience.

Reads the given VCard data in vcard, and returns the list of near equivalent contacts.

See also writeVCard().

QList<QContact> QContact::readVCard ( VObject * vobject )   [static]

This is an overloaded member function, provided for convenience.

Reads the given VCard data in vobject, and returns the list of near equivalent contacts.

See also writeVCard().

void QContact::removeEmail ( const QString & email )

Removes email from the list of email address for the contact. If the email is the default email, the default email will be set to the first one in the list.

void QContact::setAddress ( Location location, const QContactAddress & address )

Sets the contacts address for the location to address

See also address().

void QContact::setAnniversary ( const QDate & date )

Sets the person's anniversary to date.

See also anniversary().

void QContact::setAssistant ( const QString & str )

Sets the assistant of the contact to str.

See also assistant().

void QContact::setBirthday ( const QDate & date )

Sets the person's birthday to date.

See also birthday().

void QContact::setBusinessCity ( const QString & str )

Sets the business city of the contact to str.

See also businessCity().

void QContact::setBusinessCountry ( const QString & str )

Sets the business country of the contact to str.

See also businessCountry().

void QContact::setBusinessFax ( const QString & str )

Sets the business fax number of the contact to str.

See also businessFax().

void QContact::setBusinessMobile ( const QString & str )

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

See also businessMobile().

void QContact::setBusinessPager ( const QString & str )

Sets the business pager number of the contact to str.

See also businessPager().

void QContact::setBusinessPhone ( const QString & str )

Sets the business phone number of the contact to str.

See also businessPhone().

void QContact::setBusinessState ( const QString & str )

Sets the business state of the contact to str.

See also businessState().

void QContact::setBusinessStreet ( const QString & str )

Sets the business street address of the contact to str.

See also businessStreet().

void QContact::setBusinessWebpage ( const QString & str )

Sets the business webpage of the contact to str.

See also businessWebpage().

void QContact::setBusinessZip ( const QString & str )

Sets the business zip code of the contact to str.

See also businessZip().

void QContact::setChildren ( const QString & str )

Sets the children of the contact to str.

See also children().

void QContact::setCompany ( const QString & str )

Sets the company for contact to str.

See also company().

void QContact::setCompanyPronunciation ( const QString & str )

Sets the pronunciation of the contacts company name to str.

See also companyPronunciation().

void QContact::setDefaultEmail ( const QString & v )

Sets the default email to v and adds it to the list.

See also defaultEmail().

void QContact::setDefaultPhoneNumber ( const QString & str )

If the phone number str is a phone number for the contact will set it as the default phone number.

See also defaultPhoneNumber().

void QContact::setDefaultPhoneNumber ( PhoneType type )

This is an overloaded member function, provided for convenience.

If the phone number of type is a phone number for the contact will set it as the default phone number.

void QContact::setDepartment ( const QString & str )

Sets the department for contact to str.

See also department().

void QContact::setEmailList ( const QStringList & emails )

Sets the email list to emails

See also emailList().

void QContact::setFirstName ( const QString & str )

Sets the first name of the contact to str.

See also firstName().

void QContact::setFirstNamePronunciation ( const QString & str )

Sets the pronunciation of the contacts first name to str.

See also firstNamePronunciation().

void QContact::setGender ( GenderType g )

Sets the persons gender to the enum value specified in g.

See also gender().

void QContact::setHomeCity ( const QString & str )

Sets the home city of the contact to str.

See also homeCity().

void QContact::setHomeCountry ( const QString & str )

Sets the home country of the contact to str.

See also homeCountry().

void QContact::setHomeFax ( const QString & str )

Sets the home fax number of the contact to str.

See also homeFax().

void QContact::setHomeMobile ( const QString & str )

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

See also homeMobile().

void QContact::setHomePhone ( const QString & str )

Sets the home phone number of the contact to str.

See also homePhone().

void QContact::setHomeState ( const QString & str )

Sets the home state of the contact to str.

See also homeState().

void QContact::setHomeStreet ( const QString & str )

Sets the home street address of the contact to str.

See also homeStreet().

void QContact::setHomeWebpage ( const QString & str )

Sets the home webpage of the contact to str.

See also homeWebpage().

void QContact::setHomeZip ( const QString & str )

Sets the home zip code of the contact to str.

See also homeZip().

void QContact::setJobTitle ( const QString & str )

Sets the job title of the contact to str.

See also jobTitle().

void QContact::setLabelFormat ( const QString & f )   [static]

Sets the format for contact labels to that described by f.

The format is a set of pattern separated by '|'s. Each pattern is a set of space separated tokens. A token can either be _ for a space, an identifier as from indentifierKey(), or any string. The format for label will the first pattern for which all fields specified are non null for the contact.

For example:

LastName , _ FirstName | LastName | FirstName | Company

See also labelFormat().

void QContact::setLastName ( const QString & str )

Sets the last name of the contact to str.

See also lastName().

void QContact::setLastNamePronunciation ( const QString & str )

Sets the pronunciation of the contacts last name to str.

See also lastNamePronunciation().

void QContact::setManager ( const QString & str )

Sets the manager of the contact to str.

See also manager().

void QContact::setMiddleName ( const QString & str )

Sets the middle name of the contact to str.

See also middleName().

void QContact::setNameTitle ( const QString & str )

Sets the title of the contact to str.

See also nameTitle().

void QContact::setNickname ( const QString & str )

Sets the nickname of the contact to str.

See also nickname().

void QContact::setNotes ( const QString & str )   [virtual]

Sets the notes about the contact to str.

Reimplemented from QPimRecord.

See also notes().

void QContact::setOffice ( const QString & str )

Sets the office for contact to str.

See also office().

void QContact::setPhoneNumber ( PhoneType type, const QString & str )

Sets the phone number of type type to str.

If there is no default phone number set will set this number as the default phone number.

See also phoneNumber().

void QContact::setPortraitFile ( const QString & str )

Sets the path for the portrait file of the contact to str.

See also portraitFile().

void QContact::setProfession ( const QString & str )

Sets the profession of the contact to str.

See also profession().

void QContact::setSpouse ( const QString & str )

Sets the spouse of the contact to str.

See also spouse().

void QContact::setSuffix ( const QString & str )

Sets the suffix of the contact to str.

See also suffix().

QString QContact::spouse () const

Returns the spouse of the contact.

See also setSpouse().

QString QContact::suffix () const

Returns the suffix of the contact.

See also setSuffix().

QPixmap QContact::thumbnail () const

Returns the pixmap portrait of the contact, scaled down the thumbnail size. If there is no portrait set for the contact will return a default pixmap

QString QContact::toRichText () const

Returns a rich text formatted QString of the QContact.

QUniqueId & QContact::uidRef ()   [virtual protected]

Reimplemented from QPimRecord.

const QUniqueId & QContact::uidRef () const   [virtual protected]

This is an overloaded member function, provided for convenience.

Reimplemented from QPimRecord.

bool QContact::writeVCard ( const QString & filename, const QList<QContact> & contacts )   [static]

Write the list of contacts as vCard objects to the file specified by filename.

Returns true on success, false on fail.

See also readVCard().

bool QContact::writeVCard ( const QString & filename ) const

This is an overloaded member function, provided for convenience.

Writes the contact as a vCard object to the file specified by filename.

Returns true on success, false on fail.

See also readVCard().

void QContact::writeVCard ( QFile & file ) const

This is an overloaded member function, provided for convenience.

Writes the contact as a vCard object to the given file, which must be already open for writing.

See also readVCard().

void QContact::writeVCard ( QDataStream * stream ) const

This is an overloaded member function, provided for convenience.

Writes the contact as a vCard object to the given stream, which must be writable.

See also readVCard().

bool QContact::operator!= ( const QContact & other ) const

Returns false if other is identical to the contact. Otherwise return true.

QContact & QContact::operator= ( const QContact & contact )

Makes a copy of contact and assigns it to this QContact.

bool QContact::operator== ( const QContact & other ) const

Compares to other contacts and returns true if it is equivilent. Otherwise returns false


Copyright © 2006 Trolltech Trademarks
Qtopia 4.1.7