KDevelop API Documentation

pgioptionsfactory.cpp

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2001 by Bernd Gehrmann                                  *
00003  *   bernd@kdevelop.org                                                    *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  ***************************************************************************/
00011 
00012 #include <kdebug.h>
00013 #include <kinstance.h>
00014 #include "pgioptionsplugin.h"
00015 #include "pgioptionsfactory.h"
00016 
00017 
00018 extern "C" {
00019 
00020     void *init_libkdevpgioptions()
00021     {
00022         return new PgiOptionsFactory;
00023     }
00024     
00025 }
00026 
00027 
00028 PgiOptionsFactory::PgiOptionsFactory(QObject *parent, const char *name)
00029     : KLibFactory(parent, name)
00030 {
00031     instance();
00032 }
00033 
00034 
00035 PgiOptionsFactory::~PgiOptionsFactory()
00036 {
00037     delete s_instance;
00038     s_instance = 0;
00039 }
00040 
00041 
00042 QObject *PgiOptionsFactory::createObject(QObject *parent, const char *name,
00043                                          const char * /*classname*/, const QStringList &args)
00044 {
00045     if (args.count() > 0 && qstrcmp(args[0].latin1(), "pghpf") == 0) {
00046         kdDebug(9021) << "Building PgiOptions for PGHPF" << endl;
00047         return new PgiOptionsPlugin(PgiOptionsPlugin::PGHPF, parent, name);
00048     } else if (args.count() > 0 && qstrcmp(args[0].latin1(), "pgf77") == 0) {
00049         kdDebug(9021) << "Building PgiOptions for PGF77" << endl;
00050         return new PgiOptionsPlugin(PgiOptionsPlugin::PGF77, parent, name);
00051     } else {
00052         kdDebug(9021) << "Wrong args for kdevpgioptions library" << endl;
00053         if (args.count() > 0)
00054             kdDebug(9021) << args[0] << endl;
00055         return 0;
00056     }
00057 }
00058 
00059 
00060 KInstance *PgiOptionsFactory::s_instance = 0;
00061 KInstance *PgiOptionsFactory::instance()
00062 {
00063     if (!s_instance)
00064         s_instance = new KInstance("kdevpgioptions");
00065 
00066     return s_instance;
00067 }
00068 
00069 #include "pgioptionsfactory.moc"
KDE Logo
This file is part of the documentation for KDevelop Version 3.1.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Feb 22 09:22:30 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003