kitchensync Library API Documentation

addressbooksyncee.h

00001 /*
00002     This file is part of KitchenSync.
00003 
00004     Copyright (c) 2002,2004 Cornelius Schumacher <schumacher@kde.org>
00005     Copyright (c) 2002 Holger Freyther <zecke@handhelds.org>
00006 
00007     This library is free software; you can redistribute it and/or
00008     modify it under the terms of the GNU Library General Public
00009     License as published by the Free Software Foundation; either
00010     version 2 of the License, or (at your option) any later version.
00011 
00012     This library is distributed in the hope that it will be useful,
00013     but WITHOUT ANY WARRANTY; without even the implied warranty of
00014     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015     Library General Public License for more details.
00016 
00017     You should have received a copy of the GNU Library General Public License
00018     along with this library; see the file COPYING.LIB.  If not, write to
00019     the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00020     Boston, MA 02111-1307, USA.
00021 */
00022 #ifndef KSYNC_ADDRESSBOOKSYNCEE_H
00023 #define KSYNC_ADDRESSBOOKSYNCEE_H
00024 
00025 #include "syncentry.h"
00026 #include "syncee.h"
00027 
00028 #include <kabc/addressbook.h>
00029 
00030 namespace KSync {
00031 
00032 class AddressBookSyncEntry : public SyncEntry
00033 {
00034   public:
00035     typedef QPtrList<AddressBookSyncEntry> PtrList;
00036 
00037     AddressBookSyncEntry( const KABC::Addressee &, Syncee *parent );
00038     AddressBookSyncEntry( const AddressBookSyncEntry & );
00039 
00040     QString name();
00041     QString id();
00042     void setId( const QString &id );
00043     QString timestamp();
00044     QString type() const;
00045     bool mergeWith( SyncEntry * );
00046 
00047     AddressBookSyncEntry *clone();
00048     bool equals( SyncEntry *entry );
00049 
00050     KABC::Addressee addressee() { return mAddressee; }
00051     QString resource() const;
00052     void setResource( const QString &str );
00053 
00054     KPIM::DiffAlgo* diffAlgo( SyncEntry*, SyncEntry* );
00055 
00056   private:
00057     KABC::Addressee mAddressee;
00058     QString m_res;
00059     struct Data;
00060     Data *data;
00061 };
00062 
00067 class AddressBookSyncee : public Syncee
00068 {
00069   public:
00070     enum Supports {
00071         FamilyName,
00072         GivenName,
00073         AdditionalName,
00074         Prefix,
00075         Suffix,
00076         NickName,
00077         Birthday,
00078         HomeAddress,
00079         BusinessAddress,
00080         TimeZone,
00081         Geo,
00082         Title,
00083         Role,
00084         Organization,
00085         Note,
00086         Url,
00087         Secrecy,
00088         Picture,
00089         Sound,
00090         Agent,
00091         HomeNumbers,
00092         OfficeNumbers,
00093         Messenger,
00094         PreferredNumber,
00095         Voice,
00096         Fax,
00097         Cell,
00098         Video,
00099         Mailbox,
00100         Modem,
00101         CarPhone,
00102         ISDN,
00103         PCS,
00104         Pager,
00105         HomeFax,
00106         WorkFax,
00107         OtherTel,
00108         Category,
00109         Custom,
00110         Keys,
00111         Logo,
00112         Email,
00113         Emails // more than one
00114     };
00115 
00116     AddressBookSyncee();
00117     AddressBookSyncee( KABC::AddressBook * );
00118     ~AddressBookSyncee();
00119 
00120     void reset();
00121 
00122     AddressBookSyncEntry *firstEntry();
00123     AddressBookSyncEntry *nextEntry();
00124 
00125 //    AddressBookSyncEntry *findEntry(const QString &id);
00126 
00127     void addEntry( SyncEntry * );
00128     void removeEntry( SyncEntry * );
00129 
00130     SyncEntry::PtrList added();
00131     SyncEntry::PtrList modified();
00132     SyncEntry::PtrList removed();
00133 //    Syncee *clone();
00134     QString type() const;
00135     QString newId() const;
00136 
00137     bool writeBackup( const QString & ) { return false; }
00138     bool restoreBackup( const QString & ) { return false; }
00139 
00140   private:
00141     AddressBookSyncEntry *createEntry( const KABC::Addressee & );
00142     SyncEntry::PtrList find( int state );
00143 
00144     QPtrList<AddressBookSyncEntry> mEntries;
00145 
00146     KABC::AddressBook *mAddressBook;
00147     bool mOwnAddressBook;
00148 };
00149 
00150 }
00151 
00152 #endif
KDE Logo
This file is part of the documentation for kitchensync Library Version 3.3.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Jan 31 15:53:45 2007 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003