kpilot Library API Documentation

hotSync.h

00001 #ifndef _KPILOT_HOTSYNC_H
00002 #define _KPILOT_HOTSYNC_H
00003 /* hotSync.h                            KPilot
00004 **
00005 ** Copyright (C) 2001 by Dan Pilone
00006 **
00007 ** This file defines SyncActions, which are used to perform some specific
00008 ** task during a HotSync. Conduits are not included here, nor are
00009 ** sync actions requiring user interaction. Those can be found in the
00010 ** conduits subdirectory or interactiveSync.h.
00011 */
00012 
00013 /*
00014 ** This program is free software; you can redistribute it and/or modify
00015 ** it under the terms of the GNU General Public License as published by
00016 ** the Free Software Foundation; either version 2 of the License, or
00017 ** (at your option) any later version.
00018 **
00019 ** This program is distributed in the hope that it will be useful,
00020 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00021 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00022 ** GNU General Public License for more details.
00023 **
00024 ** You should have received a copy of the GNU General Public License
00025 ** along with this program in a file called COPYING; if not, write to
00026 ** the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
00027 ** MA 02111-1307, USA.
00028 */
00029 
00030 /*
00031 ** Bug reports and questions can be sent to kde-pim@kde.org
00032 */
00033 
00034 
00035 class QTimer;
00036 
00037 #include <qstring.h>
00038 #include <qstringlist.h>
00039 
00040 #include "syncAction.h"
00041 #include "syncStack.h"
00042 
00043 class TestLink : public SyncAction
00044 {
00045 Q_OBJECT
00046 
00047 public:
00048     TestLink(KPilotDeviceLink *);
00049 
00050 protected:
00051     virtual bool exec();
00052 } ;
00053 
00054 class BackupAction : public SyncAction
00055 {
00056 Q_OBJECT
00057 
00058 public:
00059     BackupAction(KPilotDeviceLink *, int mode=ActionQueue::BackupMode);
00060 
00061     enum Status { Init,
00062         Error,
00063         FastBackup,
00064         FullBackup,
00065         BackupIncomplete,
00066         BackupEnded,
00067         BackupComplete
00068         } ;
00069     virtual QString statusString() const;
00070 
00071 protected:
00072     virtual bool exec();
00073 
00074 private:
00078     void endBackup();
00079     bool createLocalDatabase(DBInfo *);
00080     bool checkBackupDirectory(QString backupDir);
00081 
00082 private slots:
00083     void backupOneDB();
00084 
00085 private:
00086     QTimer *fTimer;
00087     int fDBIndex;
00088     QString fBackupDir, fDatabaseDir;
00089     int fMode;
00090     bool fFullBackup;
00091 } ;
00092 
00093 class FileInstallAction : public SyncAction
00094 {
00095 Q_OBJECT
00096 public:
00097     FileInstallAction(KPilotDeviceLink *,
00098         const QString &fileDir,
00099         const QStringList &fileNames);
00100     virtual ~FileInstallAction();
00101 
00102     virtual QString statusString() const;
00103 
00104 protected:
00105     virtual bool exec();
00106 
00107 protected slots:
00108     void installNextFile();
00109 
00110 private:
00111     int fDBIndex;
00112     QTimer *fTimer;
00113     QString fDir;
00114     QStringList fList;
00115 } ;
00116 
00117 class CleanupAction : public SyncAction
00118 {
00119 public:
00120     CleanupAction(KPilotDeviceLink * p);
00121     virtual ~CleanupAction();
00122 
00123 protected:
00124     virtual bool exec();
00125 } ;
00126 
00127 #endif
KDE Logo
This file is part of the documentation for kpilot Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat May 1 11:36:47 2004 by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2003