kpilot Library API Documentation

todo-factory.cc

00001 /* todo-factory.cc                      KPilot
00002 **
00003 ** Copyright (C) 2001 by Dan Pilone
00004 **
00005 ** This file defines the factory for the todo-conduit plugin.
00006 */
00007  
00008 /*
00009 ** This program is free software; you can redistribute it and/or modify
00010 ** it under the terms of the GNU General Public License as published by
00011 ** the Free Software Foundation; either version 2 of the License, or
00012 ** (at your option) any later version.
00013 **
00014 ** This program is distributed in the hope that it will be useful,
00015 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00017 ** GNU General Public License for more details.
00018 **
00019 ** You should have received a copy of the GNU General Public License
00020 ** along with this program in a file called COPYING; if not, write to
00021 ** the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
00022 ** MA 02111-1307, USA.
00023 */
00024 
00025 /*
00026 ** Bug reports and questions can be sent to kde-pim@kde.org
00027 */
00028 
00029 #include "options.h"
00030 
00031 #include <kinstance.h>
00032 #include <kaboutdata.h>
00033 
00034 #include "todo-setup.h"
00035 #include "todo-conduit.h"
00036 #include "todo-factory.moc"
00037 
00038 
00039 extern "C"
00040 {
00041 
00042 void *init_libtodoconduit()
00043 {
00044         return new ToDoConduitFactory;
00045 }
00046 
00047 } ;
00048 
00049 // Configuration keys
00050 //
00051 //
00052 const char * const ToDoConduitFactory::group = "todoOptions" ;
00053 
00054 
00055 KAboutData *ToDoConduitFactory::fAbout = 0L;
00056 ToDoConduitFactory::ToDoConduitFactory(QObject *p, const char *n) :
00057         VCalConduitFactoryBase(p,n)
00058 {
00059         FUNCTIONSETUP;
00060 
00061         fInstance = new KInstance("todoconduit");
00062         fAbout = new KAboutData("todoConduit",
00063                 I18N_NOOP("ToDo Conduit for KPilot"),
00064                 KPILOT_VERSION,
00065                 I18N_NOOP("Configures the ToDo Conduit for KPilot"),
00066                 KAboutData::License_GPL,
00067                 "(C) 2001, Adriaan de Groot");
00068         fAbout->addAuthor("Dan Pilone",
00069                 I18N_NOOP("Original Author"));
00070         fAbout->addAuthor("Preston Brown",
00071                 I18N_NOOP("Original Author"));
00072         fAbout->addAuthor("Herwin-Jan Steehouwer",
00073                 I18N_NOOP("Original Author"));
00074         fAbout->addAuthor("Adriaan de Groot",
00075                 I18N_NOOP("Maintainer"),
00076                 "groot@kde.org",
00077                 "http://www.cs.kun.nl/~adridg/kpilot");
00078         fAbout->addAuthor("Reinhold Kainhofer", 
00079                 I18N_NOOP("Maintainer"),
00080                 "reinhold@kainhofer.com",
00081                 "http://reinhold.kainhofer.com/Linux/");
00082 }
00083 
00084 ToDoConduitFactory::~ToDoConduitFactory()
00085 {
00086         FUNCTIONSETUP;
00087 
00088         KPILOT_DELETE(fInstance);
00089         KPILOT_DELETE(fAbout);
00090 }
00091 
00092 /* virtual */ QObject *ToDoConduitFactory::createObject( QObject *p,
00093         const char *n,
00094         const char *c,
00095         const QStringList &a)
00096 {
00097         FUNCTIONSETUP;
00098 
00099 #ifdef DEBUG
00100         DEBUGCONDUIT << fname
00101                 << ": Creating object of class "
00102                 << c
00103                 << endl;
00104 #endif
00105 
00106         if (qstrcmp(c,"ConduitConfig")==0)
00107         {
00108                 QWidget *w = dynamic_cast<QWidget *>(p);
00109 
00110                 if (w)
00111                 {
00112                         return new ToDoWidgetSetup(w,n,a);
00113                 }
00114                 else
00115                 {
00116 #ifdef DEBUG
00117                         DEBUGCONDUIT << fname
00118                                 << ": Couldn't cast parent to widget."
00119                                 << endl;
00120 #endif
00121                         return 0L;
00122                 }
00123         }
00124 
00125         if (qstrcmp(c,"SyncAction")==0)
00126         {
00127                 KPilotDeviceLink *d = dynamic_cast<KPilotDeviceLink *>(p);
00128 
00129                 if (d)
00130                 {
00131                         return new TodoConduit(d,n,a);
00132                 }
00133                 else
00134                 {
00135                         kdError() << k_funcinfo
00136                                 << ": Couldn't cast to KPilotDeviceLink."
00137                                 << endl;
00138                 }
00139         }
00140 
00141         return 0L;
00142 }
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.5.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Sun Feb 15 11:40:45 2004 by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2001