2009-02-01 11:37:07 -05:00
|
|
|
#ifndef _PLUGINS_PAGE_H_
|
|
|
|
#define _PLUGINS_PAGE_H_
|
|
|
|
|
|
|
|
#include "mainpage.h"
|
|
|
|
|
2009-02-05 10:29:43 -05:00
|
|
|
#include <QGroupBox>
|
|
|
|
#include <QString>
|
|
|
|
#include <QDir>
|
|
|
|
|
2009-02-01 11:37:07 -05:00
|
|
|
class QVBoxLayout;
|
|
|
|
class QTabWidget;
|
|
|
|
class QFrame;
|
|
|
|
class QLabel;
|
2009-02-05 10:29:43 -05:00
|
|
|
class QTextEdit;
|
|
|
|
class QSpacerItem;
|
|
|
|
|
2009-02-01 11:37:07 -05:00
|
|
|
class QScriptEngine;
|
|
|
|
|
2009-02-05 10:29:43 -05:00
|
|
|
class PluginManager;
|
|
|
|
|
2009-02-09 16:01:41 -05:00
|
|
|
|
|
|
|
//! A demo widget for showing plugin engine in action :)
|
|
|
|
|
|
|
|
//! In current version this is just a container for PluginManagerWidget and
|
|
|
|
//! loaded plugin widgets. All specific actions moved to
|
|
|
|
//! PluginManagerWidget class. It contains a PluginManager instance, but it's
|
|
|
|
//! supposed that in future a pluginManager will become a global variable
|
2009-02-01 11:37:07 -05:00
|
|
|
class PluginsPage : public MainPage
|
|
|
|
{
|
2009-02-05 10:29:43 -05:00
|
|
|
Q_OBJECT
|
2009-02-01 11:37:07 -05:00
|
|
|
|
|
|
|
public:
|
|
|
|
/** Default Constructor */
|
2009-02-05 10:29:43 -05:00
|
|
|
PluginsPage(QWidget *parent = 0);
|
2009-02-01 11:37:07 -05:00
|
|
|
/** Default Destructor */
|
2009-02-05 10:29:43 -05:00
|
|
|
virtual ~PluginsPage() ;
|
|
|
|
|
|
|
|
public slots:
|
2009-02-09 16:01:41 -05:00
|
|
|
//! A slot for processing new plugin registration events.
|
2009-02-05 10:29:43 -05:00
|
|
|
|
2009-02-09 16:01:41 -05:00
|
|
|
//! Every page, which supports plugins, has to process
|
|
|
|
//! the PluginManager::newPluginRegistered signal. Suppose, the page knows,
|
|
|
|
//! that there is a possible plugin "PuzzleGame"; Then, the page should
|
|
|
|
//! compare received pluginName with "PuzzleGame", and request the plugin
|
|
|
|
//! widget with PluginManager::pluginWidget(..) method
|
|
|
|
void pluginRegistered(QString pluginName);
|
2009-02-01 11:37:07 -05:00
|
|
|
|
|
|
|
protected:
|
2009-02-05 10:29:43 -05:00
|
|
|
QVBoxLayout* pluginPageLayout;
|
|
|
|
QGroupBox* pluginPanel;
|
|
|
|
QVBoxLayout* pluginPanelLayout;
|
|
|
|
|
2009-02-09 16:01:41 -05:00
|
|
|
//! Plugin widgets will be loaded into this tabs
|
2009-02-05 10:29:43 -05:00
|
|
|
QTabWidget* pluginTabs ;
|
2009-02-09 16:01:41 -05:00
|
|
|
|
2009-02-05 10:29:43 -05:00
|
|
|
QVBoxLayout* pmLay;
|
|
|
|
QFrame* pmFrame;
|
|
|
|
QSpacerItem* pmSpacer;
|
2009-02-01 11:37:07 -05:00
|
|
|
|
2009-02-09 16:01:41 -05:00
|
|
|
//! This should be global, every page should have access to it
|
|
|
|
PluginManager* pluginManager;
|
2009-02-01 11:37:07 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
2009-02-05 10:29:43 -05:00
|
|
|
|