xfigimport_factory.cpp
1/*
2 Copyright (C) 2001, Rob Buis <rwlbuis@wanadoo.nl>
3 Copyright (C) 2003, Rob Buis <buis@kde.org>
4 This file is part of the KDE project
5
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public
8 License as published by the Free Software Foundation; either
9 version 2 of the License, or (at your option) any later version.
10
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details.
15
16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
20
21DESCRIPTION
22*/
23
24#include "xfigimport_factory.h"
25#include "xfigimport_factory.moc"
26#include "xfigimport.h"
27
28#include <tdeinstance.h>
29#include <kdebug.h>
30
31K_EXPORT_COMPONENT_FACTORY( libxfigimport, XFIGImportFactory )
32
33TDEInstance *XFIGImportFactory::s_global = 0;
34
35XFIGImportFactory::XFIGImportFactory(
36 TQObject *parent,
37 const char *name) :
38 KLibFactory(parent, name)
39{
40 s_global = new TDEInstance("xfigimport");
41}
42
43XFIGImportFactory::~XFIGImportFactory()
44{
45 delete s_global;
46 s_global = 0L;
47}
48
49TQObject *XFIGImportFactory::createObject(
50 TQObject *parent,
51 const char *name,
52 const char*,
53 const TQStringList &)
54{
55 if (parent && !parent->inherits("KoFilter"))
56 {
57 kdDebug(30502) << "XFIGImportFactory: parent does not inherit KoFilter" << endl;
58 return 0L;
59 }
60 XFIGImport *f = new XFIGImport((KoFilter*)parent, name);
61 return f;
62}
63
64TDEInstance *XFIGImportFactory::global()
65{
66 return s_global;
67}