expense-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 <qtabwidget.h>
00032 #include <qlineedit.h>
00033 #include <qbuttongroup.h>
00034 #include <qradiobutton.h>
00035 #include <qspinbox.h>
00036
00037 #include <kconfig.h>
00038 #include <kinstance.h>
00039 #include <kaboutdata.h>
00040
00041 #include "expense.h"
00042 #include "setupDialog.h"
00043
00044 #include "expense-factory.moc"
00045
00046
00047 extern "C"
00048 {
00049
00050 void *init_conduit_expense()
00051 {
00052 return new ExpenseConduitFactory;
00053 }
00054
00055 }
00056
00057
00058 const char *ExpenseConduitFactory::fGroup="Expense-conduit";
00059 KAboutData *ExpenseConduitFactory::fAbout = 0L;
00060 ExpenseConduitFactory::ExpenseConduitFactory(QObject *p, const char *n) :
00061 KLibFactory(p,n)
00062 {
00063 FUNCTIONSETUP;
00064
00065 fInstance = new KInstance("expenseconduit");
00066 fAbout = new KAboutData("expenseConduit",
00067 I18N_NOOP("Expense Conduit for KPilot"),
00068 KPILOT_VERSION,
00069 I18N_NOOP("Configures the Expense Conduit for KPilot"),
00070 KAboutData::License_GPL,
00071 "(C) 2001, Adriaan de Groot and Chris Molnar");
00072 fAbout->addAuthor("Christopher Molnar",
00073 I18N_NOOP("Primary Author"));
00074 fAbout->addAuthor("Adriaan de Groot",
00075 I18N_NOOP("Maintainer"),
00076 "groot@kde.org",
00077 "http://www.cs.kun.nl/~adridg/kpilot");
00078 }
00079
00080 ExpenseConduitFactory::~ExpenseConduitFactory()
00081 {
00082 FUNCTIONSETUP;
00083
00084 KPILOT_DELETE(fAbout);
00085 KPILOT_DELETE(fInstance);
00086 }
00087
00088 QObject *ExpenseConduitFactory::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,"ConduitConfig")==0)
00103 {
00104 QWidget *w = dynamic_cast<QWidget *>(p);
00105
00106 if (w)
00107 {
00108 return new ExpenseWidgetSetup(w,n,a);
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,"SyncAction")==0)
00122 {
00123 KPilotDeviceLink *d = dynamic_cast<KPilotDeviceLink *>(p);
00124
00125 if (d)
00126 {
00127 return new ExpenseConduit(d,n,a);
00128 }
00129 else
00130 {
00131 kdError() << k_funcinfo
00132 << ": Couldn't cast to KPilotDeviceLink"
00133 << endl;
00134 return 0L;
00135 }
00136 }
00137 return 0L;
00138 }
This file is part of the documentation for kpilot Library Version 3.2.2.