QCAD
Open Source 2D CAD
RPluginInterface Class Referenceabstract

Interface for all C++ QCAD plugins. More...

#include <RPluginInterface.h>

Inheritance diagram for RPluginInterface:
RDxfPlugin RScriptsPlugin

Public Types

enum  InitStatus {
  GotSplashWindow, AddOnsInitialized, ActionsAdded, GotMainWindowBeforeShow,
  GotMainWindow, LoadedFiles, ScriptsExecuted, AllDone
}
 

Public Member Functions

virtual bool checkLicense ()=0
 
virtual RPluginInfo getPluginInfo ()=0
 
virtual bool init ()=0
 Called immediately after the plugin has been loaded, directly after starting the application. More...
 
virtual void initScriptExtensions (QScriptEngine &engine)=0
 Called whenever a new script engine is instantiated. More...
 
virtual void initTranslations ()=0
 Called when the user chosen language changed. More...
 
virtual void postInit (RPluginInterface::InitStatus status)=0
 Called after the application has been fully loaded, directly before entering the main event loop. More...
 
virtual void uninit (bool remove=false)=0
 Called before a plugin is removed / unloaded. More...
 
virtual ~RPluginInterface ()
 

Detailed Description

Interface for all C++ QCAD plugins.

Scriptable:\nThis class is available in script environments.\n

Member Enumeration Documentation

◆ InitStatus

Enumerator
GotSplashWindow 

Splashscreen showing.

AddOnsInitialized 

Add ons are initialized, actions created but not added to widgets.

ActionsAdded 

Actions have been added to widgets.

GotMainWindowBeforeShow 

Main window created but not shown yet.

GotMainWindow 

Main window with all tools and menus has been created.

LoadedFiles 

Loaded files given on command line.

ScriptsExecuted 

Executed scripts given on command line.

AllDone 

Application is ready and idle.

Constructor & Destructor Documentation

◆ ~RPluginInterface()

virtual RPluginInterface::~RPluginInterface ( )
inlinevirtual

Member Function Documentation

◆ checkLicense()

virtual bool RPluginInterface::checkLicense ( )
pure virtual
Returns
True if the plugin license is valid.

Implemented in RDxfPlugin, and RScriptsPlugin.

◆ getPluginInfo()

virtual RPluginInfo RPluginInterface::getPluginInfo ( )
pure virtual
Returns
An RPluginInfo object with at least the following keys:
  • 'Version' - Version string
  • 'Name' - Plugin name
  • 'Description' - Longer description of the plugin
  • 'License' - Licensing information (e.g. 'GPLv3', 'proprietary', ...)
  • 'URL' - URL where more information about the plugin can be found

This is typically used by an about dialog or debugging / developer tools.

Implemented in RDxfPlugin, and RScriptsPlugin.

◆ init()

virtual bool RPluginInterface::init ( )
pure virtual

Called immediately after the plugin has been loaded, directly after starting the application.

Implementations typically perform plugin initialization, registration of file importers, exporter, etc.

Implemented in RDxfPlugin, and RScriptsPlugin.

◆ initScriptExtensions()

virtual void RPluginInterface::initScriptExtensions ( QScriptEngine &  engine)
pure virtual

Called whenever a new script engine is instantiated.

Implementations may register their own script extensions by making C / C++ code scriptable.

Non-Scriptable:\nThis function is not available in script environments.\n

Implemented in RScriptsPlugin, and RDxfPlugin.

◆ initTranslations()

virtual void RPluginInterface::initTranslations ( )
pure virtual

Called when the user chosen language changed.

Non-Scriptable:\nThis function is not available in script environments.\n

Implemented in RDxfPlugin, and RScriptsPlugin.

◆ postInit()

virtual void RPluginInterface::postInit ( RPluginInterface::InitStatus  status)
pure virtual

Called after the application has been fully loaded, directly before entering the main event loop.

Implementations typically perform initialization that depends on the application being up and running.

Implemented in RDxfPlugin, and RScriptsPlugin.

◆ uninit()

virtual void RPluginInterface::uninit ( bool  remove = false)
pure virtual

Called before a plugin is removed / unloaded.

Implemented in RDxfPlugin, and RScriptsPlugin.


The documentation for this class was generated from the following file: