kabc Library API Documentation

KABC::Resource Class Reference

Inheritance diagram for KABC::Resource:

KABC::ResourceDir KABC::ResourceEvolution KABC::ResourceFile KABC::ResourceLDAPKIO KABC::ResourceNet KABC::ResourceSql List of all members.

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 ()
AddressBookaddressBook ()
virtual void writeConfig (KConfig *config)
virtual TicketrequestSaveTicket ()=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

TicketcreateTicket (Resource *)

Protected Attributes

Addressee::Map mAddrMap

Classes

class  ConstIterator
 Resource Const Iterator. More...
class  Iterator
 Resource Iterator. More...

Detailed Description

Definition at line 55 of file resource.h.


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

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.

Referenced by KABC::ResourceSql::save(), KABC::ResourceEvolution::save(), KABC::VCardFormatPlugin::saveAll(), and KABC::BinaryFormat::saveAll().

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::end  )  const [virtual]
 

Returns an iterator pointing to the last addressee in the resource.

This iterator equals begin() if the resource is empty.

Referenced by KABC::ResourceSql::save(), KABC::ResourceEvolution::save(), KABC::VCardFormatPlugin::saveAll(), and KABC::BinaryFormat::saveAll().

virtual Iterator KABC::Resource::end  )  [virtual]
 

This is an overloaded member function, provided for convenience.

It behaves essentially like the above function.

AddressBook* KABC::Resource::addressBook  ) 
 

Returns a pointer to the addressbook.

Referenced by KABC::ResourceSql::load(), KABC::ResourceEvolution::load(), KABC::ResourceDir::load(), KABC::ResourceDir::pathChanged(), KABC::ResourceSql::requestSaveTicket(), KABC::ResourceEvolution::requestSaveTicket(), KABC::ResourceDir::requestSaveTicket(), KABC::ResourceSql::save(), KABC::ResourceEvolution::save(), and KABC::ResourceDir::save().

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.

Referenced by KABC::ResourceDir::writeConfig().

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

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 void KABC::Resource::insertAddressee const Addressee  )  [virtual]
 

Insert an addressee into the resource.

Referenced by KABC::VCardFormatPlugin::loadAll(), and KABC::BinaryFormat::loadAll().

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

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 Addressee KABC::Resource::findByUid const QString uid  )  [virtual]
 

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

virtual Addressee::List KABC::Resource::findByEmail const QString email  )  [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::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 void KABC::Resource::clear  )  [virtual]
 

Removes all addressees from the resource.

Referenced by KABC::ResourceDir::pathChanged().

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.

Referenced by KABC::ResourceDir::asyncLoad().

void KABC::Resource::loadingError Resource resource,
const QString msg
[signal]
 

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.

Referenced by KABC::ResourceDir::asyncLoad().

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.

Referenced by KABC::ResourceDir::asyncSave().

void KABC::Resource::savingError Resource resource,
const QString msg
[signal]
 

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.

Referenced by KABC::ResourceDir::asyncSave().


The documentation for this class was generated from the following file:
KDE Logo
This file is part of the documentation for kabc Library Version 3.4.1.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Nov 1 10:34:55 2005 by doxygen 1.4.3 written by Dimitri van Heesch, © 1997-2003