kpilot/lib
kpilotlink.hGo to the documentation of this file.00001 #ifndef _KPILOT_KPILOTLINK_H
00002 #define _KPILOT_KPILOTLINK_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 #include <time.h>
00033 #include <pi-dlp.h>
00034
00035 #include <qobject.h>
00036 #include <qvaluelist.h>
00037
00038 class QTimer;
00039 class QDateTime;
00040 class QSocketNotifier;
00041 class QThread;
00042 class KPilotUser;
00043 class KPilotSysInfo;
00044 class KPilotCard;
00045 class PilotDatabase;
00046 struct DBInfo;
00047
00048
00049
00144 typedef QValueList<struct DBInfo> DBInfoList;
00145
00151 class KDE_EXPORT KPilotLink : public QObject
00152 {
00153 Q_OBJECT
00154 friend class SyncAction;
00155 public:
00157 KPilotLink( QObject *parent = 0, const char *name = 0 );
00159 virtual ~KPilotLink();
00160
00161
00163 virtual QString statusString() const = 0;
00164
00169 virtual bool isConnected() const = 0;
00170
00171
00180 QString pilotPath() const { return fPilotPath; } ;
00181
00190 virtual void reset(const QString &pilotPath) = 0;
00191
00193 virtual bool event(QEvent *e);
00194
00201 unsigned int installFiles(const QStringList &l, const bool deleteFiles);
00202
00210 void addSyncLogEntry(const QString &entry,bool log=true);
00211
00218 virtual int findDatabase(const char *name, struct DBInfo*,
00219 int index=0, unsigned long type=0, unsigned long creator=0) = 0;
00220
00228 virtual bool retrieveDatabase(const QString &path, struct DBInfo *db) = 0;
00229
00235 virtual int getNextDatabase(int index,struct DBInfo *db) = 0;
00236
00248 virtual DBInfoList getDBList(int cardno=0, int flags=dlpDBListRAM) = 0;
00249
00258 virtual PilotDatabase *database( const QString &name ) = 0;
00259
00268 KPilotUser &getPilotUser() { return *fPilotUser; }
00269
00277 const KPilotSysInfo &getSysInfo() { return *fPilotSysInfo; }
00278
00290 virtual const KPilotCard *getCardInfo(int card=0) = 0;
00291
00293 virtual void endOfSync() = 0;
00297 virtual void finishSync() = 0;
00298
00299 signals:
00307 void timeout();
00308
00310 void logMessage(const QString &);
00312 void logError(const QString &);
00317 void logProgress(const QString &s, int p);
00318
00323 void deviceReady( KPilotLink* );
00324
00325
00326 public slots:
00331 virtual void close() = 0;
00332
00338 virtual void reset() = 0;
00339
00341 virtual bool tickle() = 0;
00342
00343 protected:
00349 QString fPilotPath;
00350
00358 void startTickle(unsigned int timeout=0);
00359
00364 void stopTickle();
00365
00372 virtual bool installFile( const QString &f, const bool deleteFile ) = 0;
00373
00382 virtual int openConduit();
00383
00389 virtual int pilotSocket() const;
00390
00394 virtual void addSyncLogEntryImpl( const QString &s ) = 0;
00395
00399 KPilotUser *fPilotUser;
00400
00404 KPilotSysInfo *fPilotSysInfo;
00405
00406
00407 private:
00408 bool fTickleDone;
00409 QThread *fTickleThread;
00410
00411 } ;
00412
00413 #endif
|