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 } ;
00112
00113
00114
00115 class InteractiveAction : public SyncAction
00116 {
00117 Q_OBJECT
00118 public:
00119
00120
00121
00122
00123 InteractiveAction(KPilotDeviceLink *p,
00124 QWidget *visibleparent=0L,
00125 const char *name=0L);
00126 virtual ~InteractiveAction();
00127
00128
00129
00130
00131
00132
00133 protected slots:
00138 void tickle();
00139
00140 signals:
00141 void timeout();
00142
00143 protected:
00144 QWidget *fParent;
00145 QTimer *fTickleTimer;
00146 unsigned fTickleCount,fTickleTimeout;
00147
00159 void startTickle(unsigned count=0);
00160 void stopTickle();
00161
00174 int questionYesNo(const QString &question ,
00175 const QString &caption = QString::null,
00176 const QString &key = QString::null,
00177 unsigned timeout = 20000);
00178 } ;
00179
00180 #endif
This file is part of the documentation for kdelibs Version 3.1.5.