summaryrefslogtreecommitdiffabout
path: root/libkdepim/ksyncmanager.h
authorulf69 <ulf69>2004-10-01 05:22:45 (UTC)
committer ulf69 <ulf69>2004-10-01 05:22:45 (UTC)
commitae6aaaf2ec81317d275ebaabba2de188279b58cd (patch) (side-by-side diff)
treef773df13a4e4f9fa5c6c54d01786e2de561ae661 /libkdepim/ksyncmanager.h
parent11c2acda0533e579512cf416de870328a79e66e8 (diff)
downloadkdepimpi-ae6aaaf2ec81317d275ebaabba2de188279b58cd.zip
kdepimpi-ae6aaaf2ec81317d275ebaabba2de188279b58cd.tar.gz
kdepimpi-ae6aaaf2ec81317d275ebaabba2de188279b58cd.tar.bz2
moved the global sync stuff from kabcore into a new class ksyncmanaager which
can be used from all types of applications, like kapi, kopi and pwmpi
Diffstat (limited to 'libkdepim/ksyncmanager.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/ksyncmanager.h79
1 files changed, 65 insertions, 14 deletions
diff --git a/libkdepim/ksyncmanager.h b/libkdepim/ksyncmanager.h
index d7c2a02..389a005 100644
--- a/libkdepim/ksyncmanager.h
+++ b/libkdepim/ksyncmanager.h
@@ -24,2 +24,3 @@ $Id$
+#include <qobject.h>
#include <qstring.h>
@@ -28,12 +29,12 @@ class QPopupMenu;
class KSyncProfile;
+class KPimPrefs;
+class QWidget;
+class KSyncManager;
+class KSyncInterface;
-
-
-class KSyncManager
+class KSyncManager : public QObject
{
-
- public:
- KSyncManager(TargetApp ta, QPopupMenu* syncmenu);
- ~KSyncManager() ;
+ Q_OBJECT
+ public:
enum TargetApp {
@@ -43,16 +44,49 @@ class KSyncManager
- private:
+
+ KSyncManager(QWidget* parent, KSyncInterface* implementation, TargetApp ta, KPimPrefs* prefs, QPopupMenu* syncmenu);
+ ~KSyncManager() ;
+
+ bool blockSave() { return mBlockSaveFlag; }
+ void setBlockSave(bool sa) { mBlockSaveFlag = sa; }
+
void fillSyncMenu();
- void syncLocalFile();
- bool syncWithFile( QString fn , bool quick );
+
+ QString getCurrentSyncDevice() { return mCurrentSyncDevice; }
+ QString getCurrentSyncName() { return mCurrentSyncName; }
+
+ public slots:
+ void slotSyncMenu( int );
+
+ private:
+ // LR *******************************
+ // sync stuff!
+ QString mCurrentSyncDevice;
+ QString mCurrentSyncName;
void quickSyncLocalFile();
+ bool syncWithFile( QString fn , bool quick );
+ void syncLocalFile();
+ void syncPhone();
+ void syncSharp();
+ bool syncExternalApplication(QString);
void multiSync( bool askforPrefs );
- int ringSync();
- void syncRemote( KSyncProfile* prof, bool ask);
+ int mCurrentSyncProfile ;
+ void syncRemote( KSyncProfile* prof, bool ask = true);
void edit_sync_options();
- QString getPassword();
+ int ringSync();
+ QString getPassword( );
+
+ private slots:
+ void confSync();
+ // *********************
private:
- QPopupMenu* mSyncMenu;
+ bool mBlockSaveFlag;
+
+
+ QWidget* mParent;
+ KSyncInterface* mImplementation;
TargetApp mTargetApp;
+ KPimPrefs* mPrefs;
+ QPopupMenu* mSyncMenu;
+
@@ -63,6 +97,23 @@ class KSyncManager
+};
+
+
+class KSyncInterface
+{
+ public:
+ virtual bool sync(KSyncManager* manager, QString filename, int mode) = 0;
+ virtual bool syncExternal(KSyncManager* manager, QString resource) = 0;
+ //called by the syncmanager to indicate that the work has to be marked as dirty.
+ virtual void sync_setModified() = 0;
+
+ //called by the syncmanager to ask if the dirty flag is set.
+ virtual bool sync_isModified() = 0;
+
+ //called by the syncmanager to indicate that the work has to be saved.
+ virtual void sync_save() = 0;
};
+
#endif