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

kabc

  • kabc
resource.h
1/*
2 This file is part of libkabc.
3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
19*/
20
21#ifndef KABC_RESOURCE_H
22#define KABC_RESOURCE_H
23
24#include "addressbook.h"
25#include "distributionlist.h"
26#include "plugin.h"
27#include "kresources/resource.h"
28
29namespace KABC {
30
37class KABC_DEPRECATED_EXPORT Ticket
38{
39 friend class Resource;
40
41 public:
45 ~Ticket();
46
52 Resource *resource();
53
54 private:
55 Ticket( Resource *resource );
56
57 class Private;
58 Private *const d;
59};
60
64class KABC_DEPRECATED_EXPORT Resource : public KRES::Resource
65{
66 Q_OBJECT
67
68 public:
69
75 class ConstIterator;
76 class KABC_DEPRECATED_EXPORT Iterator
77 {
78 friend class KABC::Resource::ConstIterator;
79 friend class KABC::Resource;
80 public:
84 Iterator();
88 Iterator( const Iterator & );
89 virtual ~Iterator();
90
97 virtual Iterator &operator=( const Iterator & );
104 virtual const Addressee &operator*() const;
111 virtual Addressee &operator*();
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;
154
155 private:
156 class Private;
157 Private *const d;
158 };
159
165 class KABC_DEPRECATED_EXPORT ConstIterator
166 {
167 friend class KABC::Resource;
168
169 public:
173 ConstIterator();
177 ConstIterator( const ConstIterator & );
178#ifndef QT_STRICT_ITERATORS
183 ConstIterator( const Iterator & );
184#endif
185 virtual ~ConstIterator();
186
193 virtual ConstIterator &operator=( const ConstIterator & );
202 virtual const Addressee &operator*() const;
208 virtual ConstIterator &operator++();
215 virtual ConstIterator &operator++( int );
221 virtual ConstIterator &operator--();
228 virtual ConstIterator &operator--( int );
236 virtual bool operator==( const ConstIterator &it ) const;
244 virtual bool operator!=( const ConstIterator &it ) const;
245
246 private:
247 class Private;
248 Private *const d;
249 };
250
254 typedef Iterator iterator;
255
259 typedef ConstIterator const_iterator;
260
264 Resource();
265
272 Resource( const KConfigGroup &group );
273
277 virtual ~Resource();
278
283 virtual ConstIterator begin() const;
284 ConstIterator constBegin() const { return begin(); }
285
290 virtual Iterator begin();
291
296 virtual ConstIterator end() const;
297 ConstIterator constEnd() const { return end(); }
298
303 virtual Iterator end();
304
308 AddressBook *addressBook();
309
315 virtual void writeConfig( KConfigGroup &group );
316
322 virtual Ticket *requestSaveTicket() = 0;
323
331 virtual void releaseSaveTicket( Ticket *ticket ) = 0;
332
338 virtual bool load() = 0;
339
349 virtual bool asyncLoad();
350
356 virtual void insertAddressee( const Addressee &addr );
357
363 virtual void removeAddressee( const Addressee &addr );
364
372 virtual bool save( Ticket *ticket ) = 0;
373
385 virtual bool asyncSave( Ticket *ticket );
386
394 virtual Addressee findByUid( const QString &uid );
395
402 virtual Addressee::List findByName( const QString &name );
403
410 virtual Addressee::List findByEmail( const QString &email );
411
418 virtual Addressee::List findByCategory( const QString &category );
419
423 virtual void clear();
424
430 virtual void insertDistributionList( DistributionList *list );
431
437 virtual void removeDistributionList( DistributionList *list );
438
444 virtual DistributionList *findDistributionListByIdentifier( const QString &identifier );
445
453 virtual DistributionList *findDistributionListByName(
454 const QString &name,
455 Qt::CaseSensitivity caseSensitivity = Qt::CaseSensitive );
456
460 virtual QList<DistributionList*> allDistributionLists();
461
468 virtual QStringList allDistributionListNames() const;
469
477 void setAddressBook( AddressBook *addr );
478
479 Q_SIGNALS:
486 void loadingFinished( Resource *resource );
487
495 void loadingError( Resource *resource, const QString &msg );
496
503 void savingFinished( Resource *resource );
504
512 void savingError( Resource *resource, const QString &msg );
513
514 protected:
522 Ticket *createTicket( Resource * );
523
527 Addressee::Map mAddrMap;
528
532 DistributionListMap mDistListMap;
533
534 private:
535 class Private;
536 Private *const d;
537};
538
539}
540
541#endif
KABC::AddressBook
Address Book.
Definition: addressbook.h:47
KABC::AddresseeList
a QValueList of Addressee, with sorting functionality
Definition: addresseelist.h:289
KABC::Addressee
address book entry
Definition: addressee.h:79
KABC::Addressee::Map
QMap< QString, Addressee > Map
A map from unique identifier to addressee.
Definition: addressee.h:93
KABC::DistributionList
Distribution list of email addresses.
Definition: distributionlist.h:46
KABC::Resource::ConstIterator
Resource Const Iterator.
Definition: resource.h:166
KABC::Resource
Definition: resource.h:65
KABC::Resource::releaseSaveTicket
virtual void releaseSaveTicket(Ticket *ticket)=0
Releases the ticket previousely requested with requestSaveTicket().
KABC::Resource::save
virtual bool save(Ticket *ticket)=0
Saves all addressees synchronously.
KABC::Resource::savingFinished
void savingFinished(Resource *resource)
This signal is emitted when the resource has finished the saving of all addressees from the internal ...
KABC::Resource::load
virtual bool load()=0
Loads all addressees synchronously.
KABC::Resource::mAddrMap
Addressee::Map mAddrMap
A mapping from KABC UIDs to the respective addressee.
Definition: resource.h:527
KABC::Resource::savingError
void savingError(Resource *resource, const QString &msg)
This signal is emitted when an error occurred during saving the addressees from the internal cache to...
KABC::Resource::mDistListMap
DistributionListMap mDistListMap
A mapping from unique identifiers to the respective distribution list.
Definition: resource.h:532
KABC::Resource::requestSaveTicket
virtual Ticket * requestSaveTicket()=0
Request a ticket, you have to pass through save() to allow locking.
KABC::Resource::loadingError
void loadingError(Resource *resource, const QString &msg)
This signal is emitted when an error occurred during loading the addressees from the backend to the i...
KABC::Resource::loadingFinished
void loadingFinished(Resource *resource)
This signal is emitted when the resource has finished the loading of all addressees from the backend ...
KABC::Ticket
Helper class for handling coordinated save of address books.
Definition: resource.h:38
KRES::Resource
KABC
Class that holds a Calendar Url (FBURL/CALADRURI/CALURI)
Definition: address.h:29
KABC::DistributionListMap
QMap< QString, DistributionList * > DistributionListMap
Typedef for map from IDs to respective DistribtionList.
Definition: distributionlist.h:205
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Thu Jul 21 2022 00:00:00 by doxygen 1.9.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.14.10 API Reference

Skip menu "kdepimlibs-4.14.10 API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  • 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