summaryrefslogtreecommitdiffstats
path: root/common/synchronizer.h
diff options
context:
space:
mode:
Diffstat (limited to 'common/synchronizer.h')
-rw-r--r--common/synchronizer.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/common/synchronizer.h b/common/synchronizer.h
index 47518ee..0a51f54 100644
--- a/common/synchronizer.h
+++ b/common/synchronizer.h
@@ -27,6 +27,8 @@
27#include <messagequeue.h> 27#include <messagequeue.h>
28#include <storage.h> 28#include <storage.h>
29#include <storage/entitystore.h> 29#include <storage/entitystore.h>
30#include "changereplay.h"
31#include "remoteidmap.h"
30 32
31namespace Sink { 33namespace Sink {
32class RemoteIdMap; 34class RemoteIdMap;
@@ -34,8 +36,9 @@ class RemoteIdMap;
34/** 36/**
35 * Synchronize and add what we don't already have to local queue 37 * Synchronize and add what we don't already have to local queue
36 */ 38 */
37class SINK_EXPORT Synchronizer 39class SINK_EXPORT Synchronizer : public ChangeReplay
38{ 40{
41 Q_OBJECT
39public: 42public:
40 Synchronizer(const Sink::ResourceContext &resourceContext); 43 Synchronizer(const Sink::ResourceContext &resourceContext);
41 virtual ~Synchronizer(); 44 virtual ~Synchronizer();
@@ -53,6 +56,16 @@ public:
53 Sink::Storage::DataStore::Transaction &syncTransaction(); 56 Sink::Storage::DataStore::Transaction &syncTransaction();
54 57
55protected: 58protected:
59 ///Base implementation calls the replay$Type calls
60 virtual KAsync::Job<void> replay(const QByteArray &type, const QByteArray &key, const QByteArray &value) Q_DECL_OVERRIDE;
61 virtual bool canReplay(const QByteArray &type, const QByteArray &key, const QByteArray &value) Q_DECL_OVERRIDE;
62
63protected:
64 ///Implement to write back changes to the server
65 virtual KAsync::Job<QByteArray> replay(const Sink::ApplicationDomain::Mail &, Sink::Operation, const QByteArray &oldRemoteId, const QList<QByteArray> &);
66 virtual KAsync::Job<QByteArray> replay(const Sink::ApplicationDomain::Folder &, Sink::Operation, const QByteArray &oldRemoteId, const QList<QByteArray> &);
67
68protected:
56 ///Calls the callback to enqueue the command 69 ///Calls the callback to enqueue the command
57 void enqueueCommand(int commandId, const QByteArray &data); 70 void enqueueCommand(int commandId, const QByteArray &data);
58 71