kpilot Library API Documentation

abbrowser-factory.cc

00001 /* abbrowser-factory.cc                      KPilot
00002 **
00003 ** Copyright (C) 2001 by Dan Pilone
00004 **
00005 ** This file defines the factory for the abbrowser-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 #include "abbrowser-factory.moc"
00031 
00032 #include <kinstance.h>
00033 #include <kaboutdata.h>
00034 
00035 #include "abbrowser-conduit.h"
00036 #include "abbrowser-setup.h"
00037 
00038 
00039 extern "C"
00040 {
00041 
00042 void *init_libaddressconduit()
00043 {
00044         return new AbbrowserConduitFactory;
00045 }
00046 
00047 } ;
00048 
00049 
00050 // A number of static variables; except for fAbout, they're 
00051 // all KConfig group or entry keys.
00052 //
00053 //
00054 KAboutData *AbbrowserConduitFactory::fAbout = 0L;
00055 const char *AbbrowserConduitFactory::fGroup = "Abbrowser-conduit";
00056 
00057 const char *AbbrowserConduitFactory::fSmartMerge = "SmartMerge";
00058 const char *AbbrowserConduitFactory::fResolution = "ConflictResolve";
00059 const char *AbbrowserConduitFactory::fArchive = "ArchiveDeleted";
00060 const char *AbbrowserConduitFactory::fStreetType = "PilotStreet";
00061 const char *AbbrowserConduitFactory::fFaxType = "PilotFax";
00062 const char *AbbrowserConduitFactory::fSyncMode = "SyncMode";
00063 const char *AbbrowserConduitFactory::fFirstSync = "FirstSync";
00064 const char *AbbrowserConduitFactory::fFullSyncOnPCChange = "FullSyncOnPCChange";
00065 const char *AbbrowserConduitFactory::fOtherField = "PilotOther";
00066 
00067 
00068 AbbrowserConduitFactory::AbbrowserConduitFactory(QObject *p, const char *n) :
00069         KLibFactory(p,n)
00070 {
00071         FUNCTIONSETUP;
00072 
00073         fInstance = new KInstance("abbrowserconduit");
00074         fAbout = new KAboutData("abbrowserconduit",
00075                 I18N_NOOP("Abbrowser Conduit for KPilot"),
00076                 KPILOT_VERSION,
00077                 I18N_NOOP("Configures the Abbrowser Conduit for KPilot"),
00078                 KAboutData::License_GPL,
00079                 "(C) 2001, Dan Pilone");
00080         fAbout->addAuthor("Greg Stern",
00081                 I18N_NOOP("Primary Author"));
00082         fAbout->addAuthor("Adriaan de Groot",
00083                 I18N_NOOP("Maintainer"),
00084                 "groot@kde.org",
00085                 "http://www.cs.kun.nl/~adridg/kpilot");
00086         fAbout->addAuthor("Reinhold Kainhofer", I18N_NOOP("Maintainer"), "reinhold@kainhofer.com", "http://reinhold.kainhofer.com");
00087         fAbout->addCredit("David Bishop",
00088                 I18N_NOOP("UI"));
00089 }
00090 
00091 AbbrowserConduitFactory::~AbbrowserConduitFactory()
00092 {
00093         FUNCTIONSETUP;
00094 
00095         KPILOT_DELETE(fInstance);
00096         KPILOT_DELETE(fAbout);
00097 }
00098 
00099 /* virtual */ QObject *AbbrowserConduitFactory::createObject( QObject *p,
00100         const char *n,
00101         const char *c,
00102         const QStringList &a)
00103 {
00104         FUNCTIONSETUP;
00105 
00106 #ifdef DEBUG
00107         DEBUGCONDUIT << fname
00108                 << ": Creating object of class "
00109                 << c
00110                 << endl;
00111 #endif
00112 
00113         if (qstrcmp(c,"ConduitConfig")==0)
00114         {
00115                 QWidget *w = dynamic_cast<QWidget *>(p);
00116 
00117                 if (w)
00118                 {
00119                         return new AbbrowserWidgetSetup(w,n,a);
00120                 }
00121                 else 
00122                 {
00123                         kdError() << k_funcinfo
00124                                 << ": Couldn't cast parent to widget."
00125                                 << endl;
00126                         return 0L;
00127                 }
00128         }
00129 
00130         if (qstrcmp(c,"SyncAction")==0)
00131         {
00132                 KPilotDeviceLink *d = dynamic_cast<KPilotDeviceLink *>(p);
00133 
00134                 if (d)
00135                 {
00136                         return new AbbrowserConduit(d,n,a);
00137                 }
00138                 else
00139                 {
00140                         kdError() << k_funcinfo
00141                                 << ": Couldn't cast parent to KPilotDeviceLink"
00142                                 << endl;
00143                         return 0L;
00144                 }
00145         }
00146 
00147         return 0L;
00148 }
00149 
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:43 2004 by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2001