QCAD
Open Source 2D CAD
Loading...
Searching...
No Matches
RPluginInterface.h
Go to the documentation of this file.
1
20#ifndef RPLUGININTERFACE_H
21#define RPLUGININTERFACE_H
22
23#include "core_global.h"
24
25#include <QtPlugin>
26#include <QMetaType>
27
28#include "RPluginInfo.h"
29
30class QString;
31#if QT_VERSION < 0x060000
32class QScriptEngine;
33#else
34class RScriptHandler;
35#endif
36
44public:
55
56public:
57 virtual ~RPluginInterface() {}
58
64 virtual bool init() = 0;
65
69 virtual void uninit(bool remove = false) = 0;
70
76 virtual void postInit(RPluginInterface::InitStatus status) = 0;
77
78#if QT_VERSION < 0x060000
86 virtual void initScriptExtensions(QScriptEngine& engine) = 0;
87#else
88 virtual void initScriptExtensions(RScriptHandler& handler) {}
89#endif
90
96 virtual void initTranslations() = 0;
97
109
113 virtual bool checkLicense() = 0;
114};
115
116QT_BEGIN_NAMESPACE
117Q_DECLARE_INTERFACE(RPluginInterface, "org.qcad.QCAD.RPluginInterface/1.0")
118QT_END_NAMESPACE
119
123
124#endif
Q_DECLARE_METATYPE(RMath *)
Information about a plugin.
Definition RPluginInfo.h:42
Interface for all C++ QCAD plugins.
Definition RPluginInterface.h:43
virtual void initScriptExtensions(QScriptEngine &engine)=0
Called whenever a new script engine is instantiated.
InitStatus
Definition RPluginInterface.h:45
@ ActionsAdded
Actions have been added to widgets.
Definition RPluginInterface.h:48
@ ScriptsExecuted
Executed scripts given on command line.
Definition RPluginInterface.h:52
@ GotSplashWindow
Splashscreen showing.
Definition RPluginInterface.h:46
@ AddOnsInitialized
Add ons are initialized, actions created but not added to widgets.
Definition RPluginInterface.h:47
@ LoadedFiles
Loaded files given on command line.
Definition RPluginInterface.h:51
@ GotMainWindowBeforeShow
Main window created but not shown yet.
Definition RPluginInterface.h:49
@ GotMainWindow
Main window with all tools and menus has been created.
Definition RPluginInterface.h:50
virtual void postInit(RPluginInterface::InitStatus status)=0
Called after the application has been fully loaded, directly before entering the main event loop.
virtual bool init()=0
Called immediately after the plugin has been loaded, directly after starting the application.
virtual void uninit(bool remove=false)=0
Called before a plugin is removed / unloaded.
virtual RPluginInfo getPluginInfo()=0
virtual ~RPluginInterface()
Definition RPluginInterface.h:57
virtual bool checkLicense()=0
virtual void initTranslations()=0
Called when the user chosen language changed.
Abstract base class for all script handlers.
Definition RScriptHandler.h:58
#define QCADCORE_EXPORT
Definition core_global.h:10