00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef AKONADI_ITEMSYNC_H
00021 #define AKONADI_ITEMSYNC_H
00022
00023 #include "akonadi_export.h"
00024
00025 #include <akonadi/item.h>
00026 #include <akonadi/job.h>
00027
00028 namespace Akonadi {
00029
00030 class Collection;
00031 class ItemFetchScope;
00032
00053 class AKONADI_EXPORT ItemSync : public Job
00054 {
00055 Q_OBJECT
00056
00057 public:
00064 explicit ItemSync( const Collection &collection, QObject *parent = 0 );
00065
00069 ~ItemSync();
00070
00081 void setFullSyncItems( const Item::List &items );
00082
00089 void setTotalItems( int amount );
00090
00097 void setStreamingEnabled( bool enable );
00098
00103 void deliveryDone();
00104
00116 void setIncrementalSyncItems( const Item::List &changedItems,
00117 const Item::List &removedItems );
00118
00130 void setFetchScope( ItemFetchScope &fetchScope );
00131
00144 ItemFetchScope &fetchScope();
00145
00152 void rollback();
00153
00154 protected:
00155 void doStart();
00156 void slotResult( KJob* job );
00157
00164 virtual bool updateItem( const Item &storedItem, Item &newItem );
00165
00166 private:
00167
00168 class Private;
00169 Private* const d;
00170
00171 Q_PRIVATE_SLOT( d, void slotLocalListDone( KJob* ) )
00172 Q_PRIVATE_SLOT( d, void slotLocalDeleteDone( KJob* ) )
00173 Q_PRIVATE_SLOT( d, void slotLocalChangeDone( KJob* ) )
00174 Q_PRIVATE_SLOT( d, void slotTransactionResult( KJob* ) )
00175
00176 };
00177
00178 }
00179
00180 #endif