author | zautrix <zautrix> | 2005-11-25 15:49:13 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-11-25 15:49:13 (UTC) |
commit | 794a5204686ad9bfc16172b01db35f1f3b7683e5 (patch) (unidiff) | |
tree | 29da2cb35a4d6a0cd6885436087fe0659b58a9f4 /libkdepim/ksyncmanager.h | |
parent | 90b62d1158d00f162a258541e24aaed4c967480b (diff) | |
download | kdepimpi-794a5204686ad9bfc16172b01db35f1f3b7683e5.zip kdepimpi-794a5204686ad9bfc16172b01db35f1f3b7683e5.tar.gz kdepimpi-794a5204686ad9bfc16172b01db35f1f3b7683e5.tar.bz2 |
sync
-rw-r--r-- | libkdepim/ksyncmanager.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libkdepim/ksyncmanager.h b/libkdepim/ksyncmanager.h index d3734da..f4654ce 100644 --- a/libkdepim/ksyncmanager.h +++ b/libkdepim/ksyncmanager.h | |||
@@ -52,81 +52,82 @@ class KServerSocket : public QServerSocket | |||
52 | void setFileName( QString fn ) {mFileName = fn;}; | 52 | void setFileName( QString fn ) {mFileName = fn;}; |
53 | signals: | 53 | signals: |
54 | void file_received( bool ); | 54 | void file_received( bool ); |
55 | void request_file(); | 55 | void request_file(); |
56 | void saveFile(); | 56 | void saveFile(); |
57 | void endConnect(); | 57 | void endConnect(); |
58 | private slots: | 58 | private slots: |
59 | void discardClient(); | 59 | void discardClient(); |
60 | void deleteSocket(); | 60 | void deleteSocket(); |
61 | void readClient(); | 61 | void readClient(); |
62 | void displayErrorMessage(); | 62 | void displayErrorMessage(); |
63 | void readBackFileFromSocket(); | 63 | void readBackFileFromSocket(); |
64 | private : | 64 | private : |
65 | int mErrorMessage; | 65 | int mErrorMessage; |
66 | bool blockRC; | 66 | bool blockRC; |
67 | void send_file(); | 67 | void send_file(); |
68 | void get_file(); | 68 | void get_file(); |
69 | void end_connect(); | 69 | void end_connect(); |
70 | void error_connect( QString ); | 70 | void error_connect( QString ); |
71 | QDialog* mSyncActionDialog; | 71 | QDialog* mSyncActionDialog; |
72 | QSocket* mSocket; | 72 | QSocket* mSocket; |
73 | QString mPassWord; | 73 | QString mPassWord; |
74 | QString mFileName; | 74 | QString mFileName; |
75 | QTime piTime; | 75 | QTime piTime; |
76 | QString piFileString; | 76 | QString piFileString; |
77 | }; | 77 | }; |
78 | 78 | ||
79 | class KCommandSocket : public QObject | 79 | class KCommandSocket : public QObject |
80 | { | 80 | { |
81 | Q_OBJECT | 81 | Q_OBJECT |
82 | public: | 82 | public: |
83 | enum state { successR, errorR, successW, errorW, errorTO, errorPW, errorCA, errorFI, errorUN, errorED,quiet }; | 83 | enum state { successR, errorR, successW, errorW, errorTO, errorPW, errorCA, errorFI, errorUN, errorED,quiet }; |
84 | KCommandSocket ( QString password, Q_UINT16 port, QString host, QObject * parent=0, QWidget* cap = 0, const char * name=0 ); | 84 | KCommandSocket (QString remoteResource, QString password, Q_UINT16 port, QString host, QObject * parent=0, QWidget* cap = 0, const char * name=0 ); |
85 | void readFile( QString ); | 85 | void readFile( QString ); |
86 | void writeFile( QString ); | 86 | void writeFile( QString ); |
87 | void sendStop(); | 87 | void sendStop(); |
88 | 88 | ||
89 | private slots : | 89 | private slots : |
90 | void sendFileRequest(); | 90 | void sendFileRequest(); |
91 | void updateConnectDialog(); | 91 | void updateConnectDialog(); |
92 | 92 | ||
93 | signals: | 93 | signals: |
94 | void commandFinished( KCommandSocket*, int ); | 94 | void commandFinished( KCommandSocket*, int ); |
95 | private slots: | 95 | private slots: |
96 | void startReadFileFromSocket(); | 96 | void startReadFileFromSocket(); |
97 | void readFileFromSocket(); | 97 | void readFileFromSocket(); |
98 | void deleteSocket(); | 98 | void deleteSocket(); |
99 | void writeFileToSocket(); | 99 | void writeFileToSocket(); |
100 | private : | 100 | private : |
101 | QString mRemoteResource; | ||
101 | int mConnectCount; | 102 | int mConnectCount; |
102 | int mConnectMax; | 103 | int mConnectMax; |
103 | KProgressDialog mConnectProgress; | 104 | KProgressDialog mConnectProgress; |
104 | QWidget* tlw; | 105 | QWidget* tlw; |
105 | QSocket* mSocket; | 106 | QSocket* mSocket; |
106 | QString mPassWord; | 107 | QString mPassWord; |
107 | Q_UINT16 mPort; | 108 | Q_UINT16 mPort; |
108 | QString mHost; | 109 | QString mHost; |
109 | QString mFileName; | 110 | QString mFileName; |
110 | QTimer* mTimerSocket; | 111 | QTimer* mTimerSocket; |
111 | int mRetVal; | 112 | int mRetVal; |
112 | QTime mTime; | 113 | QTime mTime; |
113 | QString mFileString; | 114 | QString mFileString; |
114 | bool mFirst; | 115 | bool mFirst; |
115 | bool mFirstLine; | 116 | bool mFirstLine; |
116 | }; | 117 | }; |
117 | 118 | ||
118 | 119 | ||
119 | class KSyncManager : public QObject | 120 | class KSyncManager : public QObject |
120 | { | 121 | { |
121 | Q_OBJECT | 122 | Q_OBJECT |
122 | 123 | ||
123 | public: | 124 | public: |
124 | enum TargetApp { | 125 | enum TargetApp { |
125 | KOPI = 0, | 126 | KOPI = 0, |
126 | KAPI = 1, | 127 | KAPI = 1, |
127 | PWMPI = 2 }; | 128 | PWMPI = 2 }; |
128 | 129 | ||
129 | KSyncManager(QWidget* parent, KSyncInterface* implementation, TargetApp ta, KPimPrefs* prefs, QPopupMenu* syncmenu); | 130 | KSyncManager(QWidget* parent, KSyncInterface* implementation, TargetApp ta, KPimPrefs* prefs, QPopupMenu* syncmenu); |
130 | ~KSyncManager() ; | 131 | ~KSyncManager() ; |
131 | 132 | ||
132 | void multiSync( bool askforPrefs ); | 133 | void multiSync( bool askforPrefs ); |
@@ -173,65 +174,68 @@ class KSyncManager : public QObject | |||
173 | void save(); | 174 | void save(); |
174 | void request_file(); | 175 | void request_file(); |
175 | void getFile( bool ); | 176 | void getFile( bool ); |
176 | 177 | ||
177 | public slots: | 178 | public slots: |
178 | void slotSyncMenu( int ); | 179 | void slotSyncMenu( int ); |
179 | void slotClearMenu( int action ); | 180 | void slotClearMenu( int action ); |
180 | void deleteCommandSocket(KCommandSocket*s, int state); | 181 | void deleteCommandSocket(KCommandSocket*s, int state); |
181 | void readFileFromSocket(); | 182 | void readFileFromSocket(); |
182 | void fillSyncMenu(); | 183 | void fillSyncMenu(); |
183 | 184 | ||
184 | private: | 185 | private: |
185 | void syncPi(); | 186 | void syncPi(); |
186 | KServerSocket * mServerSocket; | 187 | KServerSocket * mServerSocket; |
187 | KPimPrefs* mPrefs; | 188 | KPimPrefs* mPrefs; |
188 | QString mDefFileName; | 189 | QString mDefFileName; |
189 | QString mCurrentSyncDevice; | 190 | QString mCurrentSyncDevice; |
190 | QString mCurrentSyncName; | 191 | QString mCurrentSyncName; |
191 | void quickSyncLocalFile(); | 192 | void quickSyncLocalFile(); |
192 | bool syncWithFile( QString fn , bool quick ); | 193 | bool syncWithFile( QString fn , bool quick ); |
193 | void syncLocalFile(); | 194 | void syncLocalFile(); |
194 | void syncPhone(); | 195 | void syncPhone(); |
195 | void syncSharp(); | 196 | void syncSharp(); |
196 | void syncKDE(); | 197 | void syncKDE(); |
197 | bool syncExternalApplication(QString); | 198 | bool syncExternalApplication(QString); |
198 | int mCurrentSyncProfile ; | 199 | int mCurrentSyncProfile ; |
199 | void syncRemote( KSyncProfile* prof, bool ask = true); | 200 | void syncRemote( KSyncProfile* prof, bool ask = true); |
200 | bool edit_sync_options(); | 201 | bool edit_sync_options(); |
201 | bool edit_pisync_options(); | 202 | bool edit_pisync_options(); |
202 | int ringSync(); | 203 | int ringSync(); |
203 | QString getPassword( ); | 204 | QString getPassword( ); |
204 | bool mPisyncFinished; | 205 | bool mPisyncFinished; |
206 | QStringList mSpecificResources; | ||
207 | QString mCurrentResourceLocal; | ||
208 | QString mCurrentResourceRemote; | ||
205 | bool mBlockSaveFlag; | 209 | bool mBlockSaveFlag; |
206 | QWidget* mParent; | 210 | QWidget* mParent; |
207 | KSyncInterface* mImplementation; | 211 | KSyncInterface* mImplementation; |
208 | TargetApp mTargetApp; | 212 | TargetApp mTargetApp; |
209 | QPopupMenu* mSyncMenu; | 213 | QPopupMenu* mSyncMenu; |
210 | QProgressBar* bar; | 214 | QProgressBar* bar; |
211 | bool mSyncWithDesktop; | 215 | bool mSyncWithDesktop; |
212 | 216 | ||
213 | private slots: | 217 | private slots: |
214 | void displayErrorPort(); | 218 | void displayErrorPort(); |
215 | void confSync(); | 219 | void confSync(); |
216 | 220 | ||
217 | 221 | ||
218 | }; | 222 | }; |
219 | 223 | ||
220 | 224 | ||
221 | class KSyncInterface | 225 | class KSyncInterface |
222 | { | 226 | { |
223 | public : | 227 | public : |
224 | virtual void removeSyncInfo( QString syncProfile) = 0; | 228 | virtual void removeSyncInfo( QString syncProfile) = 0; |
225 | virtual bool sync(KSyncManager* manager, QString filename, int mode) = 0; | 229 | virtual bool sync(KSyncManager* manager, QString filename, int mode, QString resource) = 0; |
226 | virtual bool syncExternal(KSyncManager* manager, QString resource) | 230 | virtual bool syncExternal(KSyncManager* manager, QString resource) |
227 | { | 231 | { |
228 | // empty implementation, because some syncable applications do not | 232 | // empty implementation, because some syncable applications do not |
229 | // have an external(sharpdtm) syncmode, like pwmanager. | 233 | // have an external(sharpdtm) syncmode, like pwmanager. |
230 | return false; | 234 | return false; |
231 | } | 235 | } |
232 | 236 | ||
233 | 237 | ||
234 | }; | 238 | }; |
235 | 239 | ||
236 | 240 | ||
237 | #endif | 241 | #endif |