2009-01-05 09:27:53 +01:00
|
|
|
/*
|
|
|
|
* Copyright 2007 Richard J. Moore <rich@kde.org>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Library General Public License as
|
|
|
|
* published by the Free Software Foundation; either version 2, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this program; if not, write to the
|
|
|
|
* Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef PLASMA_UILOADER_H
|
|
|
|
#define PLASMA_UILOADER_H
|
|
|
|
|
2009-01-07 21:35:28 +01:00
|
|
|
#include <KSharedPtr>
|
2009-01-05 09:27:53 +01:00
|
|
|
|
|
|
|
#include <plasma/applet.h>
|
|
|
|
|
|
|
|
class QGraphicsWidget;
|
|
|
|
|
2009-01-07 21:35:28 +01:00
|
|
|
class UiLoader : public QSharedData
|
2009-01-05 09:27:53 +01:00
|
|
|
{
|
|
|
|
public:
|
2009-01-07 21:35:28 +01:00
|
|
|
UiLoader();
|
2009-01-05 09:27:53 +01:00
|
|
|
virtual ~UiLoader();
|
|
|
|
|
|
|
|
QStringList availableWidgets() const;
|
|
|
|
QGraphicsWidget *createWidget(const QString &className, QGraphicsWidget *parent = 0);
|
|
|
|
|
|
|
|
private:
|
2009-01-07 21:35:28 +01:00
|
|
|
typedef QGraphicsWidget *(*widgetCreator)(QGraphicsWidget*);
|
|
|
|
QHash<QString, widgetCreator> m_widgetCtors;
|
2009-01-05 09:27:53 +01:00
|
|
|
};
|
|
|
|
|
2009-01-07 21:35:28 +01:00
|
|
|
|
2009-01-05 09:27:53 +01:00
|
|
|
#endif // PLASMA_UILOADER_H
|