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

kabc

  • sources
  • kde-4.12
  • kdepimlibs
  • 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 
29 namespace KABC {
30 
37 class 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 
64 class 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
179 
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::Ticket
Helper class for handling coordinated save of address books.
Definition: resource.h:37
KABC::Addressee::Map
QMap< QString, Addressee > Map
A map from unique identifier to addressee.
Definition: addressee.h:89
KRES::Resource
KABC::Addressee
address book entry
Definition: addressee.h:74
KABC::Resource
Definition: resource.h:64
KABC::Resource::mDistListMap
DistributionListMap mDistListMap
A mapping from unique identifiers to the respective distribution list.
Definition: resource.h:532
KABC::Resource::ConstIterator
Resource Const Iterator.
Definition: resource.h:165
KABC::Resource::mAddrMap
Addressee::Map mAddrMap
A mapping from KABC UIDs to the respective addressee.
Definition: resource.h:527
KABC::Addressee::List
AddresseeList List
A list of addressee objects.
Definition: addressee.h:83
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:01:05 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