kpilot/kpilot

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 ** Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
00007 ** Copyright (C) 2006 Adriaan de Groot <groot@kde.org>
00008 **
00009 ** This file defines SyncActions, which are used to perform some specific
00010 ** task during a HotSync. Conduits are not included here, nor are
00011 ** sync actions requiring user interaction. Those can be found in the
00012 ** conduits subdirectory or interactiveSync.h.
00013 */
00014 
00015 /*
00016 ** This program is free software; you can redistribute it and/or modify
00017 ** it under the terms of the GNU General Public License as published by
00018 ** the Free Software Foundation; either version 2 of the License, or
00019 ** (at your option) any later version.
00020 **
00021 ** This program is distributed in the hope that it will be useful,
00022 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00023 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00024 ** GNU General Public License for more details.
00025 **
00026 ** You should have received a copy of the GNU General Public License
00027 ** along with this program in a file called COPYING; if not, write to
00028 ** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
00029 ** MA 02110-1301, USA.
00030 */
00031 
00032 /*
00033 ** Bug reports and questions can be sent to kde-pim@kde.org
00034 */
00035 
00036 
00037 class QTimer;
00038 
00039 #include "syncAction.h"
00040 
00041 class TestLink : public SyncAction
00042 {
00043 Q_OBJECT
00044 
00045 public:
00046     TestLink(KPilotLink *);
00047 
00048 protected:
00049     virtual bool exec();
00050 } ;
00051 
00052 class BackupAction : public SyncAction
00053 {
00054 Q_OBJECT
00055 
00056 public:
00065     BackupAction(KPilotLink *, bool full);
00066 
00067     enum Status { Init,
00068         Error,
00069         FastBackup,
00070         FullBackup,
00071         BackupIncomplete,
00072         BackupEnded,
00073         BackupComplete
00074         } ;
00075     virtual QString statusString() const;
00076 
00086     void setDirectory( const QString &path );
00087 
00088 protected:
00089     virtual bool exec();
00090 
00091 private:
00093     void endBackup();
00094 
00098     bool createLocalDatabase(DBInfo *info);
00099 
00105     static bool checkBackupDirectory( const QString &backupDir );
00106 
00107 private slots:
00112     void backupOneDB();
00113 
00114 private:
00115     class Private;
00116     Private *fP;
00117 } ;
00118 
00119 class FileInstallAction : public SyncAction
00120 {
00121 Q_OBJECT
00122 public:
00123     FileInstallAction(KPilotLink *,
00124         const QString &fileDir);
00125     virtual ~FileInstallAction();
00126 
00127     virtual QString statusString() const;
00128 
00129 protected:
00130     virtual bool exec();
00131 
00132 protected slots:
00133     void installNextFile();
00134 
00135 private:
00136     int fDBIndex;
00137     QTimer *fTimer;
00138     QString fDir;
00139     QStringList fList;
00140 
00141     // TODO: not const because it calls logError(), which is
00142     // non-const (but might be - can signals be const, anyway?)
00143     bool resourceOK(const QString &, const QString &) /* const */ ;
00144 } ;
00145 
00146 class CleanupAction : public SyncAction
00147 {
00148 public:
00149     CleanupAction(KPilotLink * p);
00150     virtual ~CleanupAction();
00151 
00152 protected:
00153     virtual bool exec();
00154 } ;
00155 
00156 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys