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.

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

Constructor & Destructor Documentation

Resource::Resource ( const KConfig config  ) 

Constructor.

Parameters:
config The config object where the derived classes can read out their settings.

Definition at line 200 of file resource.cpp.

Resource::~Resource (  )  [virtual]

Destructor.

Definition at line 205 of file resource.cpp.


Member Function Documentation

Resource::ConstIterator Resource::begin (  )  const [virtual]

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

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

Definition at line 217 of file resource.cpp.

Resource::Iterator Resource::begin (  )  [virtual]

This is an overloaded member function, provided for convenience.

It behaves essentially like the above function.

Definition at line 209 of file resource.cpp.

Resource::ConstIterator Resource::end (  )  const [virtual]

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

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

Definition at line 232 of file resource.cpp.

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

This is an overloaded member function, provided for convenience.

It behaves essentially like the above function.

Definition at line 224 of file resource.cpp.

AddressBook * Resource::addressBook (  ) 

Returns a pointer to the addressbook.

Definition at line 249 of file resource.cpp.

void Resource::writeConfig ( KConfig config  )  [virtual]

Writes the resource specific config to file.

Reimplemented in KABC::ResourceDir, KABC::ResourceFile, KABC::ResourceLDAPKIO, and KABC::ResourceNet.

Definition at line 239 of file resource.cpp.

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.

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

Definition at line 328 of file resource.cpp.

void Resource::insertAddressee ( const Addressee  )  [virtual]

Insert an addressee into the resource.

Definition at line 259 of file resource.cpp.

void Resource::removeAddressee ( const Addressee addr  )  [virtual]

Removes an addressee from resource.

Reimplemented in KABC::ResourceDir, KABC::ResourceEvolution, KABC::ResourceFile, and KABC::ResourceLDAPKIO.

Definition at line 264 of file resource.cpp.

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.

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

Definition at line 340 of file resource.cpp.

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

Definition at line 269 of file resource.cpp.

Addressee::List 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.

Definition at line 279 of file resource.cpp.

Addressee::List 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.

Definition at line 292 of file resource.cpp.

Addressee::List 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.

Definition at line 309 of file resource.cpp.

void Resource::clear (  )  [virtual]

Removes all addressees from the resource.

Definition at line 323 of file resource.cpp.

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.

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.

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.

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.


The documentation for this class was generated from the following files:
KDE Home | KDE Accessibility Home | Description of Access Keys