1 /* This file is part of the KDE project
2 Copyright (C) 1999 Simon Hausmann <hausmann@kde.org>
3 (C) 1999 David Faure <faure@kde.org>
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
24 #include <QtGui/QWidget>
28 #include <kcomponentdata.h>
31 using namespace KParts
;
33 Factory::Factory( QObject
*parent
)
34 : KLibFactory( parent
)
42 Part
*Factory::createPart( QWidget
*parentWidget
, QObject
*parent
, const char *classname
, const QStringList
&args
)
44 Part
* part
= createPartObject( parentWidget
, parent
, classname
, args
);
46 emit
objectCreated( part
);
50 KComponentData
Factory::partComponentData()
52 return KComponentData();
55 KComponentData
Factory::partComponentDataFromLibrary( const QString
&libraryName
)
57 KLibrary
*library
= KLibLoader::self()->library( libraryName
);
59 return KComponentData();
60 KLibFactory
*factory
= library
->factory();
62 return KComponentData();
63 KParts::Factory
*pfactory
= dynamic_cast<KParts::Factory
*>( factory
);
65 return KComponentData();
66 return pfactory
->partComponentData();
69 Part
*Factory::createPartObject( QWidget
*, QObject
*, const char *, const QStringList
& )
74 QObject
*Factory::createObject( QObject
*parent
, const char *classname
, const QStringList
&args
)
76 assert( !parent
|| parent
->isWidgetType() );
77 return createPart( static_cast<QWidget
*>( parent
), parent
, classname
, args
);
80 #include "factory.moc"