21 #ifndef KABC_RESOURCE_H
22 #define KABC_RESOURCE_H
24 #include "addressbook.h"
25 #include "distributionlist.h"
27 #include "kresources/resource.h"
76 class KABC_DEPRECATED_EXPORT Iterator
88 Iterator(
const Iterator & );
97 virtual Iterator &operator=(
const Iterator & );
104 virtual const Addressee &operator*()
const;
117 virtual Iterator &operator++();
124 virtual Iterator &operator++(
int );
130 virtual Iterator &operator--();
137 virtual Iterator &operator--(
int );
145 virtual bool operator==(
const Iterator &it )
const;
153 virtual bool operator!=(
const Iterator &it )
const;
178 #ifndef QT_STRICT_ITERATORS
202 virtual const Addressee &operator*()
const;
254 typedef Iterator iterator;
272 Resource(
const KConfigGroup &group );
290 virtual Iterator begin();
296 virtual ConstIterator end()
const;
297 ConstIterator constEnd()
const {
return end(); }
303 virtual Iterator end();
308 AddressBook *addressBook();
315 virtual void writeConfig( KConfigGroup &group );
322 virtual Ticket *requestSaveTicket() = 0;
331 virtual void releaseSaveTicket( Ticket *ticket ) = 0;
338 virtual bool load() = 0;
349 virtual bool asyncLoad();
356 virtual void insertAddressee(
const Addressee &addr );
363 virtual void removeAddressee(
const Addressee &addr );
372 virtual bool save( Ticket *ticket ) = 0;
385 virtual bool asyncSave( Ticket *ticket );
394 virtual Addressee findByUid(
const QString &uid );
423 virtual void clear();
430 virtual void insertDistributionList( DistributionList *list );
437 virtual void removeDistributionList( DistributionList *list );
444 virtual DistributionList *findDistributionListByIdentifier(
const QString &identifier );
453 virtual DistributionList *findDistributionListByName(
455 Qt::CaseSensitivity caseSensitivity = Qt::CaseSensitive );
468 virtual QStringList allDistributionListNames()
const;
477 void setAddressBook( AddressBook *addr );
486 void loadingFinished( Resource *resource );
495 void loadingError( Resource *resource,
const QString &msg );
503 void savingFinished( Resource *resource );
512 void savingError( Resource *resource,
const QString &msg );
522 Ticket *createTicket( Resource * );
Helper class for handling coordinated save of address books.
DistributionListMap mDistListMap
A mapping from unique identifiers to the respective distribution list.
Addressee::Map mAddrMap
A mapping from KABC UIDs to the respective addressee.
AddresseeList List
A list of addressee objects.