• Skip to content
  • Skip to link menu
KDE 4.1 API Reference
  • KDE API Reference
  • KDE-PIM Libraries
  • Sitemap
  • Contact Us
 

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 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 Resource : public KRES::Resource
00065 {
00066   Q_OBJECT
00067 
00068   public:
00069 
00075     class ConstIterator;
00076     class KABC_EXPORT 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 ConstIterator
00166     {
00167       friend class KABC::Resource;
00168 
00169       public:
00173         ConstIterator();
00177         ConstIterator( const ConstIterator & );
00182         ConstIterator( const Iterator & );
00183         virtual ~ConstIterator();
00184 
00191         virtual ConstIterator &operator=( const ConstIterator & );
00200         virtual const Addressee &operator*() const;
00206         virtual ConstIterator &operator++();
00213         virtual ConstIterator &operator++( int );
00219         virtual ConstIterator &operator--();
00226         virtual ConstIterator &operator--( int );
00234         virtual bool operator==( const ConstIterator &it ) const;
00242         virtual bool operator!=( const ConstIterator &it ) const;
00243 
00244       private:
00245         class Private;
00246         Private *const d;
00247     };
00248 
00252     typedef Iterator iterator;
00253 
00257     typedef ConstIterator const_iterator;
00258 
00262     Resource();
00263 
00270     Resource( const KConfigGroup &group );
00271 
00275     virtual ~Resource();
00276 
00281     virtual ConstIterator begin() const;
00282 
00287     virtual Iterator begin();
00288 
00293     virtual ConstIterator end() const;
00294 
00299     virtual Iterator end();
00300 
00304     AddressBook *addressBook();
00305 
00311     virtual void writeConfig( KConfigGroup &group );
00312 
00318     virtual Ticket *requestSaveTicket() = 0;
00319 
00327     virtual void releaseSaveTicket( Ticket *ticket ) = 0;
00328 
00334     virtual bool load() = 0;
00335 
00345     virtual bool asyncLoad();
00346 
00352     virtual void insertAddressee( const Addressee &addr );
00353 
00359     virtual void removeAddressee( const Addressee &addr );
00360 
00368     virtual bool save( Ticket *ticket ) = 0;
00369 
00381     virtual bool asyncSave( Ticket *ticket );
00382 
00390     virtual Addressee findByUid( const QString &uid );
00391 
00398     virtual Addressee::List findByName( const QString &name );
00399 
00406     virtual Addressee::List findByEmail( const QString &email );
00407 
00414     virtual Addressee::List findByCategory( const QString &category );
00415 
00419     virtual void clear();
00420 
00426     virtual void insertDistributionList( DistributionList *list );
00427 
00433     virtual void removeDistributionList( DistributionList *list );
00434 
00440     virtual DistributionList *findDistributionListByIdentifier( const QString &identifier );
00441 
00449     virtual DistributionList *findDistributionListByName(
00450       const QString &name,
00451       Qt::CaseSensitivity caseSensitivity = Qt::CaseSensitive );
00452 
00456     virtual QList<DistributionList*> allDistributionLists();
00457 
00464     virtual QStringList allDistributionListNames() const;
00465 
00473     void setAddressBook( AddressBook *addr );
00474 
00475   Q_SIGNALS:
00482     void loadingFinished( Resource *resource );
00483 
00491     void loadingError( Resource *resource, const QString &msg );
00492 
00499     void savingFinished( Resource *resource );
00500 
00508     void savingError( Resource *resource, const QString &msg );
00509 
00510   protected:
00518     Ticket *createTicket( Resource * );
00519 
00523     Addressee::Map mAddrMap;
00524 
00528     DistributionListMap mDistListMap;
00529 
00530   private:
00531     class Private;
00532     Private *const d;
00533 };
00534 
00535 }
00536 
00537 #endif

kabc

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

KDE-PIM Libraries

Skip menu "KDE-PIM Libraries"
  • akonadi
  • kabc
  • kblog
  • kcal
  • kimap
  • kioslave
  •   imap4
  •   mbox
  • kldap
  • kmime
  • kpimidentities
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Generated for KDE-PIM Libraries by doxygen 1.5.6
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal