umbrello/umbrello
#include <plugin.h>
Public Member Functions | |
virtual | ~Plugin () |
virtual QString | category () |
KConfig * | config () |
QByteArray | instanceName () const |
void | unload () |
Public Member Functions inherited from Umbrello::Configurable | |
Configurable () | |
virtual | ~Configurable () |
Protected Member Functions | |
Plugin (QObject *parent, const char *name, const QStringList &args) | |
virtual bool | onInit () |
virtual bool | onShutdown () |
Protected Member Functions inherited from Umbrello::Configurable | |
bool | loadPlugins (KConfig *config, const QString &group, const QString &key) |
bool | unloadPlugins () |
Protected Attributes | |
KConfig * | _config |
QByteArray | _instanceName |
uint | _ref |
Detailed Description
The Plugin class is the base class for all modular functionality in the core Umbrello library.
Because Umbrello is a plugin architecture, this class is derived from many times. Plugins are created via the KLibFactory of the encapsulating shared library and created from some other functional object (application, tool or plugin). After the plugin has been created, the init method is called. Before unloading, the shutdown method is called. Derived plugins can implement specific startup/shutdown behavior by overloading the onInit and onShutdown methods respectively.
By default, plugins use a configuration group called [LoadActions] in the config file. Entries in this group define any dependant or on-demand plugins that should be loaded in conjunction with this plugin. Known entries (actions) are "Load" and "LoadGUI". Because plugins can be used by both GUI and command line tools, they must be selective about some functionality. Specifically, during configuration, a plugin for a tool must not load GUI plugins.
In order to provide application-like functionality, this class offers support for accessing the configuration records of the KComponentData object corresponding to the shared library. Because the KComponentData object is only available within the scope of the shared library, the configuration records must be set in the constructor of the derived plugin class. However, because the construction name is passed to this constructor (as are the parent object and args), we can simply capture the name when the object is constructed.
Constructor & Destructor Documentation
|
virtual |
Destroy a plugin.
Definition at line 42 of file plugin.cpp.
|
protected |
Construct a plugin.
Definition at line 31 of file plugin.cpp.
Member Function Documentation
|
virtual |
Return the category descriptor string.
Definition at line 159 of file plugin.cpp.
KConfig * Plugin::config | ( | ) |
Return the configuration record for the plugin.
Definition at line 116 of file plugin.cpp.
QByteArray Plugin::instanceName | ( | ) | const |
Return the instance name of the plugin.
Definition at line 110 of file plugin.cpp.
|
protectedvirtual |
Can be reimplemented to define plugin specific startup behavior.
Definition at line 122 of file plugin.cpp.
|
protectedvirtual |
Can be reimplemented to define plugin specific shutdown behavior.
Definition at line 128 of file plugin.cpp.
void Plugin::unload | ( | ) |
Unload the plugin.
This method actually only decrements the reference count. When the refcount is 0, the object calls shutdown and deletes itself.
Definition at line 53 of file plugin.cpp.
Member Data Documentation
|
protected |
|
protected |
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:06:03 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.