kpilot Library API Documentation

vcal-factory.cc

00001 /* vcal-factory.cc                      KPilot
00002 **
00003 ** Copyright (C) 2001 by Dan Pilone
00004 **
00005 ** This file defines the factory for the vcal-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 "vcal-setup.h"
00035 #include "vcal-conduit.h"
00036 #include "vcal-factory.moc"
00037 
00038 
00039 extern "C"
00040 {
00041 
00042 void *init_libvcalconduit()
00043 {
00044         return new VCalConduitFactory;
00045 }
00046 
00047 } ;
00048 
00049 // Configuration keys
00050 //
00051 //
00052 const char * const VCalConduitFactory::group = "vcalOptions" ;
00053 
00054 
00055 KAboutData *VCalConduitFactory::fAbout = 0L;
00056 VCalConduitFactory::VCalConduitFactory(QObject *p, const char *n) :
00057         VCalConduitFactoryBase(p,n)
00058 {
00059         FUNCTIONSETUP;
00060 
00061         fInstance = new KInstance("vcalconduit");
00062         fAbout = new KAboutData("vcalConduit",
00063                 I18N_NOOP("VCal Conduit for KPilot"),
00064                 KPILOT_VERSION,
00065                 I18N_NOOP("Configures the VCal Conduit for KPilot"),
00066                 KAboutData::License_GPL,
00067                 "(C) 2001, Adriaan de Groot");
00068         fAbout->addAuthor("Adriaan de Groot",
00069                 I18N_NOOP("Maintainer"),
00070                 "groot@kde.org",
00071                 "http://www.cs.kun.nl/~adridg/kpilot");
00072         fAbout->addAuthor("Reinhold Kainhofer", 
00073                 I18N_NOOP("Maintainer"),
00074                 "reinhold@kainhofer.com",
00075                 "http://reinhold.kainhofer.com/Linux/");
00076         fAbout->addAuthor("Dan Pilone",
00077                 I18N_NOOP("Original Author"));
00078         fAbout->addAuthor("Preston Brown",
00079                 I18N_NOOP("Original Author"));
00080         fAbout->addAuthor("Herwin-Jan Steehouwer",
00081                 I18N_NOOP("Original Author"));
00082         fAbout->addAuthor("Cornelius Schumacher",
00083                 I18N_NOOP("iCalendar port"));
00084         fAbout->addCredit("Philipp Hullmann",
00085                 I18N_NOOP("Bugfixer"));
00086 }
00087 
00088 VCalConduitFactory::~VCalConduitFactory()
00089 {
00090         FUNCTIONSETUP;
00091 
00092         KPILOT_DELETE(fInstance);
00093         KPILOT_DELETE(fAbout);
00094 }
00095 
00096 /* virtual */ QObject *VCalConduitFactory::createObject( QObject *p,
00097         const char *n,
00098         const char *c,
00099         const QStringList &a)
00100 {
00101         FUNCTIONSETUP;
00102 
00103 #ifdef DEBUG
00104         DEBUGCONDUIT << fname
00105                 << ": Creating object of class "
00106                 << c
00107                 << endl;
00108 #endif
00109 
00110         if (qstrcmp(c,"ConduitConfig")==0)
00111         {
00112                 QWidget *w = dynamic_cast<QWidget *>(p);
00113 
00114                 if (w)
00115                 {
00116                         return new VCalWidgetSetup(w,n,a);
00117                 }
00118                 else
00119                 {
00120 #ifdef DEBUG
00121                         DEBUGCONDUIT << fname
00122                                 << ": Couldn't cast parent to widget."
00123                                 << endl;
00124 #endif
00125                         return 0L;
00126                 }
00127         }
00128 
00129         if (qstrcmp(c,"SyncAction")==0)
00130         {
00131                 KPilotDeviceLink *d = dynamic_cast<KPilotDeviceLink *>(p);
00132 
00133                 if (d)
00134                 {
00135                         return new VCalConduit(d,n,a);
00136                 }
00137                 else
00138                 {
00139                         kdError() << k_funcinfo
00140                                 << ": Couldn't cast to KPilotDeviceLink."
00141                                 << endl;
00142                 }
00143         }
00144 
00145         return 0L;
00146 }
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