author | ulf69 <ulf69> | 2004-10-01 05:22:45 (UTC) |
---|---|---|
committer | ulf69 <ulf69> | 2004-10-01 05:22:45 (UTC) |
commit | ae6aaaf2ec81317d275ebaabba2de188279b58cd (patch) (unidiff) | |
tree | f773df13a4e4f9fa5c6c54d01786e2de561ae661 /libkdepim/ksyncmanager.h | |
parent | 11c2acda0533e579512cf416de870328a79e66e8 (diff) | |
download | kdepimpi-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
-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 | |||
@@ -24,2 +24,3 @@ $Id$ | |||
24 | 24 | ||
25 | #include <qobject.h> | ||
25 | #include <qstring.h> | 26 | #include <qstring.h> |
@@ -28,12 +29,12 @@ class QPopupMenu; | |||
28 | class KSyncProfile; | 29 | class KSyncProfile; |
30 | class KPimPrefs; | ||
31 | class QWidget; | ||
32 | class KSyncManager; | ||
33 | class KSyncInterface; | ||
29 | 34 | ||
30 | 35 | class KSyncManager : public QObject | |
31 | |||
32 | class KSyncManager | ||
33 | { | 36 | { |
34 | 37 | Q_OBJECT | |
35 | public: | ||
36 | KSyncManager(TargetApp ta, QPopupMenu* syncmenu); | ||
37 | ~KSyncManager() ; | ||
38 | 38 | ||
39 | public: | ||
39 | enum TargetApp { | 40 | enum TargetApp { |
@@ -43,16 +44,49 @@ class KSyncManager | |||
43 | 44 | ||
44 | private: | 45 | |
46 | KSyncManager(QWidget* parent, KSyncInterface* implementation, TargetApp ta, KPimPrefs* prefs, QPopupMenu* syncmenu); | ||
47 | ~KSyncManager() ; | ||
48 | |||
49 | bool blockSave() { return mBlockSaveFlag; } | ||
50 | void setBlockSave(bool sa) { mBlockSaveFlag = sa; } | ||
51 | |||
45 | void fillSyncMenu(); | 52 | void fillSyncMenu(); |
46 | void syncLocalFile(); | 53 | |
47 | bool syncWithFile( QString fn , bool quick ); | 54 | QString getCurrentSyncDevice() { return mCurrentSyncDevice; } |
55 | QString getCurrentSyncName() { return mCurrentSyncName; } | ||
56 | |||
57 | public slots: | ||
58 | void slotSyncMenu( int ); | ||
59 | |||
60 | private: | ||
61 | // LR ******************************* | ||
62 | // sync stuff! | ||
63 | QString mCurrentSyncDevice; | ||
64 | QString mCurrentSyncName; | ||
48 | void quickSyncLocalFile(); | 65 | void quickSyncLocalFile(); |
66 | bool syncWithFile( QString fn , bool quick ); | ||
67 | void syncLocalFile(); | ||
68 | void syncPhone(); | ||
69 | void syncSharp(); | ||
70 | bool syncExternalApplication(QString); | ||
49 | void multiSync( bool askforPrefs ); | 71 | void multiSync( bool askforPrefs ); |
50 | int ringSync(); | 72 | int mCurrentSyncProfile ; |
51 | void syncRemote( KSyncProfile* prof, bool ask); | 73 | void syncRemote( KSyncProfile* prof, bool ask = true); |
52 | void edit_sync_options(); | 74 | void edit_sync_options(); |
53 | QString getPassword(); | 75 | int ringSync(); |
76 | QString getPassword( ); | ||
77 | |||
78 | private slots: | ||
79 | void confSync(); | ||
80 | // ********************* | ||
54 | 81 | ||
55 | private: | 82 | private: |
56 | QPopupMenu* mSyncMenu; | 83 | bool mBlockSaveFlag; |
84 | |||
85 | |||
86 | QWidget* mParent; | ||
87 | KSyncInterface* mImplementation; | ||
57 | TargetApp mTargetApp; | 88 | TargetApp mTargetApp; |
89 | KPimPrefs* mPrefs; | ||
90 | QPopupMenu* mSyncMenu; | ||
91 | |||
58 | 92 | ||
@@ -63,6 +97,23 @@ class KSyncManager | |||
63 | 97 | ||
98 | }; | ||
99 | |||
100 | |||
101 | class KSyncInterface | ||
102 | { | ||
103 | public: | ||
104 | virtual bool sync(KSyncManager* manager, QString filename, int mode) = 0; | ||
105 | virtual bool syncExternal(KSyncManager* manager, QString resource) = 0; | ||
64 | 106 | ||
65 | 107 | ||
108 | //called by the syncmanager to indicate that the work has to be marked as dirty. | ||
109 | virtual void sync_setModified() = 0; | ||
110 | |||
111 | //called by the syncmanager to ask if the dirty flag is set. | ||
112 | virtual bool sync_isModified() = 0; | ||
113 | |||
114 | //called by the syncmanager to indicate that the work has to be saved. | ||
115 | virtual void sync_save() = 0; | ||
66 | }; | 116 | }; |
67 | 117 | ||
118 | |||
68 | #endif | 119 | #endif |