KABC::Resource Class Reference
Inheritance diagram for KABC::Resource:

Detailed Description
Definition at line 55 of file resource.h.
Signals | |
void | loadingFinished (Resource *resource) |
void | loadingError (Resource *resource, const QString &msg) |
void | savingFinished (Resource *resource) |
void | savingError (Resource *resource, const QString &msg) |
Public Member Functions | |
Resource (const KConfig *config) | |
virtual | ~Resource () |
virtual ConstIterator | begin () const |
virtual Iterator | begin () |
virtual ConstIterator | end () const |
virtual Iterator | end () |
AddressBook * | addressBook () |
virtual void | writeConfig (KConfig *config) |
virtual Ticket * | requestSaveTicket ()=0 |
virtual void | releaseSaveTicket (Ticket *)=0 |
virtual bool | load ()=0 |
virtual bool | asyncLoad () |
virtual void | insertAddressee (const Addressee &) |
virtual void | removeAddressee (const Addressee &addr) |
virtual bool | save (Ticket *ticket)=0 |
virtual bool | asyncSave (Ticket *ticket) |
virtual Addressee | findByUid (const QString &uid) |
virtual Addressee::List | findByName (const QString &name) |
virtual Addressee::List | findByEmail (const QString &email) |
virtual Addressee::List | findByCategory (const QString &category) |
virtual void | clear () |
void | setAddressBook (AddressBook *) |
Protected Member Functions | |
Ticket * | createTicket (Resource *) |
Protected Attributes | |
Addressee::Map | mAddrMap |
Classes | |
class | ConstIterator |
Resource Const Iterator. More... | |
class | Iterator |
Resource Iterator. More... |
Constructor & Destructor Documentation
KABC::Resource::Resource | ( | const KConfig * | config | ) |
Constructor.
- Parameters:
-
config The config object where the derived classes can read out their settings.
virtual KABC::Resource::~Resource | ( | ) | [virtual] |
Destructor.
Member Function Documentation
AddressBook* KABC::Resource::addressBook | ( | ) |
Returns a pointer to the addressbook.
virtual bool KABC::Resource::asyncLoad | ( | ) | [virtual] |
Loads all addressees asyncronously.
You have to make sure that either the loadingFinished() or loadingError() signal is emitted from within this function.
The default implementation simply calls the synchronous load.
- Returns:
- Whether the synchronous part of loading was successfully.
Reimplemented in KABC::ResourceDir, KABC::ResourceFile, KABC::ResourceLDAPKIO, and KABC::ResourceNet.
virtual bool KABC::Resource::asyncSave | ( | Ticket * | ticket | ) | [virtual] |
Saves all addressees asynchronously.
You have to make sure that either the savingFinished() or savingError() signal is emitted from within this function.
The default implementation simply calls the synchronous save.
- Parameters:
-
ticket You have to release the ticket later with releaseSaveTicket() explicitely.
- Returns:
- Whether the saving was successfully.
Reimplemented in KABC::ResourceDir, KABC::ResourceFile, KABC::ResourceLDAPKIO, and KABC::ResourceNet.
virtual Iterator KABC::Resource::begin | ( | ) | [virtual] |
This is an overloaded member function, provided for convenience.
It behaves essentially like the above function.
virtual ConstIterator KABC::Resource::begin | ( | ) | const [virtual] |
Returns an iterator pointing to the first addressee in the resource.
This iterator equals end() if the resource is empty.
virtual void KABC::Resource::clear | ( | ) | [virtual] |
Removes all addressees from the resource.
virtual Iterator KABC::Resource::end | ( | ) | [virtual] |
This is an overloaded member function, provided for convenience.
It behaves essentially like the above function.
virtual ConstIterator KABC::Resource::end | ( | ) | const [virtual] |
Returns an iterator pointing to the last addressee in the resource.
This iterator equals begin() if the resource is empty.
virtual Addressee::List KABC::Resource::findByCategory | ( | const QString & | category | ) | [virtual] |
Searches all addressees which belongs to the specified category.
- Parameters:
-
category The category you are looking for.
- Returns:
- A list of all matching addressees.
virtual Addressee::List KABC::Resource::findByEmail | ( | const QString & | ) | [virtual] |
Searches all addressees which match the specified email address.
- Parameters:
-
email The email address you are looking for.
- Returns:
- A list of all matching addressees.
virtual Addressee::List KABC::Resource::findByName | ( | const QString & | name | ) | [virtual] |
Searches all addressees which match the specified name.
- Parameters:
-
name The name you are looking for.
- Returns:
- A list of all matching addressees.
Searches an addressee with the specified unique identifier.
- Parameters:
-
uid The unique identifier you are looking for.
- Returns:
- The addressee with the specified unique identifier or an empty addressee.
virtual void KABC::Resource::insertAddressee | ( | const Addressee & | ) | [virtual] |
Insert an addressee into the resource.
virtual bool KABC::Resource::load | ( | ) | [pure virtual] |
Loads all addressees synchronously.
- Returns:
- Whether the loading was successfully.
Implemented in KABC::ResourceDir, KABC::ResourceEvolution, KABC::ResourceFile, KABC::ResourceLDAPKIO, KABC::ResourceNet, and KABC::ResourceSql.
This signal is emitted when an error occured during loading the addressees from the backend to the internal cache.
- Parameters:
-
resource The pointer to the resource which emitted this signal. msg A translated error message.
void KABC::Resource::loadingFinished | ( | Resource * | resource | ) | [signal] |
This signal is emitted when the resource has finished the loading of all addressees from the backend to the internal cache.
- Parameters:
-
resource The pointer to the resource which emitted this signal.
virtual void KABC::Resource::releaseSaveTicket | ( | Ticket * | ) | [pure virtual] |
Releases the ticket previousely requested with requestSaveTicket().
The resource has to remove its locks in this function. This function is also responsible for deleting the ticket.
Implemented in KABC::ResourceDir, KABC::ResourceFile, KABC::ResourceLDAPKIO, and KABC::ResourceNet.
virtual void KABC::Resource::removeAddressee | ( | const Addressee & | addr | ) | [virtual] |
Removes an addressee from resource.
Reimplemented in KABC::ResourceDir, KABC::ResourceEvolution, KABC::ResourceFile, and KABC::ResourceLDAPKIO.
virtual Ticket* KABC::Resource::requestSaveTicket | ( | ) | [pure virtual] |
Request a ticket, you have to pass through save() to allow locking.
The resource has to create its locks in this function.
Implemented in KABC::ResourceDir, KABC::ResourceEvolution, KABC::ResourceFile, KABC::ResourceLDAPKIO, KABC::ResourceNet, and KABC::ResourceSql.
virtual bool KABC::Resource::save | ( | Ticket * | ticket | ) | [pure virtual] |
Saves all addressees synchronously.
- Parameters:
-
ticket You have to release the ticket later with releaseSaveTicket() explicitely.
- Returns:
- Whether the saving was successfully.
Implemented in KABC::ResourceDir, KABC::ResourceEvolution, KABC::ResourceFile, KABC::ResourceLDAPKIO, KABC::ResourceNet, and KABC::ResourceSql.
This signal is emitted when an error occured during saving the addressees from the internal cache to the backend.
- Parameters:
-
resource The pointer to the resource which emitted this signal. msg A translated error message.
void KABC::Resource::savingFinished | ( | Resource * | resource | ) | [signal] |
This signal is emitted when the resource has finished the saving of all addressees from the internal cache to the backend.
- Parameters:
-
resource The pointer to the resource which emitted this signal.
virtual void KABC::Resource::writeConfig | ( | KConfig * | config | ) | [virtual] |
Writes the resource specific config to file.
Reimplemented in KABC::ResourceDir, KABC::ResourceFile, KABC::ResourceLDAPKIO, and KABC::ResourceNet.
The documentation for this class was generated from the following file: