pgLab/pglab/plugin_support/PluginContentWidget.h
eelke 601d071d0f Proof of concept for having the context actions statically defined in the module.
Needs work for correctly placing the items in menu and on toolbar.
Old system still needs to be removed left in place to keep app useable.
2019-08-14 09:06:48 +02:00

38 lines
1,005 B
C++

#ifndef PGLPAGE_H
#define PGLPAGE_H
#include <QWidget>
#include <vector>
class IPluginContentWidgetContext;
class PluginModule;
/// Provides a pluggable system for toolbar buttons and menu actions
///
/// We will need several kind of actions
/// - create actions, these will create a new document or load from file , always available in menu
/// - save actions available when on tab
/// - edit actions
/// - custom menu?
///
/// Can we use same groupings for toolbars and menu's
/// How about additional toolbars?
///
class PluginContentWidget: public QWidget{
public:
PluginContentWidget(IPluginContentWidgetContext *context, PluginModule *module, QWidget* parent = nullptr);
/// Returns the toolbar buttons for this page
virtual bool canClose();
virtual QList<QAction *> actions();
PluginModule *pluginModule();
IPluginContentWidgetContext *context();
protected:
private:
IPluginContentWidgetContext *m_context = nullptr;
PluginModule *m_pluginModule = nullptr;
};
#endif // PGLPAGE_H