summaryrefslogtreecommitdiffabout
path: root/pwmanager/pwmanager/pwmdoc.h
Side-by-side diff
Diffstat (limited to 'pwmanager/pwmanager/pwmdoc.h') (more/less context) (ignore whitespace changes)
-rw-r--r--pwmanager/pwmanager/pwmdoc.h25
1 files changed, 24 insertions, 1 deletions
diff --git a/pwmanager/pwmanager/pwmdoc.h b/pwmanager/pwmanager/pwmdoc.h
index 193247e..ea4d687 100644
--- a/pwmanager/pwmanager/pwmdoc.h
+++ b/pwmanager/pwmanager/pwmdoc.h
@@ -59,6 +59,7 @@
#include "configuration.h"
#else
#include <kapplication.h>
+#include <ksyncmanager.h>
#endif
#include <string>
@@ -335,7 +336,10 @@ protected:
};
/** Document class for PwM */
-class PwMDoc : public PwMDocUi
+//US ENH: derived from KSyncInterfaces, to get called by PwM when a sync is required.
+// But PwMDoc is handling the sync by itself.
+class PwMDoc : public PwMDocUi, public KSyncInterface
+
{
Q_OBJECT
friend class DocTimer;
@@ -696,6 +700,25 @@ protected:
bool backupFile(const QString &filePath);
/** copy a file from src to dst */
bool copyFile(const QString &src, const QString &dst);
+
+
+ public:
+#ifdef PWM_EMBEDDED
+ //US ENH: this is the magic function that syncronizes the local doc with the remote doc.
+ PwMerror syncronize(KSyncManager* manager, PwMDoc* syncLocal, PwMDoc* syncRemote, int mode );
+
+
+ //the following methods are the overwritten callbackmethods from the syncinterface
+ virtual bool sync(KSyncManager* manager, QString filename, int mode);
+
+ //called by the syncmanager to indicate that the work has to be marked as dirty.
+ virtual void sync_setModified();
+ //called by the syncmanager to ask if the dirty flag is set.
+ virtual bool sync_isModified();
+ //called by the syncmanager to indicate that the work has to be saved.
+ virtual void sync_save();
+#endif
+
};
#endif