knotes-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 #include "options.h"
00030
00031 #include <kapplication.h>
00032 #include <kinstance.h>
00033 #include <kaboutdata.h>
00034
00035 #include <dcopclient.h>
00036
00037 #include <time.h>
00038
00039 #include <pi-memo.h>
00040
00041 #include "knotes-action.h"
00042 #include "knotes-setup.h"
00043
00044 #include "knotes-factory.moc"
00045
00046
00047 extern "C"
00048 {
00049
00050 void *init_conduit_knotes()
00051 {
00052 return new KNotesConduitFactory;
00053 }
00054
00055 }
00056
00057
00058 KAboutData *KNotesConduitFactory::fAbout = 0L;
00059
00060 const char * const KNotesConduitFactory::group = "KNotes-conduit";
00061 const char * const KNotesConduitFactory::matchDeletes = "DeleteNoteForMemo";
00062
00063 KNotesConduitFactory::KNotesConduitFactory(QObject *p, const char *n) :
00064 KLibFactory(p,n)
00065 {
00066 FUNCTIONSETUP;
00067
00068 fInstance = new KInstance("knotesconduit");
00069 fAbout = new KAboutData("knotesconduit",
00070 I18N_NOOP("KNotes Conduit for KPilot"),
00071 KPILOT_VERSION,
00072 I18N_NOOP("Configures the KNotes Conduit for KPilot"),
00073 KAboutData::License_GPL,
00074 "(C) 2001, Adriaan de Groot");
00075 fAbout->addAuthor("Adriaan de Groot",
00076 I18N_NOOP("Primary Author"),
00077 "groot@kde.org",
00078 "http://www.cs.kun.nl/~adridg/kpilot");
00079 fAbout->addCredit("David Bishop",
00080 I18N_NOOP("UI"));
00081 }
00082
00083 KNotesConduitFactory::~KNotesConduitFactory()
00084 {
00085 FUNCTIONSETUP;
00086
00087 KPILOT_DELETE(fInstance);
00088 KPILOT_DELETE(fAbout);
00089 }
00090
00091 QObject *KNotesConduitFactory::createObject( QObject *p,
00092 const char *n,
00093 const char *c,
00094 const QStringList &a)
00095 {
00096 FUNCTIONSETUP;
00097
00098 #ifdef DEBUG
00099 DEBUGCONDUIT << fname
00100 << ": Creating object of class "
00101 << c
00102 << endl;
00103 #endif
00104
00105 if (qstrcmp(c,"ConduitConfigBase")==0)
00106 {
00107 QWidget *w = dynamic_cast<QWidget *>(p);
00108 if (w)
00109 {
00110 return new KNotesConfigBase(w,0L);
00111 }
00112 else
00113 {
00114 return 0L;
00115 }
00116 }
00117 else
00118 if (qstrcmp(c,"ConduitConfig")==0)
00119 {
00120 QWidget *w = dynamic_cast<QWidget *>(p);
00121
00122 if (w)
00123 {
00124 return new ConduitConfigImplementation(w,n,a,
00125 KNotesConfigBase::create);
00126 }
00127 else
00128 {
00129 kdError() << k_funcinfo
00130 << ": Couldn't cast parent to widget."
00131 << endl;
00132 return 0L;
00133 }
00134 }
00135
00136 if (qstrcmp(c,"SyncAction")==0)
00137 {
00138 KPilotDeviceLink *d = dynamic_cast<KPilotDeviceLink *>(p);
00139
00140 if (d)
00141 {
00142 return new KNotesAction(d,n,a);
00143 }
00144 else
00145 {
00146 kdError() << k_funcinfo
00147 << ": Couldn't cast parent to KPilotDeviceLink"
00148 << endl;
00149 return 0L;
00150 }
00151 }
00152
00153 return 0L;
00154 }
This file is part of the documentation for kpilot Library Version 3.2.2.