syncAction.h
00001 #ifndef _KPILOT_SYNCACTION_H
00002 #define _KPILOT_SYNCACTION_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 #include <time.h>
00031
00032 #include <pi-dlp.h>
00033
00034
00035 #include <qobject.h>
00036 #include <qstring.h>
00037
00038 #include "kpilotlink.h"
00039
00040 class QTimer;
00041 class QSocketNotifier;
00042 class KPilotUser;
00043 class SyncAction;
00044
00045
00046 class SyncAction : public QObject
00047 {
00048 Q_OBJECT
00049
00050 public:
00051 SyncAction(KPilotDeviceLink *p,
00052 const char *name=0L);
00053
00054 typedef enum { Error=-1 } Status;
00055
00056 int status() const { return fStatus; } ;
00057 virtual QString statusString() const;
00058
00059 protected:
00073 virtual bool exec() = 0;
00074
00075 public slots:
00080 void execConduit();
00081
00082 signals:
00083 void syncDone(SyncAction *);
00084 void logMessage(const QString &);
00085 void logError(const QString &);
00086 void logProgress(const QString &,int);
00087
00097 protected slots:
00098 void delayedDoneSlot();
00099 protected:
00100 bool delayDone();
00101
00102 protected:
00103 KPilotDeviceLink *fHandle;
00104 int fStatus;
00105
00106 void addSyncLogEntry(const QString &e,bool log=true)
00107 { fHandle->addSyncLogEntry(e,log); } ;
00108 int pilotSocket() const { return fHandle->pilotSocket(); } ;
00109
00110 int openConduit() { return fHandle->openConduit(); } ;
00111 public:
00112 enum eSyncMode
00113 {
00114 eFastSync=0,
00115 eHotSync,
00116 eFullSync,
00117 eCopyPCToHH,
00118 eCopyHHToPC,
00119 eSyncModeLastRadiobutton=eFullSync
00120 };
00121 enum eConflictResolution
00122 {
00123 eUseGlobalSetting=-1,
00124 eAskUser=0,
00125 eDoNothing,
00126 eHHOverrides,
00127 ePCOverrides,
00128 ePreviousSyncOverrides,
00129 eDuplicate,
00130 eDelete,
00131 eCROffset=-1
00132 };
00133 } ;
00134
00135
00136
00137 class InteractiveAction : public SyncAction
00138 {
00139 Q_OBJECT
00140 public:
00141
00142
00143
00144
00145 InteractiveAction(KPilotDeviceLink *p,
00146 QWidget *visibleparent=0L,
00147 const char *name=0L);
00148 virtual ~InteractiveAction();
00149
00150
00151
00152
00153
00154
00155 protected slots:
00160 void tickle();
00161
00162 signals:
00163 void timeout();
00164
00165 protected:
00166 QWidget *fParent;
00167 QTimer *fTickleTimer;
00168 unsigned fTickleCount,fTickleTimeout;
00169
00181 void startTickle(unsigned count=0);
00182 void stopTickle();
00183
00196 int questionYesNo(const QString &question ,
00197 const QString &caption = QString::null,
00198 const QString &key = QString::null,
00199 unsigned timeout = 20000);
00200 } ;
00201
00202 #endif
This file is part of the documentation for kpilot Library Version 3.2.2.