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

tdeabc

  • tdeabc
addressbook.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_ADDRESSBOOK_H
22 #define KABC_ADDRESSBOOK_H
23 
24 #include <tqobject.h>
25 #include <tqptrlist.h>
26 
27 #include <tderesources/manager.h>
28 
29 #include "addressee.h"
30 #include "field.h"
31 
32 namespace TDEABC {
33 
34 class ErrorHandler;
35 class Resource;
36 class Ticket;
37 
43 class KABC_EXPORT AddressBook : public TQObject
44 {
45  TQ_OBJECT
46 
47  friend KABC_EXPORT TQDataStream &operator<<( TQDataStream &, const AddressBook & );
48  friend KABC_EXPORT TQDataStream &operator>>( TQDataStream &, AddressBook & );
49  friend class StdAddressBook;
50 
51  public:
57  class KABC_EXPORT Iterator
58  {
59  public:
60  Iterator();
61  Iterator( const Iterator & );
62  ~Iterator();
63 
64  Iterator &operator=( const Iterator & );
65  const Addressee &operator*() const;
66  Addressee &operator*();
67  Addressee* operator->();
68  Iterator &operator++();
69  Iterator &operator++(int);
70  Iterator &operator--();
71  Iterator &operator--(int);
72  bool operator==( const Iterator &it );
73  bool operator!=( const Iterator &it );
74 
75  struct IteratorData;
76  IteratorData *d;
77  };
78 
84  class KABC_EXPORT ConstIterator
85  {
86  public:
87  ConstIterator();
88  ConstIterator( const ConstIterator & );
89  ConstIterator( const Iterator & );
90  ~ConstIterator();
91 
92  ConstIterator &operator=( const ConstIterator & );
93  const Addressee &operator*() const;
94  const Addressee* operator->() const;
95  ConstIterator &operator++();
96  ConstIterator &operator++(int);
97  ConstIterator &operator--();
98  ConstIterator &operator--(int);
99  bool operator==( const ConstIterator &it );
100  bool operator!=( const ConstIterator &it );
101 
102  struct ConstIteratorData;
103  ConstIteratorData *d;
104  };
105 
110  AddressBook();
111 
118  AddressBook( const TQString &config );
119 
123  virtual ~AddressBook();
124 
136  Ticket *requestSaveTicket( Resource *resource = 0 );
137 
142  void releaseSaveTicket( Ticket *ticket );
143 
149  bool load();
150 
158  bool asyncLoad();
159 
167  bool save( Ticket *ticket );
168 
176  bool asyncSave( Ticket *ticket );
177 
182  ConstIterator begin() const;
183 
188  Iterator begin();
189 
194  ConstIterator end() const;
195 
200  Iterator end();
201 
202 
206  void clear();
207 
215  void insertAddressee( const Addressee &addr );
216 
222  void removeAddressee( const Addressee &addr );
223 
230  void removeAddressee( const Iterator &it );
231 
238  Iterator find( const Addressee &addr ); // KDE4: const
239 
247  Addressee findByUid( const TQString &uid ); // KDE4: const
248 
252  Addressee::List allAddressees(); // KDE4: const
253 
260  Addressee::List findByName( const TQString &name ); // KDE4: const
261 
268  Addressee::List findByEmail( const TQString &email ); // KDE4: const
269 
276  Addressee::List findByCategory( const TQString &category ); // KDE4: const
277 
282  virtual TQString identifier(); // KDE4: const
283 
288  Field::List fields( int category = Field::All ); // KDE4: const
289 
299  bool addCustomField( const TQString &label, int category = Field::All,
300  const TQString &key = TQString::null,
301  const TQString &app = TQString::null );
302 
309  bool addResource( Resource *resource );
310 
317  bool removeResource( Resource *resource );
318 
322  TQPtrList<Resource> resources(); // KDE4: const
323 
330  void setErrorHandler( ErrorHandler *errorHandler );
331 
337  void error( const TQString &msg );
338 
342  void cleanUp() TDE_DEPRECATED;
343 
348  void dump() const;
349 
352  void emitAddressBookLocked() { emit addressBookLocked( this ); }
353  void emitAddressBookUnlocked() { emit addressBookUnlocked( this ); }
354  void emitAddressBookChanged() { emit addressBookChanged( this ); }
355 
362  bool loadingHasFinished() const;
363 
364  signals:
373  void addressBookChanged( AddressBook *addressBook );
374 
380  void addressBookLocked( AddressBook *addressBook );
381 
390  void addressBookUnlocked( AddressBook *addressBook );
391 
398  void loadingFinished( Resource *resource );
399 
406  void savingFinished( Resource *resource );
407 
408  protected slots:
409  void resourceLoadingFinished( Resource* );
410  void resourceSavingFinished( Resource* );
411  void resourceLoadingError( Resource*, const TQString& );
412  void resourceSavingError( Resource*, const TQString& );
413 
414  protected:
415  void deleteRemovedAddressees();
416  void setStandardResource( Resource* );
417  Resource *standardResource();
418  KRES::Manager<Resource> *resourceManager();
419 
420  private:
421  TQPtrList<Resource> mDummy; // Remove in KDE 4
422  struct AddressBookData;
423  AddressBookData *d;
424 };
425 
426 KABC_EXPORT TQDataStream &operator<<( TQDataStream &, const AddressBook & );
427 KABC_EXPORT TQDataStream &operator>>( TQDataStream &, AddressBook & );
428 
429 }
430 
431 #endif
TDEABC::AddressBook::ConstIterator
Address Book Const Iterator.
Definition: addressbook.h:85
TDEABC::AddressBook::Iterator
Address Book Iterator.
Definition: addressbook.h:58
TDEABC::AddressBook
Address Book.
Definition: addressbook.h:44
TDEABC::AddressBook::addressBookUnlocked
void addressBookUnlocked(AddressBook *addressBook)
Emitted when one of the resources has been unlocked.
TDEABC::AddressBook::loadingFinished
void loadingFinished(Resource *resource)
Emitted when the asynchronous loading of one resource has finished after calling asyncLoad().
TDEABC::AddressBook::savingFinished
void savingFinished(Resource *resource)
Emitted when the asynchronous saving of one resource has finished after calling asyncSave().
TDEABC::AddressBook::addressBookLocked
void addressBookLocked(AddressBook *addressBook)
Emitted when one of the resources has been locked for writing.
TDEABC::AddressBook::addressBookChanged
void addressBookChanged(AddressBook *addressBook)
Emitted when one of the resources discovered a change in its backend or the asynchronous loading of a...
TDEABC::Addressee
address book entry
Definition: addressee.src.h:75
TDEABC::ErrorHandler
Abstract class that provides displaying of error messages.
Definition: errorhandler.h:41
TDEABC::StdAddressBook
Standard KDE address book.
Definition: stdaddressbook.h:57
TDEABC::Ticket
Helper class for handling coordinated save of address books.
Definition: resource.h:38
operator<<
kdbgstream & operator<<(const TQValueList< T > &list)
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.