-rw-r--r-- | libkdepim/ksyncmanager.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libkdepim/ksyncmanager.h b/libkdepim/ksyncmanager.h index 2d0a4ab..6d89950 100644 --- a/libkdepim/ksyncmanager.h +++ b/libkdepim/ksyncmanager.h | |||
@@ -55,163 +55,167 @@ class KServerSocket : public QServerSocket | |||
55 | void endConnect(); | 55 | void endConnect(); |
56 | private slots: | 56 | private slots: |
57 | void discardClient(); | 57 | void discardClient(); |
58 | void readClient(); | 58 | void readClient(); |
59 | void readBackFileFromSocket(); | 59 | void readBackFileFromSocket(); |
60 | private : | 60 | private : |
61 | bool blockRC; | 61 | bool blockRC; |
62 | void send_file(); | 62 | void send_file(); |
63 | void get_file(); | 63 | void get_file(); |
64 | void end_connect(); | 64 | void end_connect(); |
65 | QDialog* mSyncActionDialog; | 65 | QDialog* mSyncActionDialog; |
66 | QSocket* mSocket; | 66 | QSocket* mSocket; |
67 | QString mPassWord; | 67 | QString mPassWord; |
68 | QString mFileName; | 68 | QString mFileName; |
69 | QTime piTime; | 69 | QTime piTime; |
70 | QString piFileString; | 70 | QString piFileString; |
71 | }; | 71 | }; |
72 | 72 | ||
73 | class KCommandSocket : public QObject | 73 | class KCommandSocket : public QObject |
74 | { | 74 | { |
75 | Q_OBJECT | 75 | Q_OBJECT |
76 | public: | 76 | public: |
77 | enum state { successR, errorR, successW, errorW, errorTO, quiet }; | 77 | enum state { successR, errorR, successW, errorW, errorTO, quiet }; |
78 | KCommandSocket ( QString password, Q_UINT16 port, QString host, QObject * parent=0, const char * name=0 ); | 78 | KCommandSocket ( QString password, Q_UINT16 port, QString host, QObject * parent=0, const char * name=0 ); |
79 | void readFile( QString ); | 79 | void readFile( QString ); |
80 | void writeFile( QString ); | 80 | void writeFile( QString ); |
81 | void sendStop(); | 81 | void sendStop(); |
82 | 82 | ||
83 | signals: | 83 | signals: |
84 | void commandFinished( KCommandSocket*, int ); | 84 | void commandFinished( KCommandSocket*, int ); |
85 | private slots: | 85 | private slots: |
86 | void startReadFileFromSocket(); | 86 | void startReadFileFromSocket(); |
87 | void readFileFromSocket(); | 87 | void readFileFromSocket(); |
88 | void deleteSocket(); | 88 | void deleteSocket(); |
89 | void writeFileToSocket(); | 89 | void writeFileToSocket(); |
90 | private : | 90 | private : |
91 | QSocket* mSocket; | 91 | QSocket* mSocket; |
92 | QString mPassWord; | 92 | QString mPassWord; |
93 | Q_UINT16 mPort; | 93 | Q_UINT16 mPort; |
94 | QString mHost; | 94 | QString mHost; |
95 | QString mFileName; | 95 | QString mFileName; |
96 | QTimer* mTimerSocket; | 96 | QTimer* mTimerSocket; |
97 | int mRetVal; | 97 | int mRetVal; |
98 | QTime mTime; | 98 | QTime mTime; |
99 | QString mFileString; | 99 | QString mFileString; |
100 | bool mFirst; | 100 | bool mFirst; |
101 | }; | 101 | }; |
102 | 102 | ||
103 | 103 | ||
104 | class KSyncManager : public QObject | 104 | class KSyncManager : public QObject |
105 | { | 105 | { |
106 | Q_OBJECT | 106 | Q_OBJECT |
107 | 107 | ||
108 | public: | 108 | public: |
109 | enum TargetApp { | 109 | enum TargetApp { |
110 | KOPI = 0, | 110 | KOPI = 0, |
111 | KAPI = 1, | 111 | KAPI = 1, |
112 | PWMPI = 2 }; | 112 | PWMPI = 2 }; |
113 | 113 | ||
114 | KSyncManager(QWidget* parent, KSyncInterface* implementation, TargetApp ta, KPimPrefs* prefs, QPopupMenu* syncmenu); | 114 | KSyncManager(QWidget* parent, KSyncInterface* implementation, TargetApp ta, KPimPrefs* prefs, QPopupMenu* syncmenu); |
115 | ~KSyncManager() ; | 115 | ~KSyncManager() ; |
116 | 116 | ||
117 | void multiSync( bool askforPrefs ); | 117 | void multiSync( bool askforPrefs ); |
118 | bool blockSave() { return mBlockSaveFlag; } | 118 | bool blockSave() { return mBlockSaveFlag; } |
119 | void setBlockSave(bool sa) { mBlockSaveFlag = sa; } | 119 | void setBlockSave(bool sa) { mBlockSaveFlag = sa; } |
120 | void setDefaultFileName( QString s) { mDefFileName = s ;} | 120 | void setDefaultFileName( QString s) { mDefFileName = s ;} |
121 | QString defaultFileName() { return mDefFileName ;} | 121 | QString defaultFileName() { return mDefFileName ;} |
122 | QString syncFileName(); | 122 | QString syncFileName(); |
123 | void enableQuick( bool ask = true); | 123 | void enableQuick( bool ask = true); |
124 | 124 | ||
125 | bool syncWithDesktop () { return mSyncWithDesktop;} | 125 | bool syncWithDesktop () { return mSyncWithDesktop;} |
126 | QString getCurrentSyncDevice() { return mCurrentSyncDevice; } | 126 | QString getCurrentSyncDevice() { return mCurrentSyncDevice; } |
127 | QString getCurrentSyncName() { return mCurrentSyncName; } | 127 | QString getCurrentSyncName() { return mCurrentSyncName; } |
128 | 128 | ||
129 | void showProgressBar(int percentage, QString caption = QString::null, int total=100); | 129 | void showProgressBar(int percentage, QString caption = QString::null, int total=100); |
130 | void hideProgressBar(); | 130 | void hideProgressBar(); |
131 | bool isProgressBarCanceled(); | 131 | bool isProgressBarCanceled(); |
132 | 132 | ||
133 | // sync stuff | 133 | // sync stuff |
134 | QString mLocalMachineName; | 134 | QString mLocalMachineName; |
135 | QStringList mExternSyncProfiles; | 135 | QStringList mExternSyncProfiles; |
136 | QStringList mSyncProfileNames; | 136 | QStringList mSyncProfileNames; |
137 | bool mAskForPreferences; | 137 | bool mAskForPreferences; |
138 | bool mShowSyncSummary; | 138 | bool mShowSyncSummary; |
139 | bool mIsKapiFile; | 139 | bool mIsKapiFile; |
140 | bool mWriteBackExistingOnly; | 140 | bool mWriteBackExistingOnly; |
141 | int mSyncAlgoPrefs; | 141 | int mSyncAlgoPrefs; |
142 | bool mWriteBackFile; | 142 | bool mWriteBackFile; |
143 | int mWriteBackInFuture; | 143 | int mWriteBackInFuture; |
144 | int mWriteBackInPast; | 144 | int mWriteBackInPast; |
145 | QString mPhoneDevice; | 145 | QString mPhoneDevice; |
146 | QString mPhoneConnection; | 146 | QString mPhoneConnection; |
147 | QString mPhoneModel; | 147 | QString mPhoneModel; |
148 | QString mPassWordPiSync; | 148 | QString mPassWordPiSync; |
149 | QString mActiveSyncPort; | 149 | QString mActiveSyncPort; |
150 | QString mActiveSyncIP ; | 150 | QString mActiveSyncIP ; |
151 | QString mFilterInCal; | ||
152 | QString mFilterOutCal; | ||
153 | QString mFilterInAB; | ||
154 | QString mFilterOutAB; | ||
151 | static QDateTime mRequestedSyncEvent; | 155 | static QDateTime mRequestedSyncEvent; |
152 | 156 | ||
153 | signals: | 157 | signals: |
154 | void save(); | 158 | void save(); |
155 | void request_file(); | 159 | void request_file(); |
156 | void getFile( bool ); | 160 | void getFile( bool ); |
157 | 161 | ||
158 | public slots: | 162 | public slots: |
159 | void slotSyncMenu( int ); | 163 | void slotSyncMenu( int ); |
160 | void slotClearMenu( int action ); | 164 | void slotClearMenu( int action ); |
161 | void deleteCommandSocket(KCommandSocket*s, int state); | 165 | void deleteCommandSocket(KCommandSocket*s, int state); |
162 | void readFileFromSocket(); | 166 | void readFileFromSocket(); |
163 | void fillSyncMenu(); | 167 | void fillSyncMenu(); |
164 | 168 | ||
165 | private: | 169 | private: |
166 | void syncPi(); | 170 | void syncPi(); |
167 | KServerSocket * mServerSocket; | 171 | KServerSocket * mServerSocket; |
168 | KPimPrefs* mPrefs; | 172 | KPimPrefs* mPrefs; |
169 | QString mDefFileName; | 173 | QString mDefFileName; |
170 | QString mCurrentSyncDevice; | 174 | QString mCurrentSyncDevice; |
171 | QString mCurrentSyncName; | 175 | QString mCurrentSyncName; |
172 | void quickSyncLocalFile(); | 176 | void quickSyncLocalFile(); |
173 | bool syncWithFile( QString fn , bool quick ); | 177 | bool syncWithFile( QString fn , bool quick ); |
174 | void syncLocalFile(); | 178 | void syncLocalFile(); |
175 | void syncPhone(); | 179 | void syncPhone(); |
176 | void syncSharp(); | 180 | void syncSharp(); |
177 | void syncKDE(); | 181 | void syncKDE(); |
178 | bool syncExternalApplication(QString); | 182 | bool syncExternalApplication(QString); |
179 | int mCurrentSyncProfile ; | 183 | int mCurrentSyncProfile ; |
180 | void syncRemote( KSyncProfile* prof, bool ask = true); | 184 | void syncRemote( KSyncProfile* prof, bool ask = true); |
181 | bool edit_sync_options(); | 185 | bool edit_sync_options(); |
182 | bool edit_pisync_options(); | 186 | bool edit_pisync_options(); |
183 | int ringSync(); | 187 | int ringSync(); |
184 | QString getPassword( ); | 188 | QString getPassword( ); |
185 | bool mPisyncFinished; | 189 | bool mPisyncFinished; |
186 | bool mBlockSaveFlag; | 190 | bool mBlockSaveFlag; |
187 | QWidget* mParent; | 191 | QWidget* mParent; |
188 | KSyncInterface* mImplementation; | 192 | KSyncInterface* mImplementation; |
189 | TargetApp mTargetApp; | 193 | TargetApp mTargetApp; |
190 | QPopupMenu* mSyncMenu; | 194 | QPopupMenu* mSyncMenu; |
191 | QProgressBar* bar; | 195 | QProgressBar* bar; |
192 | bool mSyncWithDesktop; | 196 | bool mSyncWithDesktop; |
193 | 197 | ||
194 | private slots: | 198 | private slots: |
195 | void confSync(); | 199 | void confSync(); |
196 | 200 | ||
197 | 201 | ||
198 | }; | 202 | }; |
199 | 203 | ||
200 | 204 | ||
201 | class KSyncInterface | 205 | class KSyncInterface |
202 | { | 206 | { |
203 | public : | 207 | public : |
204 | virtual void removeSyncInfo( QString syncProfile) = 0; | 208 | virtual void removeSyncInfo( QString syncProfile) = 0; |
205 | virtual bool sync(KSyncManager* manager, QString filename, int mode) = 0; | 209 | virtual bool sync(KSyncManager* manager, QString filename, int mode) = 0; |
206 | virtual bool syncExternal(KSyncManager* manager, QString resource) | 210 | virtual bool syncExternal(KSyncManager* manager, QString resource) |
207 | { | 211 | { |
208 | // empty implementation, because some syncable applications do not | 212 | // empty implementation, because some syncable applications do not |
209 | // have an external(sharpdtm) syncmode, like pwmanager. | 213 | // have an external(sharpdtm) syncmode, like pwmanager. |
210 | return false; | 214 | return false; |
211 | } | 215 | } |
212 | 216 | ||
213 | 217 | ||
214 | }; | 218 | }; |
215 | 219 | ||
216 | 220 | ||
217 | #endif | 221 | #endif |