addressbooksyncee.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
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
00114 };
00115
00116 AddressBookSyncee();
00117 AddressBookSyncee( KABC::AddressBook * );
00118 ~AddressBookSyncee();
00119
00120 void reset();
00121
00122 AddressBookSyncEntry *firstEntry();
00123 AddressBookSyncEntry *nextEntry();
00124
00125
00126
00127 void addEntry( SyncEntry * );
00128 void removeEntry( SyncEntry * );
00129
00130 SyncEntry::PtrList added();
00131 SyncEntry::PtrList modified();
00132 SyncEntry::PtrList removed();
00133
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
This file is part of the documentation for kitchensync Library Version 3.3.2.