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

kabc

  • KABC
  • Resource
Classes | Signals | Public Member Functions | Protected Member Functions | Protected Attributes
KABC::Resource Class Reference

#include <resource.h>

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

List of all members.

Classes

class  ConstIterator
 Resource Const Iterator. More...

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)

Protected Member Functions

Ticket * createTicket (Resource *)

Protected Attributes

Addressee::Map mAddrMap
DistributionListMap mDistListMap

Detailed Description


Constructor & Destructor Documentation

Resource::Resource ( )

Default constructor.

Reimplemented from Resource.

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.

Reimplemented from Resource.

Definition at line 223 of file resource.cpp.

Resource::~Resource ( ) [virtual]

Destructor.

Reimplemented from 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 417 of file resource.cpp.

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

Returns a list of all distribution lists of this resource.

Definition at line 412 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 430 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 442 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 351 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 337 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 319 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 382 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 387 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 363 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 370 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 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-2012 The KDE developers.
Generated on Mon Aug 27 2012 22:10:25 by doxygen 1.7.5 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-4.8.5 API Reference

Skip menu "kdepimlibs-4.8.5 API Reference"
  • akonadi
  •   contact
  •   kmime
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  •   richtextbuilders
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
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