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