• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeabc
 

tdeabc

  • tdeabc
resource.h
1 /*
2  This file is part of libtdeabc.
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 <tderesources/resource.h>
25 
26 #include "addressbook.h"
27 #include "plugin.h"
28 
29 namespace TDEABC {
30 
37 class KABC_EXPORT Ticket
38 {
39  friend class Resource;
40 
41  public:
42  ~Ticket();
43 
44  Resource *resource();
45 
46  private:
47  Ticket( Resource *resource );
48 
49  Resource *mResource;
50 };
51 
55 class KABC_EXPORT Resource : public KRES::Resource
56 {
57  TQ_OBJECT
58 
59  public:
60 
68  class KABC_EXPORT Iterator
69  {
70  public:
71  Iterator();
72  Iterator( const Iterator & );
73  virtual ~Iterator();
74 
75  virtual Iterator &operator=( const Iterator & );
76  virtual const Addressee &operator*() const;
77  virtual Addressee &operator*();
78  virtual Iterator &operator++();
79  virtual Iterator &operator++( int );
80  virtual Iterator &operator--();
81  virtual Iterator &operator--( int );
82  virtual bool operator==( const Iterator &it );
83  virtual bool operator!=( const Iterator &it );
84 
85  struct IteratorData;
86  IteratorData *d;
87  };
88 
94  class KABC_EXPORT ConstIterator
95  {
96  public:
97  ConstIterator();
98  ConstIterator( const ConstIterator & );
99  ConstIterator( const Iterator & );
100  virtual ~ConstIterator();
101 
102  virtual ConstIterator &operator=( const ConstIterator & );
103  virtual const Addressee &operator*() const ;
104  virtual ConstIterator &operator++();
105  virtual ConstIterator &operator++( int );
106  virtual ConstIterator &operator--();
107  virtual ConstIterator &operator--( int );
108  virtual bool operator==( const ConstIterator &it );
109  virtual bool operator!=( const ConstIterator &it );
110 
111  struct ConstIteratorData;
112  ConstIteratorData *d;
113  };
114 
121  Resource( const TDEConfig *config );
122 
126  virtual ~Resource();
127 
132  virtual ConstIterator begin() const;
133 
138  virtual Iterator begin();
139 
144  virtual ConstIterator end() const;
145 
150  virtual Iterator end();
151 
155  AddressBook *addressBook();
156 
160  virtual void writeConfig( TDEConfig *config );
161 
167  virtual Ticket *requestSaveTicket() = 0;
168 
174  virtual void releaseSaveTicket( Ticket* ) = 0;
175 
181  virtual bool load() = 0;
182 
192  virtual bool asyncLoad();
193 
197  virtual void insertAddressee( const Addressee& );
198 
202  virtual void removeAddressee( const Addressee& addr );
203 
211  virtual bool save( Ticket *ticket ) = 0;
212 
224  virtual bool asyncSave( Ticket *ticket );
225 
233  virtual Addressee findByUid( const TQString &uid );
234 
241  virtual Addressee::List findByName( const TQString &name );
242 
249  virtual Addressee::List findByEmail( const TQString &email );
250 
257  virtual Addressee::List findByCategory( const TQString &category );
258 
262  virtual void clear();
263 
269  void setAddressBook( AddressBook* );
270 
271  signals:
278  void loadingFinished( Resource *resource );
279 
287  void loadingError( Resource *resource, const TQString &msg );
288 
295  void savingFinished( Resource *resource );
296 
304  void savingError( Resource *resource, const TQString &msg );
305 
306  protected:
307  Ticket *createTicket( Resource * );
308  Addressee::Map mAddrMap;
309 
310  private:
311  AddressBook *mAddressBook;
312 
313  class ResourcePrivate;
314  ResourcePrivate *d;
315 };
316 
317 }
318 
319 #endif
TDEABC::AddressBook
Address Book.
Definition: addressbook.h:44
TDEABC::Addressee
address book entry
Definition: addressee.src.h:75
TDEABC::Resource::ConstIterator
Resource Const Iterator.
Definition: resource.h:95
TDEABC::Resource::Iterator
Resource Iterator.
Definition: resource.h:69
TDEABC::Ticket
Helper class for handling coordinated save of address books.
Definition: resource.h:38
TDEConfig
TDEABC
static data, shared by ALL addressee objects
Definition: address.h:48

tdeabc

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

tdeabc

Skip menu "tdeabc"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeabc by doxygen 1.9.1
This website is maintained by Timothy Pearson.