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_libknotesconduit()
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,"ConduitConfig")==0)
00106 {
00107 QWidget *w = dynamic_cast<QWidget *>(p);
00108
00109 if (w)
00110 {
00111 return new KNotesWidgetSetup(w,n,a);
00112 }
00113 else
00114 {
00115 kdError() << k_funcinfo
00116 << ": Couldn't cast parent to widget."
00117 << endl;
00118 return 0L;
00119 }
00120 }
00121
00122 if (qstrcmp(c,"SyncAction")==0)
00123 {
00124 KPilotDeviceLink *d = dynamic_cast<KPilotDeviceLink *>(p);
00125
00126 if (d)
00127 {
00128 return new KNotesAction(d,n,a);
00129 }
00130 else
00131 {
00132 kdError() << k_funcinfo
00133 << ": Couldn't cast parent to KPilotDeviceLink"
00134 << endl;
00135 return 0L;
00136 }
00137 }
00138
00139 return 0L;
00140 }
This file is part of the documentation for kdelibs Version 3.1.4.