.TH "KABC::AddressBook" kde3 "11 Jun 2005" "Version Version 3.4.1" "kabc Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KABC::AddressBook \- \fBAddress\fP Book.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <addressbook.h>\fP
.PP
Inherits \fBQObject\fP.
.PP
Inherited by \fBKABC::StdAddressBook\fP.
.PP
.SS "Signals"

.in +1c
.ti -1c
.RI "void \fBaddressBookChanged\fP (\fBAddressBook\fP *addressBook)"
.br
.ti -1c
.RI "void \fBaddressBookLocked\fP (\fBAddressBook\fP *addressBook)"
.br
.ti -1c
.RI "void \fBaddressBookUnlocked\fP (\fBAddressBook\fP *addressBook)"
.br
.ti -1c
.RI "void \fBloadingFinished\fP (Resource *resource)"
.br
.ti -1c
.RI "void \fBsavingFinished\fP (Resource *resource)"
.br
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBAddressBook\fP ()"
.br
.ti -1c
.RI "\fBAddressBook\fP (const \fBQString\fP &config)"
.br
.ti -1c
.RI "virtual \fB~AddressBook\fP ()"
.br
.ti -1c
.RI "\fBTicket\fP * \fBrequestSaveTicket\fP (Resource *resource=0)"
.br
.ti -1c
.RI "void \fBreleaseSaveTicket\fP (\fBTicket\fP *ticket)"
.br
.ti -1c
.RI "bool \fBload\fP ()"
.br
.ti -1c
.RI "bool \fBasyncLoad\fP ()"
.br
.ti -1c
.RI "bool \fBsave\fP (\fBTicket\fP *ticket)"
.br
.ti -1c
.RI "bool \fBasyncSave\fP (\fBTicket\fP *ticket)"
.br
.ti -1c
.RI "\fBConstIterator\fP \fBbegin\fP () const "
.br
.ti -1c
.RI "\fBIterator\fP \fBbegin\fP ()"
.br
.ti -1c
.RI "\fBConstIterator\fP \fBend\fP () const "
.br
.ti -1c
.RI "\fBIterator\fP \fBend\fP ()"
.br
.ti -1c
.RI "void \fBclear\fP ()"
.br
.ti -1c
.RI "void \fBinsertAddressee\fP (const \fBAddressee\fP &addr)"
.br
.ti -1c
.RI "void \fBremoveAddressee\fP (const \fBAddressee\fP &addr)"
.br
.ti -1c
.RI "void \fBremoveAddressee\fP (const \fBIterator\fP &it)"
.br
.ti -1c
.RI "\fBIterator\fP \fBfind\fP (const \fBAddressee\fP &addr)"
.br
.ti -1c
.RI "\fBAddressee\fP \fBfindByUid\fP (const \fBQString\fP &uid)"
.br
.ti -1c
.RI "\fBAddressee::List\fP \fBallAddressees\fP ()"
.br
.ti -1c
.RI "\fBAddressee::List\fP \fBfindByName\fP (const \fBQString\fP &\fBname\fP)"
.br
.ti -1c
.RI "\fBAddressee::List\fP \fBfindByEmail\fP (const \fBQString\fP &email)"
.br
.ti -1c
.RI "\fBAddressee::List\fP \fBfindByCategory\fP (const \fBQString\fP &category)"
.br
.ti -1c
.RI "virtual \fBQString\fP \fBidentifier\fP ()"
.br
.ti -1c
.RI "\fBField::List\fP \fBfields\fP (int category=Field::All)"
.br
.ti -1c
.RI "bool \fBaddCustomField\fP (const \fBQString\fP &label, int category=Field::All, const \fBQString\fP &key=QString::null, const \fBQString\fP &app=QString::null)"
.br
.ti -1c
.RI "bool \fBaddResource\fP (Resource *resource)"
.br
.ti -1c
.RI "bool \fBremoveResource\fP (Resource *resource)"
.br
.ti -1c
.RI "\fBQPtrList\fP< Resource > \fBresources\fP ()"
.br
.ti -1c
.RI "void \fBsetErrorHandler\fP (\fBErrorHandler\fP *errorHandler)"
.br
.ti -1c
.RI "void \fBerror\fP (const \fBQString\fP &msg)"
.br
.ti -1c
.RI "void \fBcleanUp\fP () KDE_DEPRECATED"
.br
.ti -1c
.RI "void \fBdump\fP () const "
.br
.ti -1c
.RI "void \fBemitAddressBookLocked\fP ()"
.br
.ti -1c
.RI "void \fBemitAddressBookUnlocked\fP ()"
.br
.ti -1c
.RI "void \fBemitAddressBookChanged\fP ()"
.br
.in -1c
.SS "Protected Slots"

.in +1c
.ti -1c
.RI "void \fBresourceLoadingFinished\fP (Resource *)"
.br
.ti -1c
.RI "void \fBresourceSavingFinished\fP (Resource *)"
.br
.ti -1c
.RI "void \fBresourceLoadingError\fP (Resource *, const \fBQString\fP &)"
.br
.ti -1c
.RI "void \fBresourceSavingError\fP (Resource *, const \fBQString\fP &)"
.br
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "void \fBdeleteRemovedAddressees\fP ()"
.br
.ti -1c
.RI "void \fBsetStandardResource\fP (Resource *)"
.br
.ti -1c
.RI "Resource * \fBstandardResource\fP ()"
.br
.ti -1c
.RI "KRES::Manager< Resource > * \fBresourceManager\fP ()"
.br
.in -1c
.SS "Friends"

.in +1c
.ti -1c
.RI "class \fBStdAddressBook\fP"
.br
.ti -1c
.RI "KABC_EXPORT \fBQDataStream\fP & \fBoperator<<\fP (\fBQDataStream\fP &, const \fBAddressBook\fP &)"
.br
.ti -1c
.RI "KABC_EXPORT \fBQDataStream\fP & \fBoperator>>\fP (\fBQDataStream\fP &, \fBAddressBook\fP &)"
.br
.in -1c
.SS "Classes"

.in +1c
.ti -1c
.RI "class \fBConstIterator\fP"
.br
.RI "\fI\fBAddress\fP Book Const \fBIterator\fP. \fP"
.ti -1c
.RI "class \fBIterator\fP"
.br
.RI "\fI\fBAddress\fP Book \fBIterator\fP. \fP"
.in -1c
.SH "Detailed Description"
.PP 
\fBAddress\fP Book. 

This class provides access to a collection of address book entries. 
.PP
Definition at line 43 of file addressbook.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KABC::AddressBook::AddressBook ()"
.PP
Constructs an address book object. 
.PP
You have to add the resources manually before calling \fBload()\fP. 
.SS "KABC::AddressBook::AddressBook (const \fBQString\fP & config)"
.PP
Constructs an address book object. 
.PP
The resources are loaded automatically.
.PP
\fBParameters:\fP
.RS 4
\fIconfig\fP The config file which contains the resource settings. 
.RE
.PP

.SS "virtual KABC::AddressBook::~\fBAddressBook\fP ()\fC [virtual]\fP"
.PP
Destructor. 
.PP
.SH "Member Function Documentation"
.PP 
.SS "\fBTicket\fP* KABC::AddressBook::requestSaveTicket (Resource * resource = \fC0\fP)"
.PP
Requests a ticket for saving the addressbook. 
.PP
Calling this function locks the addressbook for all other processes. You need the returned ticket object for calling the \fBsave()\fP function.
.PP
\fBParameters:\fP
.RS 4
\fIresource\fP A pointer to the resource which shall be locked. If 0, the default resource is locked. 
.RE
.PP
\fBReturns:\fP
.RS 4
0 if the resource is already locked or a valid save ticket otherwise. 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBsave()\fP 
.RE
.PP

.SS "void KABC::AddressBook::releaseSaveTicket (\fBTicket\fP * ticket)"
.PP
Releases the ticket requested previously with \fBrequestSaveTicket()\fP. 
.PP
Call this function, if you want to release a ticket without saving. 
.SS "bool KABC::AddressBook::load ()"
.PP
Loads all addressees synchronously. 
.PP
\fBReturns:\fP
.RS 4
Whether the loading was successfully. 
.RE
.PP

.SS "bool KABC::AddressBook::asyncLoad ()"
.PP
Loads all addressees asynchronously. 
.PP
This function returns immediately and emits the \fBaddressBookChanged()\fP signal as soon as the loading has finished.
.PP
\fBReturns:\fP
.RS 4
Whether the synchronous part of loading was successfully. 
.RE
.PP

.SS "bool KABC::AddressBook::save (\fBTicket\fP * ticket)"
.PP
Saves all addressees of one resource synchronously. 
.PP
If the save is successfull the ticket is deleted.
.PP
\fBParameters:\fP
.RS 4
\fIticket\fP The ticket returned by \fBrequestSaveTicket()\fP. 
.RE
.PP
\fBReturns:\fP
.RS 4
Whether the saving was successfully. 
.RE
.PP

