• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepimlibs API Reference
  • KDE Home
  • Contact Us
 

kabc

  • KABC
  • Resource
Classes | Signals | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
KABC::Resource Class Referenceabstract

#include <resource.h>

Inheritance diagram for KABC::Resource:
Inheritance graph
[legend]

Classes

class  ConstIterator
 

Signals

void loadingError (Resource *resource, const QString &msg)
 
void loadingFinished (Resource *resource)
 
void savingError (Resource *resource, const QString &msg)
 
void savingFinished (Resource *resource)
 

Public Member Functions

 Resource ()
 
 Resource (const KConfigGroup &group)
 
virtual ~Resource ()
 
AddressBook * addressBook ()
 
virtual QStringList allDistributionListNames () const
 
virtual QList< DistributionList * > allDistributionLists ()
 
virtual bool asyncLoad ()
 
virtual bool asyncSave (Ticket *ticket)
 
virtual ConstIterator begin () const
 
virtual Iterator begin ()
 
virtual void clear ()
 
ConstIterator constBegin () const
 
ConstIterator constEnd () const
 
virtual ConstIterator end () const
 
virtual Iterator end ()
 
virtual Addressee::List findByCategory (const QString &category)
 
virtual Addressee::List findByEmail (const QString &email)
 
virtual Addressee::List findByName (const QString &name)
 
virtual Addressee findByUid (const QString &uid)
 
virtual DistributionList * findDistributionListByIdentifier (const QString &identifier)
 
virtual DistributionList * findDistributionListByName (const QString &name, Qt::CaseSensitivity caseSensitivity=Qt::CaseSensitive)
 
virtual void insertAddressee (const Addressee &addr)
 
virtual void insertDistributionList (DistributionList *list)
 
virtual bool load ()=0
 
virtual void releaseSaveTicket (Ticket *ticket)=0
 
virtual void removeAddressee (const Addressee &addr)
 
virtual void removeDistributionList (DistributionList *list)
 
virtual Ticket * requestSaveTicket ()=0
 
virtual bool save (Ticket *ticket)=0
 
void setAddressBook (AddressBook *addr)
 
virtual void writeConfig (KConfigGroup &group)
 
- Public Member Functions inherited from KRES::Resource
 Resource (const KConfigGroup &group)
 
void close ()
 
virtual void dump () const
 
QString identifier () const
 
bool isActive () const
 
bool isOpen () const
 
bool open ()
 
virtual bool readOnly () const
 
virtual QString resourceName () const
 
void setActive (bool active)
 
void setIdentifier (const QString &identifier)
 
virtual void setReadOnly (bool value)
 
virtual void setResourceName (const QString &name)
 
void setType (const QString &type)
 
QString type () const
 

Protected Member Functions

Ticket * createTicket (Resource *)
 
- Protected Member Functions inherited from KRES::Resource
virtual void doClose ()
 
virtual bool doOpen ()
 

Protected Attributes

Addressee::Map mAddrMap
 
DistributionListMap mDistListMap
 

Detailed Description

Definition at line 64 of file resource.h.

Constructor & Destructor Documentation

Resource::Resource ( )

Default constructor.

Definition at line 218 of file resource.cpp.

Resource::Resource ( const KConfigGroup &  group)

Constructor.

Parameters
groupThe configuration group where the derived classes can read out their settings.

Definition at line 223 of file resource.cpp.

Resource::~Resource ( )
virtual

Destructor.

Reimplemented from KRES::Resource.

Definition at line 228 of file resource.cpp.

Member Function Documentation

AddressBook * Resource::addressBook ( )

Returns a pointer to the addressbook.

Definition at line 274 of file resource.cpp.

QStringList Resource::allDistributionListNames ( ) const
virtual

Returns a list of names of all distribution lists of this resource.

Convenience function, equal to iterate over the list returned by allDistributionLists()

Definition at line 420 of file resource.cpp.

QList< DistributionList * > Resource::allDistributionLists ( )
virtual

Returns a list of all distribution lists of this resource.

Definition at line 415 of file resource.cpp.

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::ResourceFile, KABC::ResourceNet, and KABC::ResourceDir.

Definition at line 433 of file resource.cpp.

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
ticketYou have to release the ticket later with releaseSaveTicket() explicitly.
Returns
Whether the saving was successfully.

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

Definition at line 445 of file resource.cpp.

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 242 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 234 of file resource.cpp.

void Resource::clear ( )
virtual

Removes all addressees and distribution lists from the resource.

Definition at line 354 of file resource.cpp.

Ticket * Resource::createTicket ( Resource *  resource)
protected

Factory method, just creates and returns a new Ticket for the given resource.

Needed by subclasses since the constructor of Ticket is private and only this base class is a friend, effectively limiting "new Ticket(this)" to resource implementations.

Definition at line 279 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 257 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 249 of file resource.cpp.

Addressee::List Resource::findByCategory ( const QString &  category)
virtual

Searches all addressees which belongs to the specified category.

Parameters
categoryThe category you are looking for.
Returns
A list of all matching addressees.

Definition at line 339 of file resource.cpp.

Addressee::List Resource::findByEmail ( const QString &  email)
virtual

Searches all addressees which match the specified email address.

Parameters
emailThe email address you are looking for.
Returns
A list of all matching addressees.

Definition at line 320 of file resource.cpp.

Addressee::List Resource::findByName ( const QString &  name)
virtual

Searches all addressees which match the specified name.

Parameters
nameThe name you are looking for.
Returns
A list of all matching addressees.

Definition at line 305 of file resource.cpp.

Addressee Resource::findByUid ( const QString &  uid)
virtual

Searches an addressee with the specified unique identifier.

Parameters
uidThe unique identifier you are looking for.
Returns
The addressee with the specified unique identifier or an empty addressee.

Definition at line 294 of file resource.cpp.

DistributionList * Resource::findDistributionListByIdentifier ( const QString &  identifier)
virtual

Returns a distribution list for the given identifier or 0.

Parameters
identifierThe ID of the list for look for.

Definition at line 385 of file resource.cpp.

DistributionList * Resource::findDistributionListByName ( const QString &  name,
Qt::CaseSensitivity  caseSensitivity = Qt::CaseSensitive 
)
virtual

Returns a distribution list with the given name or 0.

Parameters
nameThe localized name of the list for look for.
caseSensitivityWhether to do string matching case sensitive or case insensitive. Default is Qt::CaseSensitive

Definition at line 390 of file resource.cpp.

void Resource::insertAddressee ( const Addressee &  addr)
virtual

Insert an addressee into the resource.

Parameters
addrThe addressee to add

Definition at line 284 of file resource.cpp.

void Resource::insertDistributionList ( DistributionList *  list)
virtual

Adds a distribution list into this resource.

Parameters
listThe list to insert.

Definition at line 366 of file resource.cpp.

virtual bool KABC::Resource::load ( )
pure virtual

Loads all addressees synchronously.

Returns
Whether the loading was successfully.

Implemented in KABC::ResourceFile, KABC::ResourceNet, and KABC::ResourceDir.

void KABC::Resource::loadingError ( Resource *  resource,
const QString &  msg 
)
signal

This signal is emitted when an error occurred during loading the addressees from the backend to the internal cache.

Parameters
resourceThe pointer to the resource which emitted this signal.
msgA 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
resourceThe pointer to the resource which emitted this signal.
virtual void KABC::Resource::releaseSaveTicket ( Ticket *  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.

Parameters
ticketthe save ticket acquired with requestSaveTicket()

Implemented in KABC::ResourceFile, KABC::ResourceNet, and KABC::ResourceDir.

void Resource::removeAddressee ( const Addressee &  addr)
virtual

Removes an addressee from resource.

Parameters
addrThe addressee to remove

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

Definition at line 289 of file resource.cpp.

void Resource::removeDistributionList ( DistributionList *  list)
virtual

Removes a distribution list from this resource.

Parameters
listThe list to remove.

Definition at line 373 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::ResourceFile, KABC::ResourceNet, and KABC::ResourceDir.

virtual bool KABC::Resource::save ( Ticket *  ticket)
pure virtual

Saves all addressees synchronously.

Parameters
ticketYou have to release the ticket later with releaseSaveTicket() explicitly.
Returns
Whether the saving was successfully.

Implemented in KABC::ResourceFile, KABC::ResourceNet, and KABC::ResourceDir.

void KABC::Resource::savingError ( Resource *  resource,
const QString &  msg 
)
signal

This signal is emitted when an error occurred during saving the addressees from the internal cache to the backend.

Parameters
resourceThe pointer to the resource which emitted this signal.
msgA 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
resourceThe pointer to the resource which emitted this signal.
void Resource::setAddressBook ( AddressBook *  addr)

Sets the address book of the resource.

Parameters
addrThe address book to use

Definition at line 269 of file resource.cpp.

void Resource::writeConfig ( KConfigGroup &  group)
virtual

Writes the resource specific config to file.

Parameters
groupThe config section to write into

Reimplemented from KRES::Resource.

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

Definition at line 264 of file resource.cpp.

Member Data Documentation

Addressee::Map KABC::Resource::mAddrMap
protected

A mapping from KABC UIDs to the respective addressee.

Definition at line 527 of file resource.h.

DistributionListMap KABC::Resource::mDistListMap
protected

A mapping from unique identifiers to the respective distribution list.

Definition at line 532 of file resource.h.


The documentation for this class was generated from the following files:
  • resource.h
  • resource.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:01:06 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kabc

Skip menu "kabc"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • Related Pages

kdepimlibs API Reference

Skip menu "kdepimlibs API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kldap
  • kmbox
  • kmime
  • kpimidentities
  • kpimtextedit
  • kresources
  • ktnef
  • kxmlrpcclient
  • microblog

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal