plugin.h
00001 #ifndef _KPILOT_PLUGIN_H
00002 #define _KPILOT_PLUGIN_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
00033
00034
00035 #include <qstringlist.h>
00036
00037 #include "uiDialog.h"
00038 #include "syncAction.h"
00039
00040 class KConfig;
00041 class PilotDatabase;
00042
00067 class ConduitConfigBase : public QObject
00068 {
00069 Q_OBJECT
00070 public:
00071 ConduitConfigBase(QWidget *parent=0L, const char *n=0L);
00072 virtual ~ConduitConfigBase();
00073
00080 virtual bool isModified() const { return fModified; } ;
00081 QWidget *widget() const { return fWidget; } ;
00082
00083 public:
00090 virtual void commit(KConfig *) = 0;
00091 virtual void load(KConfig *) = 0;
00101 virtual bool maybeSave(KConfig *);
00102 protected:
00107 virtual QString maybeSaveText() const;
00108
00109 public:
00110 QString conduitName() const { return fConduitName; } ;
00111
00112 protected slots:
00113 void modified();
00114
00115 protected:
00116 bool fModified;
00117 QWidget *fWidget;
00118 QString fConduitName;
00119
00120 void unmodified() { fModified=false; } ;
00121 } ;
00122
00131 class ConduitConfig : public UIDialog
00132 {
00133 Q_OBJECT
00134
00135 public:
00136 ConduitConfig(QWidget *parent=0L,
00137 const char *name=0L,
00138 const QStringList &args = QStringList()) KDE_DEPRECATED;
00139 virtual ~ConduitConfig();
00140
00141 void setConfig(KConfig *c) { fConfig=c; } ;
00142
00143 virtual void readSettings() = 0 ;
00144
00145
00146
00147
00148
00149 QString conduitName() const { return fConduitName; } ;
00150 protected:
00151 KConfig *fConfig;
00152 QString fConduitName;
00153 } ;
00154
00161 class ConduitConfigImplementation : public ConduitConfig
00162 {
00163 public:
00164 ConduitConfigImplementation(QWidget *,
00165 const char *,
00166 const QStringList &,
00167 ConduitConfigBase *(*f)(QWidget *, const char *)) KDE_DEPRECATED;
00168 virtual ~ConduitConfigImplementation();
00169
00170 virtual void readSettings();
00171
00172 protected:
00173 virtual void commitChanges();
00174
00175 protected:
00176 ConduitConfigBase *fConfigWidget;
00177 } ;
00178
00179
00180
00181
00182
00183
00184
00185
00196 class ConduitAction : public SyncAction
00197 {
00198 Q_OBJECT
00199 public:
00200 ConduitAction(KPilotDeviceLink *,
00201 const char *name=0L,
00202 const QStringList &args = QStringList());
00203 virtual ~ConduitAction();
00204
00205 void setConfig(KConfig *c) { fConfig=c; } ;
00206
00207 QString conduitName() const { return fConduitName; } ;
00208
00209 protected:
00210 bool isTest() const { return fTest; } ;
00211 bool isBackup() const { return fBackup; } ;
00212 bool isLocal() const { return fLocal; } ;
00213
00214 int getSyncDirection() const { return fSyncDirection; };
00215 eConflictResolution getConflictResolution() const
00216 { return fConflictResolution; };
00217
00223 bool isFullSync() const
00224 {
00225 return fFirstSync ||
00226 (fSyncDirection!=SyncAction::eFastSync &&
00227 fSyncDirection!=SyncAction::eHotSync);
00228 }
00229
00237 bool isFirstSync() const {
00238 return fFirstSync ||
00239 (fSyncDirection==SyncAction::eCopyHHToPC) ||
00240 (fSyncDirection==SyncAction::eCopyPCToHH); };
00241
00242 KConfig *fConfig;
00243 PilotDatabase *fDatabase,*fLocalDatabase;
00244
00250 bool openDatabases(const QString &dbName, bool*retrieved=0L);
00251
00252 private:
00253 bool fTest;
00254 bool fBackup;
00255 bool fLocal;
00256
00257
00258 protected:
00259 int fSyncDirection;
00260 eConflictResolution fConflictResolution;
00261 bool fFirstSync;
00262 QString fConduitName;
00263
00264 private:
00273 bool openDatabases_(const QString &dbName, bool*retrieved=0L);
00274
00283 bool openDatabases_(const QString &dbName,const QString &localPath);
00284 } ;
00285
00286 class PluginUtility
00287 {
00288 public:
00289 static int findHandle(const QStringList &);
00290 static bool isModal(const QStringList &a);
00291
00300 static bool isRunning(const QCString &appName);
00301 } ;
00302
00350 #endif
This file is part of the documentation for kpilot Library Version 3.2.2.