.SS "bool KABC::AddressBook::asyncSave (\fBTicket\fP * ticket)"
.PP
Saves all addressees of one resource asynchronously. 
.PP
If the save is successfull the ticket is deleted.
.PP
\fBParameters:\fP
.RS 4
\fIticket\fP The ticket returned by \fBrequestSaveTicket()\fP. 
.RE
.PP
\fBReturns:\fP
.RS 4
Whether the synchronous part of saving was successfully. 
.RE
.PP

.SS "\fBConstIterator\fP KABC::AddressBook::begin () const"
.PP
Returns an iterator pointing to the first addressee of address book. 
.PP
This iterator equals \fBend()\fP if the address book is empty. 
.SS "\fBIterator\fP KABC::AddressBook::begin ()"
.PP
This is an overloaded member function, provided for convenience. 
.PP
It behaves essentially like the above function. 
.SS "\fBConstIterator\fP KABC::AddressBook::end () const"
.PP
Returns an iterator pointing to the last addressee of address book. 
.PP
This iterator equals \fBbegin()\fP if the address book is empty. 
.SS "\fBIterator\fP KABC::AddressBook::end ()"
.PP
This is an overloaded member function, provided for convenience. 
.PP
It behaves essentially like the above function. 
.SS "void KABC::AddressBook::clear ()"
.PP
Removes all addressees from the address book. 
.PP
.SS "void KABC::AddressBook::insertAddressee (const \fBAddressee\fP & addr)"
.PP
Insert an addressee into the address book. 
.PP
If an addressee with the same unique id already exists, it is replaced by the new one, otherwise it is appended.
.PP
\fBParameters:\fP
.RS 4
\fIaddr\fP The addressee which shall be insert. 
.RE
.PP

.SS "void KABC::AddressBook::removeAddressee (const \fBAddressee\fP & addr)"
.PP
Removes an addressee from the address book. 
.PP
\fBParameters:\fP
.RS 4
\fIaddr\fP The addressee which shall be removed. 
.RE
.PP

.SS "void KABC::AddressBook::removeAddressee (const \fBIterator\fP & it)"
.PP
This is an overloaded member function, provided for convenience. 
.PP
It behaves essentially like the above function.
.PP
\fBParameters:\fP
.RS 4
\fIit\fP An iterator pointing to the addressee which shall be removed. 
.RE
.PP

.SS "\fBIterator\fP KABC::AddressBook::find (const \fBAddressee\fP & addr)"
.PP
Returns an iterator pointing to the specified addressee. 
.PP
It will return \fBend()\fP if no addressee matched.
.PP
\fBParameters:\fP
.RS 4
\fIaddr\fP The addresee you are looking for. 
.RE
.PP

.SS "\fBAddressee\fP KABC::AddressBook::findByUid (const \fBQString\fP & uid)"
.PP
Searches an addressee with the specified unique identifier. 
.PP
\fBParameters:\fP
.RS 4
\fIuid\fP The unique identifier you are looking for. 
.RE
.PP
\fBReturns:\fP
.RS 4
The addressee with the specified unique identifier or an empty addressee. 
.RE
.PP

.PP
Referenced by KABC::StdAddressBook::whoAmI().
.SS "\fBAddressee::List\fP KABC::AddressBook::allAddressees ()"
.PP
Returns a list of all addressees in the address book. 
.PP
.SS "\fBAddressee::List\fP KABC::AddressBook::findByName (const \fBQString\fP & name)"
.PP
Searches all addressees which match the specified name. 
.PP
\fBParameters:\fP
.RS 4
\fIname\fP The name you are looking for. 
.RE
.PP
\fBReturns:\fP
.RS 4
A list of all matching addressees. 
.RE
.PP

.SS "\fBAddressee::List\fP KABC::AddressBook::findByEmail (const \fBQString\fP & email)"
.PP
Searches all addressees which match the specified email address. 
.PP
\fBParameters:\fP
.RS 4
\fIemail\fP The email address you are looking for. 
.RE
.PP
\fBReturns:\fP
.RS 4
A list of all matching addressees. 
.RE
.PP

.SS "\fBAddressee::List\fP KABC::AddressBook::findByCategory (const \fBQString\fP & category)"
.PP
Searches all addressees which belongs to the specified category. 
.PP
\fBParameters:\fP
.RS 4
\fIcategory\fP The category you are looking for. 
.RE
.PP
\fBReturns:\fP
.RS 4
A list of all matching addressees. 
.RE
.PP

