filters

xfigimport_factory.cc

00001 /*
00002     Copyright (C) 2001, Rob Buis <rwlbuis@wanadoo.nl>
00003     Copyright (C) 2003, Rob Buis <buis@kde.org>
00004     This file is part of the KDE project
00005 
00006     This library is free software; you can redistribute it and/or
00007     modify it under the terms of the GNU Library General Public
00008     License as published by the Free Software Foundation; either
00009     version 2 of the License, or (at your option) any later version.
00010 
00011     This library is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014     Library General Public License for more details.
00015 
00016     You should have received a copy of the GNU Library General Public License
00017     along with this library; see the file COPYING.LIB.  If not, write to
00018     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00019  * Boston, MA 02110-1301, USA.
00020 
00021 DESCRIPTION
00022 */
00023 
00024 #include "xfigimport_factory.h"
00025 #include "xfigimport_factory.moc"
00026 #include "xfigimport.h"
00027 
00028 #include <kinstance.h>
00029 #include <kdebug.h>
00030 
00031 K_EXPORT_COMPONENT_FACTORY( libxfigimport, XFIGImportFactory )
00032 
00033 KInstance *XFIGImportFactory::s_global = 0;
00034 
00035 XFIGImportFactory::XFIGImportFactory(
00036     QObject *parent,
00037     const char *name) :
00038         KLibFactory(parent, name)
00039 {
00040     s_global = new KInstance("xfigimport");
00041 }
00042 
00043 XFIGImportFactory::~XFIGImportFactory()
00044 {
00045     delete s_global;
00046     s_global = 0L;
00047 }
00048 
00049 QObject *XFIGImportFactory::createObject(
00050     QObject *parent,
00051     const char *name,
00052     const char*,
00053     const QStringList &)
00054 {
00055     if (parent && !parent->inherits("KoFilter"))
00056     {
00057         kdDebug(30502) << "XFIGImportFactory: parent does not inherit KoFilter" << endl;
00058         return 0L;
00059     }
00060     XFIGImport *f = new XFIGImport((KoFilter*)parent, name);
00061     return f;
00062 }
00063 
00064 KInstance *XFIGImportFactory::global()
00065 {
00066     return s_global;
00067 }
KDE Home | KDE Accessibility Home | Description of Access Keys