vcal-factory.cc
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
00032 #include <kinstance.h>
00033 #include <kaboutdata.h>
00034
00035 #include "vcal-setup.h"
00036 #include "vcal-conduit.h"
00037 #include "vcal-factory.moc"
00038
00039
00040 extern "C"
00041 {
00042
00043 void *init_conduit_vcal()
00044 {
00045 return new VCalConduitFactory;
00046 }
00047
00048 }
00049
00050
00051
00052
00053 VCalConduitFactory::VCalConduitFactory(QObject *p, const char *n) :
00054 VCalConduitFactoryBase(p,n)
00055 {
00056 FUNCTIONSETUP;
00057
00058 fInstance = new KInstance("vcalconduit");
00059 fAbout = new KAboutData("vcalConduit",
00060 I18N_NOOP("VCal Conduit for KPilot"),
00061 KPILOT_VERSION,
00062 I18N_NOOP("Configures the VCal Conduit for KPilot"),
00063 KAboutData::License_GPL,
00064 "(C) 2001, Adriaan de Groot\n(C) 2002-2003, Reinhold Kainhofer");
00065 fAbout->addAuthor("Adriaan de Groot",
00066 I18N_NOOP("Maintainer"),
00067 "groot@kde.org",
00068 "http://www.cs.kun.nl/~adridg/kpilot");
00069 fAbout->addAuthor("Reinhold Kainhofer",
00070 I18N_NOOP("Maintainer"),
00071 "reinhold@kainhofer.com",
00072 "http://reinhold.kainhofer.com/Linux/");
00073 fAbout->addAuthor("Dan Pilone",
00074 I18N_NOOP("Original Author"));
00075 fAbout->addAuthor("Preston Brown",
00076 I18N_NOOP("Original Author"));
00077 fAbout->addAuthor("Herwin-Jan Steehouwer",
00078 I18N_NOOP("Original Author"));
00079 fAbout->addCredit("Cornelius Schumacher",
00080 I18N_NOOP("iCalendar port"));
00081 fAbout->addCredit("Philipp Hullmann",
00082 I18N_NOOP("Bugfixer"));
00083 group="vcalOptions";
00084 }
00085
00086 VCalConduitFactory::~VCalConduitFactory()
00087 {
00088 FUNCTIONSETUP;
00089
00090 KPILOT_DELETE(fInstance);
00091 }
00092
00093 QObject *VCalConduitFactory::createObject( QObject *p,
00094 const char *n,
00095 const char *c,
00096 const QStringList &a)
00097 {
00098 FUNCTIONSETUP;
00099
00100 #ifdef DEBUG
00101 DEBUGCONDUIT << fname
00102 << ": Creating object of class "
00103 << c
00104 << endl;
00105 #endif
00106
00107 if (qstrcmp(c,"ConduitConfigBase")==0)
00108 {
00109 QWidget *w = dynamic_cast<QWidget *>(p);
00110
00111 if (w)
00112 {
00113 return new VCalWidgetSetup(w,n);
00114 }
00115 else
00116 {
00117 #ifdef DEBUG
00118 DEBUGCONDUIT << fname
00119 << ": Couldn't cast parent to widget."
00120 << endl;
00121 #endif
00122 return 0L;
00123 }
00124 }
00125 if (qstrcmp(c,"ConduitConfig")==0)
00126 {
00127 QWidget *w = dynamic_cast<QWidget *>(p);
00128
00129 if (w)
00130 {
00131 return new ConduitConfigImplementation(w,n,a,
00132 VCalWidgetSetup::create);
00133 }
00134 else
00135 {
00136 #ifdef DEBUG
00137 DEBUGCONDUIT << fname
00138 << ": Couldn't cast parent to widget."
00139 << endl;
00140 #endif
00141 return 0L;
00142 }
00143 }
00144
00145 if (qstrcmp(c,"SyncAction")==0)
00146 {
00147 KPilotDeviceLink *d = dynamic_cast<KPilotDeviceLink *>(p);
00148
00149 if (d)
00150 {
00151 return new VCalConduit(d,n,a);
00152 }
00153 else
00154 {
00155 kdError() << k_funcinfo
00156 << ": Couldn't cast to KPilotDeviceLink."
00157 << endl;
00158 }
00159 }
00160
00161 return 0L;
00162 }
This file is part of the documentation for kpilot Library Version 3.2.2.