MultiDB-factory.h
00001 #ifndef _KPILOT_MultiDB_FACTORY_H
00002 #define _KPILOT_MultiDB_FACTORY_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 #include <qlistview.h>
00034 #include <klibloader.h>
00035 #include <kinstance.h>
00036 #include <kaboutdata.h>
00037 #include <klistview.h>
00038 #include "options.h"
00039 #include "kpilotlink.h"
00040 #include "plugin.h"
00041
00042
00043 #ifdef KDE2
00044 #include <qlist.h>
00045 #define SyncTypeList_t QList<KPilotSyncType>
00046 #define SyncTypeIterator_t QListIterator<KPilotSyncType>
00047 #else
00048 #include <qptrlist.h>
00049 #define SyncTypeList_t QPtrList<KPilotSyncType>
00050 #define SyncTypeIterator_t QPtrListIterator<KPilotSyncType>
00051 #endif
00052
00053 #define RES_PALMOVERRIDES 0
00054 #define RES_PCOVERRIDES 1
00055 #define RES_ASK 2
00056
00057 #define SYNC_FIRST 0
00058 #define SYNC_FAST 1
00059 #define SYNC_FULL 2
00060 #define SYNC_MAX SYNC_FULL
00061
00062
00063 typedef enum synctps {
00064 st_ask, st_ignore, st_backup, st_pdb, st_vcal, st_ldap, st_sql, st_csv
00065 };
00066
00067 class DBSyncInfo{
00068 public:
00069 DBSyncInfo(QListViewItem*item) {dbname=item->text(0); syncaction=item->text(1).toInt(); filename=item->text(2);};
00070 DBSyncInfo(){dbname=QString::null; syncaction=0; filename=QString::null; synctype=SYNC_FAST;}
00071 DBSyncInfo(char*db, int act, char*fn, int st=SYNC_FAST) {dbname=QString(db); syncaction=act; filename=QString(fn); synctype=st;};
00072 DBSyncInfo(QString db, int act, QString fn, int st=SYNC_FAST) {dbname=db; syncaction=act; filename=fn; synctype=st;};
00073 bool set(QString name, int act, QString fn, int st=SYNC_FAST) {dbname=name; syncaction=act; filename=fn; synctype=st; return true;}
00074 ~DBSyncInfo() {};
00075 public:
00076 QString dbname;
00077 int syncaction;
00078 int synctype;
00079 QString filename;
00080 };
00081
00082
00083
00084 #define SYNC_NEEDSFILE 1
00085 #define SYNC_MAXFLAG SYNC_NEEDSFILE
00086
00087 class KPilotSyncType {
00088 public:
00089 KPilotSyncType();
00090 KPilotSyncType(QString sn="", QString ln="", int i=st_ask, int flg=0);
00091 KPilotSyncType(KPilotSyncType*tp);
00092 virtual ~KPilotSyncType() {};
00093 virtual bool getFlag(int flg) const { return (flags & flg); }
00094 virtual int setFlag(int flg, bool on) { if (on) {flags|=flg;} else {flags&=(!flg);} return flags;}
00095
00096 public:
00097 QString ShortName;
00098 QString LongName;
00099 int id;
00100 int flags;
00101 };
00102
00103 class MultiDBConduitFactory : public KLibFactory {
00104 Q_OBJECT
00105
00106 public:
00107 MultiDBConduitFactory(QObject * = 0L,const char * = 0L) ;
00108 virtual ~MultiDBConduitFactory();
00109
00110 static KAboutData *about() { return fAbout; } ;
00111
00112 virtual QObject*createSetupWidget(QWidget*, const char*, const QStringList &)=0;
00113 virtual QObject*createConduit(KPilotDeviceLink *, const char *n=0L, const QStringList &l=QStringList())=0;
00114 virtual void buildConduitInfo();
00115 virtual void customConduitInfo() {};
00116
00117 protected:
00118 virtual QObject* createObject( QObject* parent = 0,
00119 const char* name = 0,
00120 const char* classname = "QObject",
00121 const QStringList &args = QStringList() ) ;
00122 private:
00123 KInstance *fInstance;
00124 public:
00125 static KAboutData *fAbout;
00126 static SyncTypeList_t *synctypes;
00127 static QString conflictResolution;
00128 static QString archive;
00129 static QString fullSyncOnPCChange;
00130 } ;
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170 #endif
This file is part of the documentation for kdelibs Version 3.1.4.