kabc
resource.h
00001 /* 00002 This file is part of libkabc. 00003 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Library General Public 00007 License as published by the Free Software Foundation; either 00008 version 2 of the License, or (at your option) any later version. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Library General Public License for more details. 00014 00015 You should have received a copy of the GNU Library General Public License 00016 along with this library; see the file COPYING.LIB. If not, write to 00017 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00018 Boston, MA 02110-1301, USA. 00019 */ 00020 00021 #ifndef KABC_RESOURCE_H 00022 #define KABC_RESOURCE_H 00023 00024 #include "addressbook.h" 00025 #include "distributionlist.h" 00026 #include "plugin.h" 00027 #include "kresources/resource.h" 00028 00029 namespace KABC { 00030 00037 class KABC_EXPORT_DEPRECATED Ticket 00038 { 00039 friend class Resource; 00040 00041 public: 00045 ~Ticket(); 00046 00052 Resource *resource(); 00053 00054 private: 00055 Ticket( Resource *resource ); 00056 00057 class Private; 00058 Private *const d; 00059 }; 00060 00064 class KABC_EXPORT_DEPRECATED Resource : public KRES::Resource 00065 { 00066 Q_OBJECT 00067 00068 public: 00069 00075 class ConstIterator; 00076 class KABC_EXPORT_DEPRECATED Iterator 00077 { 00078 friend class KABC::Resource::ConstIterator; 00079 friend class KABC::Resource; 00080 public: 00084 Iterator(); 00088 Iterator( const Iterator & ); 00089 virtual ~Iterator(); 00090 00097 virtual Iterator &operator=( const Iterator & ); 00104 virtual const Addressee &operator*() const; 00111 virtual Addressee &operator*(); 00117 virtual Iterator &operator++(); 00124 virtual Iterator &operator++( int ); 00130 virtual Iterator &operator--(); 00137 virtual Iterator &operator--( int ); 00145 virtual bool operator==( const Iterator &it ) const; 00153 virtual bool operator!=( const Iterator &it ) const; 00154 00155 private: 00156 class Private; 00157 Private *const d; 00158 }; 00159 00165 class KABC_EXPORT_DEPRECATED ConstIterator 00166 { 00167 friend class KABC::Resource; 00168 00169 public: 00173 ConstIterator(); 00177 ConstIterator( const ConstIterator & ); 00178 #ifndef QT_STRICT_ITERATORS 00179 00183 ConstIterator( const Iterator & ); 00184 #endif 00185 virtual ~ConstIterator(); 00186 00193 virtual ConstIterator &operator=( const ConstIterator & ); 00202 virtual const Addressee &operator*() const; 00208 virtual ConstIterator &operator++(); 00215 virtual ConstIterator &operator++( int ); 00221 virtual ConstIterator &operator--(); 00228 virtual ConstIterator &operator--( int ); 00236 virtual bool operator==( const ConstIterator &it ) const; 00244 virtual bool operator!=( const ConstIterator &it ) const; 00245 00246 private: 00247 class Private; 00248 Private *const d; 00249 }; 00250 00254 typedef Iterator iterator; 00255 00259 typedef ConstIterator const_iterator; 00260 00264 Resource(); 00265 00272 Resource( const KConfigGroup &group ); 00273 00277 virtual ~Resource(); 00278 00283 virtual ConstIterator begin() const; 00284 ConstIterator constBegin() const { return begin(); } 00285 00290 virtual Iterator begin(); 00291 00296 virtual ConstIterator end() const; 00297 ConstIterator constEnd() const { return end(); } 00298 00303 virtual Iterator end(); 00304 00308 AddressBook *addressBook(); 00309 00315 virtual void writeConfig( KConfigGroup &group ); 00316 00322 virtual Ticket *requestSaveTicket() = 0; 00323 00331 virtual void releaseSaveTicket( Ticket *ticket ) = 0; 00332 00338 virtual bool load() = 0; 00339 00349 virtual bool asyncLoad(); 00350 00356 virtual void insertAddressee( const Addressee &addr ); 00357 00363 virtual void removeAddressee( const Addressee &addr ); 00364 00372 virtual bool save( Ticket *ticket ) = 0; 00373 00385 virtual bool asyncSave( Ticket *ticket ); 00386 00394 virtual Addressee findByUid( const QString &uid ); 00395 00402 virtual Addressee::List findByName( const QString &name ); 00403 00410 virtual Addressee::List findByEmail( const QString &email ); 00411 00418 virtual Addressee::List findByCategory( const QString &category ); 00419 00423 virtual void clear(); 00424 00430 virtual void insertDistributionList( DistributionList *list ); 00431 00437 virtual void removeDistributionList( DistributionList *list ); 00438 00444 virtual DistributionList *findDistributionListByIdentifier( const QString &identifier ); 00445 00453 virtual DistributionList *findDistributionListByName( 00454 const QString &name, 00455 Qt::CaseSensitivity caseSensitivity = Qt::CaseSensitive ); 00456 00460 virtual QList<DistributionList*> allDistributionLists(); 00461 00468 virtual QStringList allDistributionListNames() const; 00469 00477 void setAddressBook( AddressBook *addr ); 00478 00479 Q_SIGNALS: 00486 void loadingFinished( Resource *resource ); 00487 00495 void loadingError( Resource *resource, const QString &msg ); 00496 00503 void savingFinished( Resource *resource ); 00504 00512 void savingError( Resource *resource, const QString &msg ); 00513 00514 protected: 00522 Ticket *createTicket( Resource * ); 00523 00527 Addressee::Map mAddrMap; 00528 00532 DistributionListMap mDistListMap; 00533 00534 private: 00535 class Private; 00536 Private *const d; 00537 }; 00538 00539 } 00540 00541 #endif
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Thu Aug 2 2012 15:26:07 by doxygen 1.7.5 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2012 The KDE developers.
Generated on Thu Aug 2 2012 15:26:07 by doxygen 1.7.5 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.