KABC::AddressBook Class Reference
Address Book. More...
#include <addressbook.h>
Inheritance diagram for KABC::AddressBook:

Signals | |
void | addressBookChanged (AddressBook *addressBook) |
void | addressBookLocked (AddressBook *addressBook) |
void | addressBookUnlocked (AddressBook *addressBook) |
void | loadingFinished (Resource *resource) |
void | savingFinished (Resource *resource) |
Public Methods | |
AddressBook () | |
AddressBook (const QString &config) | |
virtual | ~AddressBook () |
Ticket * | requestSaveTicket (Resource *resource=0) |
void | releaseSaveTicket (Ticket *ticket) |
bool | load () |
bool | asyncLoad () |
bool | save (Ticket *ticket) |
bool | asyncSave (Ticket *ticket) |
ConstIterator | begin () const |
Iterator | begin () |
ConstIterator | end () const |
Iterator | end () |
void | clear () |
void | insertAddressee (const Addressee &addr) |
void | removeAddressee (const Addressee &addr) |
void | removeAddressee (const Iterator &it) |
Iterator | find (const Addressee &addr) |
Addressee | findByUid (const QString &uid) |
Addressee::List | allAddressees () |
Addressee::List | findByName (const QString &name) |
Addressee::List | findByEmail (const QString &email) |
Addressee::List | findByCategory (const QString &category) |
virtual QString | identifier () |
Field::List | fields (int category=Field::All) |
bool | addCustomField (const QString &label, int category=Field::All, const QString &key=QString::null, const QString &app=QString::null) |
bool | addResource (Resource *resource) |
bool | removeResource (Resource *resource) |
QPtrList< Resource > | resources () |
void | setErrorHandler (ErrorHandler *errorHandler) |
void | error (const QString &msg) |
void | cleanUp () KDE_DEPRECATED |
void | dump () const |
void | emitAddressBookLocked () |
void | emitAddressBookUnlocked () |
void | emitAddressBookChanged () |
Protected Slots | |
void | resourceLoadingFinished (Resource *) |
void | resourceSavingFinished (Resource *) |
void | resourceLoadingError (Resource *, const QString &) |
void | resourceSavingError (Resource *, const QString &) |
Protected Methods | |
void | deleteRemovedAddressees () |
void | setStandardResource (Resource *) |
Resource * | standardResource () |
KRES::Manager< Resource > * | resourceManager () |
Friends | |
class | StdAddressBook |
Q_OBJECT friend QDataStream & | operator<< (QDataStream &, const AddressBook &) |
QDataStream & | operator>> (QDataStream &, AddressBook &) |
Detailed Description
Address Book.This class provides access to a collection of address book entries.
Definition at line 43 of file addressbook.h.
Constructor & Destructor Documentation
|
Constructs an address book object. You have to add the resources manually before calling load(). Definition at line 296 of file addressbook.cpp. |
|
Constructs an address book object. The resources are loaded automatically.
Definition at line 306 of file addressbook.cpp. References QString::isEmpty(). |
|
Destructor.
Definition at line 320 of file addressbook.cpp. |
Member Function Documentation
|
Requests a ticket for saving the addressbook. Calling this function locks the addressbook for all other processes. You need the returned ticket object for calling the save() function.
Definition at line 480 of file addressbook.cpp. |
|
Releases the ticket requested previously with requestSaveTicket(). Call this function, if you want to release a ticket without saving. Definition at line 500 of file addressbook.cpp. References KABC::Ticket::resource(). |
|
Loads all addressees synchronously.
Definition at line 328 of file addressbook.cpp. |
|
Loads all addressees asynchronously. This function returns immediately and emits the addressBookChanged() signal as soon as the loading has finished.
Definition at line 346 of file addressbook.cpp. |
|
Saves all addressees of one resource synchronously. If the save is successfull the ticket is deleted.
Definition at line 365 of file addressbook.cpp. References KABC::Ticket::resource(). |
|
Saves all addressees of one resource asynchronously. If the save is successfull the ticket is deleted.
Definition at line 379 of file addressbook.cpp. References KABC::Ticket::resource(). |
|
Returns an iterator pointing to the first addressee of address book. This iterator equals end() if the address book is empty. Definition at line 420 of file addressbook.cpp. References QValueList::append(), QValueList::count(), KABC::AddressBook::Iterator::d, and end(). Referenced by allAddressees(), dump(), and find(). |
|
This is an overloaded member function, provided for convenience. It behaves essentially like the above function. Definition at line 393 of file addressbook.cpp. References QValueList::append(), QValueList::count(), KABC::AddressBook::Iterator::d, and end(). |
|
Returns an iterator pointing to the last addressee of address book. This iterator equals begin() if the address book is empty. Definition at line 460 of file addressbook.cpp. Referenced by allAddressees(), begin(), dump(), and find(). |
|
This is an overloaded member function, provided for convenience. It behaves essentially like the above function. Definition at line 447 of file addressbook.cpp. |
|
Removes all addressees from the address book.
Definition at line 473 of file addressbook.cpp. |
|
Insert an addressee into the address book. If an addressee with the same unique id already exists, it is replaced by the new one, otherwise it is appended.
Definition at line 510 of file addressbook.cpp. References QDateTime::currentDateTime(), KABC::Addressee::isEmpty(), KABC::Addressee::resource(), KABC::Addressee::setChanged(), KABC::Addressee::setResource(), and KABC::Addressee::uid(). Referenced by KABC::VCard21Parser::readFromString(). |
|
Removes an addressee from the address book.
Definition at line 538 of file addressbook.cpp. References KABC::Addressee::resource(). |
|
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
Definition at line 544 of file addressbook.cpp. |
|
Returns an iterator pointing to the specified addressee. It will return end() if no addressee matched.
Definition at line 550 of file addressbook.cpp. References begin(), end(), and KABC::Addressee::uid(). |
|
Searches an addressee with the specified unique identifier.
Definition at line 561 of file addressbook.cpp. References KABC::Addressee::isEmpty(). Referenced by KABC::DistributionListManager::load(), and KABC::StdAddressBook::whoAmI(). |
|
Returns a list of all addressees in the address book.
Definition at line 573 of file addressbook.cpp. |
|
Searches all addressees which match the specified name.
Definition at line 584 of file addressbook.cpp. |
|
Searches all addressees which match the specified email address.
Definition at line 595 of file addressbook.cpp. |
|
Searches all addressees which belongs to the specified category.
Definition at line 606 of file addressbook.cpp. |
|
Returns a string identifying this addressbook. The identifier is created by concatenation of the resource identifiers. Definition at line 629 of file addressbook.cpp. References identifier(), and QStringList::join(). Referenced by identifier(), KABC::DistributionListManager::load(), and KABC::DistributionListManager::save(). |
|
Returns a list of all Fields known to the address book which are associated with the given field category.
Definition at line 643 of file addressbook.cpp. |
|
Add custom field to address book.
Definition at line 660 of file addressbook.cpp. References KGlobal::instance(), KInstance::instanceName(), QString::isNull(), KStdAccel::key(), and KStdAccel::label(). |
|
Adds a resource to the address book.
Definition at line 695 of file addressbook.cpp. References QObject::connect(), loadingFinished(), and savingFinished(). |
|
Removes a resource from the address book.
Definition at line 718 of file addressbook.cpp. References QObject::disconnect(), loadingFinished(), and savingFinished(). |
|
Returns a list of all resources.
Definition at line 742 of file addressbook.cpp. References QPtrList::append(). |
|
Sets the
Definition at line 753 of file addressbook.cpp. |
|
Shows GUI independent error messages.
Definition at line 759 of file addressbook.cpp. |
|
Definition at line 790 of file addressbook.cpp. |
|
Used for debug output. This function prints out the list of all addressees to kdDebug(5700). Definition at line 617 of file addressbook.cpp. |
|
Emitted when one of the resources discovered a change in its backend or the asynchronous loading of all resources has finished. You should connect to this signal to update the presentation of the contact data in your application.
|
|
Emitted when one of the resources has been locked for writing.
|
|
Emitted when one of the resources has been unlocked. 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.
|
|
Emitted when the asynchronous loading of one resource has finished after calling asyncLoad().
Referenced by addResource(), and removeResource(). |
|
Emitted when the asynchronous saving of one resource has finished after calling asyncSave().
Referenced by addResource(), and removeResource(). |
The documentation for this class was generated from the following files: