00001
00002
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
#include "options.h"
00031
#include "abbrowser-factory.moc"
00032
00033
#include <kinstance.h>
00034
#include <kaboutdata.h>
00035
00036
#include "abbrowser-conduit.h"
00037
#include "abbrowser-setup.h"
00038
00039
00040
extern "C"
00041 {
00042
00043
void *init_conduit_address()
00044 {
00045
return new AbbrowserConduitFactory;
00046 }
00047
00048 }
00049
00050
00051
00052
00053
00054
00055 KAboutData *AbbrowserConduitFactory::fAbout = 0L;
00056
const char *AbbrowserConduitFactory::fGroup =
"Abbrowser-conduit";
00057
00058
const char *AbbrowserConduitFactory::fAbookType =
"Addressbook type";
00059
const char *AbbrowserConduitFactory::fAbookFile =
"FileName";
00060
const char *AbbrowserConduitFactory::fSyncMode =
"SyncMode";
00061
const char *AbbrowserConduitFactory::fArchive =
"ArchiveDeleted";
00062
const char *AbbrowserConduitFactory::fResolution =
"ConflictResolve";
00063
const char *AbbrowserConduitFactory::fSmartMerge =
"SmartMerge";
00064
const char *AbbrowserConduitFactory::fFirstSync =
"FirstSync";
00065
const char *AbbrowserConduitFactory::fOtherField =
"PilotOther";
00066
const char *AbbrowserConduitFactory::fStreetType =
"PilotStreet";
00067
const char *AbbrowserConduitFactory::fFaxType =
"PilotFax";
00068
const char *AbbrowserConduitFactory::fCustom =
"Custom %1";
00069
const char *AbbrowserConduitFactory::fCustomFmt =
"CustomDateFormat";
00070
00071
00072
00073 AbbrowserConduitFactory::AbbrowserConduitFactory(QObject *p,
const char *n) :
00074 KLibFactory(p,n)
00075 {
00076 FUNCTIONSETUP;
00077
00078 fInstance =
new KInstance(
"abbrowserconduit");
00079 fAbout =
new KAboutData(
"abbrowserconduit",
00080 I18N_NOOP(
"Abbrowser Conduit for KPilot"),
00081 KPILOT_VERSION,
00082 I18N_NOOP(
"Configures the Abbrowser Conduit for KPilot"),
00083 KAboutData::License_GPL,
00084
"(C) 2001, Dan Pilone\n(C) 2002-2003, Reinhold Kainhofer");
00085 fAbout->addAuthor(
"Greg Stern",
00086 I18N_NOOP(
"Primary Author"));
00087 fAbout->addAuthor(
"Adriaan de Groot",
00088 I18N_NOOP(
"Maintainer"),
00089
"groot@kde.org",
00090
"http://www.cs.kun.nl/~adridg/kpilot");
00091 fAbout->addAuthor(
"Reinhold Kainhofer", I18N_NOOP(
"Maintainer"),
00092
"reinhold@kainhofer.com",
"http://reinhold.kainhofer.com");
00093 fAbout->addCredit(
"David Bishop", I18N_NOOP(
"UI"));
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
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 AbbrowserConduitFactory::~AbbrowserConduitFactory()
00165 {
00166 FUNCTIONSETUP;
00167
00168 KPILOT_DELETE(fInstance);
00169 KPILOT_DELETE(fAbout);
00170 }
00171
00172 QObject *AbbrowserConduitFactory::createObject( QObject *p,
00173
const char *n,
00174
const char *c,
00175
const QStringList &a)
00176 {
00177 FUNCTIONSETUP;
00178
00179
#ifdef DEBUG
00180
DEBUGCONDUIT << fname
00181 <<
": Creating object of class "
00182 << c
00183 << endl;
00184
#endif
00185
00186
if (qstrcmp(c,
"ConduitConfigBase")==0)
00187 {
00188 QWidget *w = dynamic_cast<QWidget *>(p);
00189
00190
if (w)
00191 {
00192
return new AbbrowserWidgetSetup(w,n);
00193 }
00194
else
00195 {
00196 kdError() << k_funcinfo
00197 <<
": Couldn't cast parent to widget."
00198 << endl;
00199
return 0L;
00200 }
00201 }
00202
if (qstrcmp(c,
"ConduitConfig")==0)
00203 {
00204 QWidget *w = dynamic_cast<QWidget *>(p);
00205
00206
if (w)
00207 {
00208
return new ConduitConfigImplementation(w,n,a,
00209 AbbrowserWidgetSetup::create);
00210 }
00211
else
00212 {
00213 kdError() << k_funcinfo
00214 <<
": Couldn't cast parent to widget."
00215 << endl;
00216
return 0L;
00217 }
00218 }
00219
00220
if (qstrcmp(c,
"SyncAction")==0)
00221 {
00222 KPilotDeviceLink *d = dynamic_cast<KPilotDeviceLink *>(p);
00223
00224
if (d)
00225 {
00226
return new AbbrowserConduit(d,n,a);
00227 }
00228
else
00229 {
00230 kdError() << k_funcinfo
00231 <<
": Couldn't cast parent to KPilotDeviceLink"
00232 << endl;
00233
return 0L;
00234 }
00235 }
00236
00237
return 0L;
00238 }
00239
00240