-rw-r--r-- | libkdepim/ksyncmanager.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libkdepim/ksyncmanager.h b/libkdepim/ksyncmanager.h index 810a515..bd3ecdc 100644 --- a/libkdepim/ksyncmanager.h +++ b/libkdepim/ksyncmanager.h | |||
@@ -10,117 +10,120 @@ | |||
10 | This library is distributed in the hope that it will be useful, | 10 | This library is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Library General Public License for more details. | 13 | Library General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Library General Public License | 15 | You should have received a copy of the GNU Library General Public License |
16 | along with this library; see the file COPYING.LIB. If not, write to | 16 | along with this library; see the file COPYING.LIB. If not, write to |
17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
18 | Boston, MA 02111-1307, USA. | 18 | Boston, MA 02111-1307, USA. |
19 | 19 | ||
20 | $Id$ | 20 | $Id$ |
21 | */ | 21 | */ |
22 | #ifndef _KSYNCMANAGER_H | 22 | #ifndef _KSYNCMANAGER_H |
23 | #define _KSYNCMANAGER_H | 23 | #define _KSYNCMANAGER_H |
24 | 24 | ||
25 | #include <qobject.h> | 25 | #include <qobject.h> |
26 | #include <qstring.h> | 26 | #include <qstring.h> |
27 | #include <qsocket.h> | 27 | #include <qsocket.h> |
28 | #include <qdatetime.h> | 28 | #include <qdatetime.h> |
29 | #include <qserversocket.h> | 29 | #include <qserversocket.h> |
30 | #include <qtextstream.h> | 30 | #include <qtextstream.h> |
31 | #include <qregexp.h> | 31 | #include <qregexp.h> |
32 | 32 | ||
33 | class QPopupMenu; | 33 | class QPopupMenu; |
34 | class KSyncProfile; | 34 | class KSyncProfile; |
35 | class KPimPrefs; | 35 | class KPimPrefs; |
36 | class QWidget; | 36 | class QWidget; |
37 | class KSyncManager; | 37 | class KSyncManager; |
38 | class KSyncInterface; | 38 | class KSyncInterface; |
39 | class QProgressBar; | 39 | class QProgressBar; |
40 | 40 | ||
41 | 41 | ||
42 | class KServerSocket : public QServerSocket | 42 | class KServerSocket : public QServerSocket |
43 | { | 43 | { |
44 | Q_OBJECT | 44 | Q_OBJECT |
45 | 45 | ||
46 | public: | 46 | public: |
47 | KServerSocket ( QString password, Q_UINT16 port, int backlog = 0, QObject * parent=0, const char * name=0 ); | 47 | KServerSocket ( QString password, Q_UINT16 port, int backlog = 0, QObject * parent=0, const char * name=0 ); |
48 | 48 | ||
49 | void newConnection ( int socket ) ; | 49 | void newConnection ( int socket ) ; |
50 | void setFileName( QString fn ) {mFileName = fn;}; | 50 | void setFileName( QString fn ) {mFileName = fn;}; |
51 | signals: | 51 | signals: |
52 | void file_received( bool ); | 52 | void file_received( bool ); |
53 | void request_file(); | 53 | void request_file(); |
54 | void saveFile(); | 54 | void saveFile(); |
55 | void endConnect(); | 55 | void endConnect(); |
56 | private slots: | 56 | private slots: |
57 | void discardClient(); | 57 | void discardClient(); |
58 | void deleteSocket(); | ||
58 | void readClient(); | 59 | void readClient(); |
60 | void displayErrorMessage(); | ||
59 | void readBackFileFromSocket(); | 61 | void readBackFileFromSocket(); |
60 | private : | 62 | private : |
63 | int mErrorMessage; | ||
61 | bool blockRC; | 64 | bool blockRC; |
62 | void send_file(); | 65 | void send_file(); |
63 | void get_file(); | 66 | void get_file(); |
64 | void end_connect(); | 67 | void end_connect(); |
65 | void error_connect(); | 68 | void error_connect( QString ); |
66 | QDialog* mSyncActionDialog; | 69 | QDialog* mSyncActionDialog; |
67 | QSocket* mSocket; | 70 | QSocket* mSocket; |
68 | QString mPassWord; | 71 | QString mPassWord; |
69 | QString mFileName; | 72 | QString mFileName; |
70 | QTime piTime; | 73 | QTime piTime; |
71 | QString piFileString; | 74 | QString piFileString; |
72 | }; | 75 | }; |
73 | 76 | ||
74 | class KCommandSocket : public QObject | 77 | class KCommandSocket : public QObject |
75 | { | 78 | { |
76 | Q_OBJECT | 79 | Q_OBJECT |
77 | public: | 80 | public: |
78 | enum state { successR, errorR, successW, errorW, errorTO, errorPW,quiet }; | 81 | enum state { successR, errorR, successW, errorW, errorTO, errorPW, errorCA, errorFI, errorUN,quiet }; |
79 | KCommandSocket ( QString password, Q_UINT16 port, QString host, QObject * parent=0, QWidget* cap = 0, const char * name=0 ); | 82 | KCommandSocket ( QString password, Q_UINT16 port, QString host, QObject * parent=0, QWidget* cap = 0, const char * name=0 ); |
80 | void readFile( QString ); | 83 | void readFile( QString ); |
81 | void writeFile( QString ); | 84 | void writeFile( QString ); |
82 | void sendStop(); | 85 | void sendStop(); |
83 | 86 | ||
84 | private slots : | 87 | private slots : |
85 | void sendFileRequest(); | 88 | void sendFileRequest(); |
86 | 89 | ||
87 | signals: | 90 | signals: |
88 | void commandFinished( KCommandSocket*, int ); | 91 | void commandFinished( KCommandSocket*, int ); |
89 | private slots: | 92 | private slots: |
90 | void startReadFileFromSocket(); | 93 | void startReadFileFromSocket(); |
91 | void readFileFromSocket(); | 94 | void readFileFromSocket(); |
92 | void deleteSocket(); | 95 | void deleteSocket(); |
93 | void writeFileToSocket(); | 96 | void writeFileToSocket(); |
94 | private : | 97 | private : |
95 | QWidget* tlw; | 98 | QWidget* tlw; |
96 | QSocket* mSocket; | 99 | QSocket* mSocket; |
97 | QString mPassWord; | 100 | QString mPassWord; |
98 | Q_UINT16 mPort; | 101 | Q_UINT16 mPort; |
99 | QString mHost; | 102 | QString mHost; |
100 | QString mFileName; | 103 | QString mFileName; |
101 | QTimer* mTimerSocket; | 104 | QTimer* mTimerSocket; |
102 | int mRetVal; | 105 | int mRetVal; |
103 | QTime mTime; | 106 | QTime mTime; |
104 | QString mFileString; | 107 | QString mFileString; |
105 | bool mFirst; | 108 | bool mFirst; |
106 | bool mFirstLine; | 109 | bool mFirstLine; |
107 | }; | 110 | }; |
108 | 111 | ||
109 | 112 | ||
110 | class KSyncManager : public QObject | 113 | class KSyncManager : public QObject |
111 | { | 114 | { |
112 | Q_OBJECT | 115 | Q_OBJECT |
113 | 116 | ||
114 | public: | 117 | public: |
115 | enum TargetApp { | 118 | enum TargetApp { |
116 | KOPI = 0, | 119 | KOPI = 0, |
117 | KAPI = 1, | 120 | KAPI = 1, |
118 | PWMPI = 2 }; | 121 | PWMPI = 2 }; |
119 | 122 | ||
120 | KSyncManager(QWidget* parent, KSyncInterface* implementation, TargetApp ta, KPimPrefs* prefs, QPopupMenu* syncmenu); | 123 | KSyncManager(QWidget* parent, KSyncInterface* implementation, TargetApp ta, KPimPrefs* prefs, QPopupMenu* syncmenu); |
121 | ~KSyncManager() ; | 124 | ~KSyncManager() ; |
122 | 125 | ||
123 | void multiSync( bool askforPrefs ); | 126 | void multiSync( bool askforPrefs ); |
124 | bool blockSave() { return mBlockSaveFlag; } | 127 | bool blockSave() { return mBlockSaveFlag; } |
125 | void setBlockSave(bool sa) { mBlockSaveFlag = sa; } | 128 | void setBlockSave(bool sa) { mBlockSaveFlag = sa; } |
126 | void setDefaultFileName( QString s) ; | 129 | void setDefaultFileName( QString s) ; |