syncStack.h
00001 #ifndef _KPILOT_SYNCSTACK_H
00002 #define _KPILOT_SYNCSTACK_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #include <qptrqueue.h>
00034
00035 #include "plugin.h"
00036
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00097 class ActionQueue : public SyncAction
00098 {
00099 Q_OBJECT
00100 public:
00101 ActionQueue(KPilotDeviceLink *device);
00103 ActionQueue(KPilotDeviceLink *device,
00104 KConfig *config,
00105 const QStringList &conduits = QStringList(),
00106 const QString &installDir = QString::null,
00107 const QStringList &installFiles = QStringList());
00108 virtual ~ActionQueue();
00109
00110 private:
00111 QPtrQueue < SyncAction > SyncActionQueue;
00112
00113 public:
00114 bool isEmpty() const { return SyncActionQueue.isEmpty(); };
00119 void addAction(SyncAction * a) { SyncActionQueue.enqueue(a); };
00120
00121 protected:
00122 void clear() { SyncActionQueue.clear(); };
00123 SyncAction *nextAction() { return SyncActionQueue.dequeue(); };
00124
00125 bool fReady;
00126 KConfig *fConfig;
00127
00128 QString fInstallerDir;
00129 QStringList fInstallerFiles;
00130 QStringList fConduits;
00131
00132 public:
00133 enum SyncModes {
00134
00135
00136
00137 Test=0,
00138 Backup=1,
00139 Restore=2,
00140 HotSync=4,
00141
00142
00143
00144
00145
00146 WithUserCheck=0x20,
00147 WithInstaller=0x40,
00148 WithConduits=0x80,
00149
00150 FlagLocal=0x1000,
00151
00152 FlagTest=0x4000,
00153
00154
00155
00156
00157
00158
00159 ActionMask=0xf,
00160 MixinMask=0xf0,
00161 FlagMask=0xf000,
00162
00163
00164
00165
00166 TestMode = Test | WithUserCheck | WithConduits,
00167 BackupMode = Backup | WithUserCheck | WithConduits,
00168 RestoreMode = Restore | WithUserCheck,
00169 HotSyncMode = HotSync | WithUserCheck | WithConduits
00170 } ;
00171
00181
00182 void prepare(int m);
00183 void prepareBackup() { prepare(BackupMode); } ;
00184 void prepareRestore() { prepare(RestoreMode); } ;
00185 void prepareSync() { prepare(HotSyncMode); } ;
00186
00203 void queueInit(int mode=WithUserCheck);
00204 void queueConduits(KConfig *,const QStringList &conduits,int mode=0);
00205 void queueInstaller(const QString &dir,const QStringList &files);
00206 void queueCleanup();
00207
00208
00209 protected:
00210 virtual bool exec();
00211
00212 protected slots:
00216 void actionCompleted(SyncAction *);
00217 };
00218
00223 class WelcomeAction : public SyncAction
00224 {
00225 Q_OBJECT
00226
00227 public:
00228 WelcomeAction(KPilotDeviceLink *);
00229
00230 protected:
00231 virtual bool exec();
00232 } ;
00233
00240 class ConduitProxy : public ConduitAction
00241 {
00242 Q_OBJECT
00243
00244 public:
00245 ConduitProxy(KPilotDeviceLink *,
00246 const QString &desktopName,
00247 int m);
00248
00249 protected:
00250 virtual bool exec();
00251 protected slots:
00252 void execDone(SyncAction *);
00253
00254 protected:
00255 QString fDesktopName;
00256 QString fLibraryName;
00257 ConduitAction *fConduit;
00258 int fMode;
00259 } ;
00260
00261
00262 #endif
This file is part of the documentation for kdelibs Version 3.1.4.