.SS "virtual \fBQString\fP KABC::AddressBook::identifier ()\fC [virtual]\fP"
.PP
Returns a string identifying this addressbook. 
.PP
The identifier is created by concatenation of the resource identifiers. 
.SS "\fBField::List\fP KABC::AddressBook::fields (int category = \fCField::All\fP)"
.PP
Returns a list of all Fields known to the address book which are associated with the given field category. 
.PP
.SS "bool KABC::AddressBook::addCustomField (const \fBQString\fP & label, int category = \fCField::All\fP, const \fBQString\fP & key = \fCQString::null\fP, const \fBQString\fP & app = \fCQString::null\fP)"
.PP
Add custom field to address book. 
.PP
\fBParameters:\fP
.RS 4
\fIlabel\fP User visible label of the field. 
.br
\fIcategory\fP Ored list of field categories. 
.br
\fIkey\fP Identifier used as key for reading and writing the field. 
.br
\fIapp\fP String used as application key for reading and writing the field. 
.RE
.PP

.SS "bool KABC::AddressBook::addResource (Resource * resource)"
.PP
Adds a resource to the address book. 
.PP
\fBParameters:\fP
.RS 4
\fIresource\fP The resource you want to add. 
.RE
.PP
\fBReturns:\fP
.RS 4
Whether opening the resource was successfully. 
.RE
.PP

.SS "bool KABC::AddressBook::removeResource (Resource * resource)"
.PP
Removes a resource from the address book. 
.PP
\fBParameters:\fP
.RS 4
\fIresource\fP The resource you want to remove. 
.RE
.PP
\fBReturns:\fP
.RS 4
Whether closing the resource was successfully. 
.RE
.PP

.SS "\fBQPtrList\fP<Resource> KABC::AddressBook::resources ()"
.PP
Returns a list of all resources. 
.PP
.SS "void KABC::AddressBook::setErrorHandler (\fBErrorHandler\fP * errorHandler)"
.PP
Sets the \fC\fBErrorHandler\fP\fP, that is used by \fBerror()\fP to provide GUI independent error messages. 
.PP
\fBParameters:\fP
.RS 4
\fIerrorHandler\fP The error handler you want to use. 
.RE
.PP

.SS "void KABC::AddressBook::error (const \fBQString\fP & msg)"
.PP
Shows GUI independent error messages. 
.PP
\fBParameters:\fP
.RS 4
\fImsg\fP The error message that shall be displayed. 
.RE
.PP

.SS "void KABC::AddressBook::cleanUp ()"
.PP
\fBDeprecated\fP
.RS 4
There is no need to call this function anymore. 
.RE
.PP

.SS "void KABC::AddressBook::dump () const"
.PP
Used for debug output. 
.PP
This function prints out the list of all addressees to kdDebug(5700). 
.SS "void KABC::AddressBook::addressBookChanged (\fBAddressBook\fP * addressBook)\fC [signal]\fP"
.PP
Emitted when one of the resources discovered a change in its backend or the asynchronous loading of all resources has finished. 
.PP
You should connect to this signal to update the presentation of the contact data in your application.
.PP
\fBParameters:\fP
.RS 4
\fIaddressBook\fP The address book which emitted this signal. 
.RE
.PP

.SS "void KABC::AddressBook::addressBookLocked (\fBAddressBook\fP * addressBook)\fC [signal]\fP"
.PP
Emitted when one of the resources has been locked for writing. 
.PP
\fBParameters:\fP
.RS 4
\fIaddressBook\fP The address book which emitted this signal. 
.RE
.PP

.SS "void KABC::AddressBook::addressBookUnlocked (\fBAddressBook\fP * addressBook)\fC [signal]\fP"
.PP
Emitted when one of the resources has been unlocked. 
.PP
You should connect to this signal if you want to save your changes to a resource which is currently locked, and want to get notified when saving is possible again.
.PP
\fBParameters:\fP
.RS 4
\fIaddressBook\fP The address book which emitted this signal. 
.RE
.PP

.SS "void KABC::AddressBook::loadingFinished (Resource * resource)\fC [signal]\fP"
.PP
Emitted when the asynchronous loading of one resource has finished after calling \fBasyncLoad()\fP. 
.PP
\fBParameters:\fP
.RS 4
\fIresource\fP The resource which emitted this signal. 
.RE
.PP

.SS "void KABC::AddressBook::savingFinished (Resource * resource)\fC [signal]\fP"
.PP
Emitted when the asynchronous saving of one resource has finished after calling \fBasyncSave()\fP. 
.PP
\fBParameters:\fP
.RS 4
\fIresource\fP The resource which emitted this signal. 
.RE
.PP


.SH "Author"
.PP 
Generated automatically by Doxygen for kabc Library from the source code.
