dRonin  adbada4
dRonin GCS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
ExtensionSystem::IPlugin Class Referenceabstract

Base class for all plugins. More...

#include <iplugin.h>

Inheritance diagram for ExtensionSystem::IPlugin:
AeroQuadPlugin BrainFPVPlugin BrotronicsPlugin BrowserPlugin ConfigPlugin Core::IConfigurablePlugin Core::Internal::CorePlugin DebugPlugin DialPlugin DroninPlugin DTFPlugin EmptyPlugin GCSControl GpsDisplayPlugin ImportExportPlugin IPConnectionPlugin KmlExportPlugin LineardialPlugin LoggingPlugin MagicWaypointPlugin MatekPlugin ModelViewPlugin MyPlugin::MyPluginImpl OpenPilotPlugin OPMapPlugin PathPlannerPlugin PfdQmlPlugin Plugin1::MyPlugin1 Plugin1::MyPlugin1 Plugin1::MyPlugin1 Plugin2::MyPlugin2 Plugin2::MyPlugin2 Plugin2::MyPlugin2 Plugin3::MyPlugin3 Plugin3::MyPlugin3 Plugin3::MyPlugin3 QmlViewPlugin QuantecPlugin RawHIDPlugin ScopePlugin SerialPlugin SetupWizardPlugin SysAlarmsMessagingPlugin SystemHealthPlugin TauLabsPlugin TelemetrySchedulerPlugin UAVObjectsPlugin UAVObjectUtilPlugin UAVObjectWidgetUtilsPlugin UAVSettingsImportExportPlugin UAVTalkPlugin UploaderPlugin Welcome::Internal::WelcomePlugin

Public Member Functions

 IPlugin ()
 
virtual ~IPlugin ()
 
virtual bool initialize (const QStringList &arguments, QString *errorString)=0
 
virtual void extensionsInitialized ()=0
 
virtual void shutdown ()
 
PluginSpecpluginSpec () const
 
void addObject (QObject *obj)
 
void addAutoReleasedObject (QObject *obj)
 
void removeObject (QObject *obj)
 

Friends

class Internal::PluginSpecPrivate
 

Detailed Description

Base class for all plugins.

The IPlugin class is an abstract class that must be implemented once for each plugin. A plugin consists of two parts: A description file, and a library that at least contains the IPlugin implementation.

Definition at line 45 of file iplugin.h.

Constructor & Destructor Documentation

IPlugin::IPlugin ( )

Definition at line 256 of file iplugin.cpp.

IPlugin::~IPlugin ( )
virtual

Definition at line 265 of file iplugin.cpp.

Member Function Documentation

void IPlugin::addAutoReleasedObject ( QObject *  obj)

Convenience method for registering obj in the plugin manager's plugin pool. Usually, registered objects must be removed from the object pool and deleted by hand. Objects added to the pool via addAutoReleasedObject are automatically removed and deleted in reverse order of registration when the IPlugin instance is destroyed.

See Also
PluginManager::addObject()

Definition at line 306 of file iplugin.cpp.

void IPlugin::addObject ( QObject *  obj)

Convenience method that registers obj in the plugin manager's plugin pool by just calling PluginManager::addObject().

Definition at line 291 of file iplugin.cpp.

void IPlugin::extensionsInitialized ( )
pure virtual

Called after the IPlugin::initialize() method has been called, and after both the IPlugin::initialize() and IPlugin::extensionsInitialized() methods of plugins that depend on this plugin have been called. In this method, the plugin can assume that plugins that depend on this plugin are fully 'up and running'. It is a good place to look in the plugin manager's object pool for objects that have been provided by dependent plugins.

See Also
initialize()

Implemented in MyPlugin::MyPluginImpl, Plugin1::MyPlugin1, Plugin2::MyPlugin2, Plugin3::MyPlugin3, Plugin1::MyPlugin1, Plugin2::MyPlugin2, Plugin3::MyPlugin3, Plugin1::MyPlugin1, Plugin2::MyPlugin2, and Plugin3::MyPlugin3.

bool IPlugin::initialize ( const QStringList &  arguments,
QString *  errorString 
)
pure virtual

Called after the plugin has been loaded and the IPlugin instance has been created. The initialize methods of plugins that depend on this plugin are called after the initialize method of this plugin has been called. Plugins should initialize their internal state in this method. Returns if initialization of successful. If it wasn't successful, the errorString should be set to a user-readable message describing the reason.

See Also
extensionsInitialized()

Implemented in MyPlugin::MyPluginImpl, Plugin1::MyPlugin1, Plugin2::MyPlugin2, Plugin3::MyPlugin3, Plugin1::MyPlugin1, Plugin2::MyPlugin2, Plugin3::MyPlugin3, Plugin1::MyPlugin1, Plugin2::MyPlugin2, and Plugin3::MyPlugin3.

PluginSpec * IPlugin::pluginSpec ( ) const

Returns the PluginSpec corresponding to this plugin. This is not available in the constructor.

Definition at line 281 of file iplugin.cpp.

void IPlugin::removeObject ( QObject *  obj)

Convenience method that unregisters obj from the plugin manager's plugin pool by just calling PluginManager::removeObject().

Definition at line 317 of file iplugin.cpp.

void IPlugin::shutdown ( )
inlinevirtual

Called during a shutdown sequence in the same order as initialization before the plugins get deleted in reverse order. This method can be used to optimize the shutdown down, e.g. to disconnect from the PluginManager::aboutToRemoveObject() signal if getting the signal (and probably doing lots of stuff to update the internal and visible state) doesn't make sense during shutdown.

Definition at line 55 of file iplugin.h.

Friends And Related Function Documentation

friend class Internal::PluginSpecPrivate
friend

Definition at line 66 of file iplugin.h.


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