summaryrefslogtreecommitdiffabout
path: root/libkdepim/ksyncmanager.h
Unidiff
Diffstat (limited to 'libkdepim/ksyncmanager.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/ksyncmanager.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/libkdepim/ksyncmanager.h b/libkdepim/ksyncmanager.h
index 2af891b..6da0ee4 100644
--- a/libkdepim/ksyncmanager.h
+++ b/libkdepim/ksyncmanager.h
@@ -77,138 +77,140 @@ class KCommandSocket : public QObject
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
104class KSyncManager : public QObject 104class 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 QString getCurrentSyncDevice() { return mCurrentSyncDevice; } 126 QString getCurrentSyncDevice() { return mCurrentSyncDevice; }
126 QString getCurrentSyncName() { return mCurrentSyncName; } 127 QString getCurrentSyncName() { return mCurrentSyncName; }
127 128
128 void showProgressBar(int percentage, QString caption = QString::null, int total=100); 129 void showProgressBar(int percentage, QString caption = QString::null, int total=100);
129 void hideProgressBar(); 130 void hideProgressBar();
130 bool isProgressBarCanceled(); 131 bool isProgressBarCanceled();
131 132
132 // sync stuff 133 // sync stuff
133 QString mLocalMachineName; 134 QString mLocalMachineName;
134 QStringList mExternSyncProfiles; 135 QStringList mExternSyncProfiles;
135 QStringList mSyncProfileNames; 136 QStringList mSyncProfileNames;
136 bool mAskForPreferences; 137 bool mAskForPreferences;
137 bool mShowSyncSummary; 138 bool mShowSyncSummary;
138 bool mIsKapiFile; 139 bool mIsKapiFile;
139 bool mWriteBackExistingOnly; 140 bool mWriteBackExistingOnly;
140 int mSyncAlgoPrefs; 141 int mSyncAlgoPrefs;
141 bool mWriteBackFile; 142 bool mWriteBackFile;
142 int mWriteBackInFuture; 143 int mWriteBackInFuture;
143 QString mPhoneDevice; 144 QString mPhoneDevice;
144 QString mPhoneConnection; 145 QString mPhoneConnection;
145 QString mPhoneModel; 146 QString mPhoneModel;
146 QString mPassWordPiSync; 147 QString mPassWordPiSync;
147 QString mActiveSyncPort; 148 QString mActiveSyncPort;
148 QString mActiveSyncIP ; 149 QString mActiveSyncIP ;
149 static QDateTime mRequestedSyncEvent; 150 static QDateTime mRequestedSyncEvent;
150 151
151 signals: 152 signals:
152 void save(); 153 void save();
153 void request_file(); 154 void request_file();
154 void getFile( bool ); 155 void getFile( bool );
155 156
156 public slots: 157 public slots:
157 void slotSyncMenu( int ); 158 void slotSyncMenu( int );
158 void slotClearMenu( int action ); 159 void slotClearMenu( int action );
159 void deleteCommandSocket(KCommandSocket*s, int state); 160 void deleteCommandSocket(KCommandSocket*s, int state);
160 void readFileFromSocket(); 161 void readFileFromSocket();
161 void fillSyncMenu(); 162 void fillSyncMenu();
162 163
163 private: 164 private:
164 void syncPi(); 165 void syncPi();
165 KServerSocket * mServerSocket; 166 KServerSocket * mServerSocket;
166 KPimPrefs* mPrefs; 167 KPimPrefs* mPrefs;
167 QString mDefFileName; 168 QString mDefFileName;
168 QString mCurrentSyncDevice; 169 QString mCurrentSyncDevice;
169 QString mCurrentSyncName; 170 QString mCurrentSyncName;
170 void quickSyncLocalFile(); 171 void quickSyncLocalFile();
171 bool syncWithFile( QString fn , bool quick ); 172 bool syncWithFile( QString fn , bool quick );
172 void syncLocalFile(); 173 void syncLocalFile();
173 void syncPhone(); 174 void syncPhone();
174 void syncSharp(); 175 void syncSharp();
175 void syncKDE(); 176 void syncKDE();
176 bool syncExternalApplication(QString); 177 bool syncExternalApplication(QString);
177 int mCurrentSyncProfile ; 178 int mCurrentSyncProfile ;
178 void syncRemote( KSyncProfile* prof, bool ask = true); 179 void syncRemote( KSyncProfile* prof, bool ask = true);
179 bool edit_sync_options(); 180 bool edit_sync_options();
180 bool edit_pisync_options(); 181 bool edit_pisync_options();
181 int ringSync(); 182 int ringSync();
182 QString getPassword( ); 183 QString getPassword( );
183 bool mPisyncFinished; 184 bool mPisyncFinished;
184 bool mBlockSaveFlag; 185 bool mBlockSaveFlag;
185 QWidget* mParent; 186 QWidget* mParent;
186 KSyncInterface* mImplementation; 187 KSyncInterface* mImplementation;
187 TargetApp mTargetApp; 188 TargetApp mTargetApp;
188 QPopupMenu* mSyncMenu; 189 QPopupMenu* mSyncMenu;
189 QProgressBar* bar; 190 QProgressBar* bar;
191 bool mSyncWithDesktop;
190 192
191private slots: 193private slots:
192 void confSync(); 194 void confSync();
193 195
194 196
195}; 197};
196 198
197 199
198class KSyncInterface 200class KSyncInterface
199{ 201{
200 public : 202 public :
201 virtual void removeSyncInfo( QString syncProfile) = 0; 203 virtual void removeSyncInfo( QString syncProfile) = 0;
202 virtual bool sync(KSyncManager* manager, QString filename, int mode) = 0; 204 virtual bool sync(KSyncManager* manager, QString filename, int mode) = 0;
203 virtual bool syncExternal(KSyncManager* manager, QString resource) 205 virtual bool syncExternal(KSyncManager* manager, QString resource)
204 { 206 {
205 // empty implementation, because some syncable applications do not 207 // empty implementation, because some syncable applications do not
206 // have an external(sharpdtm) syncmode, like pwmanager. 208 // have an external(sharpdtm) syncmode, like pwmanager.
207 return false; 209 return false;
208 } 210 }
209 211
210 212
211}; 213};
212 214
213 215
214#endif 216#endif