kpilot
doc-factory.ccGo to the documentation of this file.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 #include "doc-factory.moc"
00031 #include "doc-factory.h"
00032
00033 #include <kinstance.h>
00034 #include <kaboutdata.h>
00035 #include <kpilotlink.h>
00036
00037 #include "doc-conduit.h"
00038 #include "doc-setup.h"
00039
00040
00041 extern "C" {
00042 void *init_conduit_doc() {
00043 return new DOCConduitFactory;
00044 }
00045 }
00046
00047
00048
00049
00050 KAboutData * DOCConduitFactory::fAbout = 0L;
00051
00052 const char *DOCConduitFactory::dbDOCtype = "TEXt";
00053 const char *DOCConduitFactory::dbDOCcreator = "REAd";
00054
00055
00056
00057 DOCConduitFactory::DOCConduitFactory(QObject * p, const char *n):
00058 KLibFactory(p, n)
00059 {
00060 FUNCTIONSETUP;
00061 fInstance = new KInstance("docconduit");
00062 fAbout =new KAboutData("docconduit",
00063 I18N_NOOP("Palm DOC Conduit for KPilot"), KPILOT_VERSION,
00064 I18N_NOOP("Configures the DOC Conduit for KPilot"),
00065 KAboutData::License_GPL, "(C) 2002, Reinhold Kainhofer");
00066
00067 fAbout->addAuthor("Reinhold Kainhofer",
00068 I18N_NOOP("Maintainer"), "reinhold@kainhofer.com",
00069 "http://reinhold.kainhofer.com");
00070 }
00071
00072 DOCConduitFactory::~DOCConduitFactory()
00073 {
00074 FUNCTIONSETUP;
00075 KPILOT_DELETE(fInstance);
00076 KPILOT_DELETE(fAbout);
00077 }
00078
00079
00080 QObject * DOCConduitFactory::createObject(QObject * p,
00081 const char *n, const char *c, const QStringList & a)
00082 {
00083 FUNCTIONSETUP;
00084
00085 #ifdef DEBUG
00086 DEBUGKPILOT << fname <<": Creating object of class " <<c <<endl;
00087 #endif
00088 if (qstrcmp(c, "ConduitConfigBase") == 0)
00089 {
00090 QWidget *w = dynamic_cast<QWidget *>(p);
00091 if (w)
00092 {
00093 return new DOCWidgetConfig(w,n);
00094 }
00095 else
00096 {
00097 WARNINGKPILOT << "Couldn't cast parent to widget." << endl;
00098 return 0L;
00099 }
00100 }
00101 if (qstrcmp(c, "SyncAction") == 0)
00102 {
00103 KPilotLink * d = dynamic_cast < KPilotLink * >(p);
00104 if (d)
00105 {
00106 return new DOCConduit(d, n, a);
00107 }
00108 else
00109 {
00110 WARNINGKPILOT << "Couldn't cast parent to KPilotLink" <<endl;
00111 return 0L;
00112 }
00113 }
00114 return 0L;
00115 }
00116
|