-rw-r--r-- | libkdepim/ksyncmanager.h | 79 |
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 @@ -23,18 +23,19 @@ $Id$ #define _KSYNCMANAGER_H +#include <qobject.h> #include <qstring.h> 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 { KOPI = 0, @@ -42,18 +43,51 @@ class KSyncManager PWMPI = 2 }; - 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; + @@ -62,7 +96,24 @@ 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 |