Radium Engine  1.5.0
RadiumPluginInterface.hpp
1 #pragma once
2 
3 #include <memory>
4 #include <vector>
5 
6 #include <QObject>
7 #include <QtPlugin>
8 
9 #include <PluginBase/PluginContext.hpp> // do not use forward declaration to ease usage in Plugin
10 
11 class QWidget;
12 class QMenu;
13 class QAction;
14 class QOpenGLContext;
15 class QString;
16 
17 namespace Ra {
18 
19 namespace Engine {
20 namespace Rendering {
21 class Renderer;
22 }
23 } // namespace Engine
24 
25 namespace Core {
26 namespace Asset {
27 class FileLoaderInterface;
28 }
29 } // namespace Core
30 
31 namespace Plugins {
73 {
74 
75  public:
76  virtual ~RadiumPluginInterface() {}
77 
85  virtual void registerPlugin( const Context& context ) = 0;
86 
94  virtual bool doAddWidget( QString& name ) = 0;
95 
103  virtual QWidget* getWidget() = 0;
104 
110  virtual bool doAddMenu() = 0;
111 
117  virtual QMenu* getMenu() = 0;
118 
125  virtual bool doAddAction( int& nb ) = 0;
126 
133  virtual QAction* getAction( int id ) = 0;
134 
139  virtual bool doAddRenderer() { return false; }
140 
148  virtual void
149  addRenderers( std::vector<std::shared_ptr<Ra::Engine::Rendering::Renderer>>* /*rds*/ ) {}
150 
155  virtual bool doAddFileLoader() { return false; }
156 
161  virtual void
162  addFileLoaders( std::vector<std::shared_ptr<Core::Asset::FileLoaderInterface>>* /*fl*/ ) {}
163 
184  virtual void openGlInitialize( const Context& /*context*/ ) {}
185 
191  virtual bool doAddROpenGLInitializer() { return false; }
192 };
193 } // namespace Plugins
194 } // namespace Ra
195 
196 #define RadiumPluginInterface_IID "RadiumEngine.PluginInterface"
197 Q_DECLARE_INTERFACE( Ra::Plugins::RadiumPluginInterface, RadiumPluginInterface_IID )
Data passed to the plugin constructor.
Interface class for Radiums plugins.
virtual void registerPlugin(const Context &context)=0
Pass arguments for plugin initialization. This method must create and register all the services that ...
virtual QAction * getAction(int id)=0
Returns the action to be added to the ui and then returns it.
virtual void addFileLoaders(std::vector< std::shared_ptr< Core::Asset::FileLoaderInterface >> *)
virtual QWidget * getWidget()=0
Creates the widget to be added to the ui and then returns it. If connections are needed (between plug...
virtual void addRenderers(std::vector< std::shared_ptr< Ra::Engine::Rendering::Renderer >> *)
addRenderers
virtual bool doAddWidget(QString &name)=0
Tells wether the plugin wants to add a widget (inside the UI tab widget) or not. If it does,...
virtual bool doAddMenu()=0
Tells wether the plugin wants to add a menu or not. If it does, getMenu() will be called.
virtual QMenu * getMenu()=0
Creates to menu to be added to the ui and then returns it.
virtual bool doAddAction(int &nb)=0
Tells wether the plugin wants to add actions or not. If it does, getAction() will be called for each ...
virtual void openGlInitialize(const Context &)
openGlInitialize
Definition: Cage.cpp:3