Plasma
#include <pluginloader.h>
Public Member Functions | |
PluginLoader () | |
virtual | ~PluginLoader () |
KPluginInfo::List | listAppletInfo (const QString &category, const QString &parentApp=QString()) |
KPluginInfo::List | listDataEngineInfo (const QString &parentApp=QString()) |
KPluginInfo::List | listRunnerInfo (const QString &parentApp=QString()) |
Applet * | loadApplet (const QString &name, uint appletId=0, const QVariantList &args=QVariantList()) |
DataEngine * | loadDataEngine (const QString &name) |
AbstractRunner * | loadRunner (const QString &name) |
Service * | loadService (const QString &name, const QVariantList &args, QObject *parent=0) |
Static Public Member Functions | |
static PluginLoader * | pluginLoader () |
static void | setPluginLoader (PluginLoader *loader) |
Protected Member Functions | |
virtual KPluginInfo::List | internalAppletInfo (const QString &category) const |
virtual KPluginInfo::List | internalDataEngineInfo () const |
virtual Applet * | internalLoadApplet (const QString &name, uint appletId=0, const QVariantList &args=QVariantList()) |
virtual DataEngine * | internalLoadDataEngine (const QString &name) |
virtual AbstractRunner * | internalLoadRunner (const QString &name) |
virtual Service * | internalLoadService (const QString &name, const QVariantList &args, QObject *parent=0) |
virtual KPluginInfo::List | internalRunnerInfo () const |
virtual KPluginInfo::List | internalServiceInfo () const |
KPluginInfo::List | standardInternalAppletInfo (const QString &category) const |
KPluginInfo::List | standardInternalDataEngineInfo () const |
KPluginInfo::List | standardInternalRunnerInfo () const |
KPluginInfo::List | standardInternalServiceInfo () const |
Detailed Description
This is an abstract base class which defines an interface to which Plasma's Applet Loading logic can communicate with a parent application.
The plugin loader must be set before any plugins are loaded, otherwise (for safety reasons), the default PluginLoader implementation will be used. The reimplemented version should not do more than simply returning a loaded plugin. It should not init() it, and it should not hang on to it. The associated methods will be called only when a component of Plasma needs to load a new plugin. (e.g. DataEngine does its own caching).
- Since
- 4.6
Definition at line 51 of file pluginloader.h.
Constructor & Destructor Documentation
Plasma::PluginLoader::PluginLoader | ( | ) |
Definition at line 48 of file pluginloader.cpp.
|
virtual |
Definition at line 53 of file pluginloader.cpp.
Member Function Documentation
|
protectedvirtual |
A re-implementable method that allows subclasses to provide additional applets for listAppletInfo.
If the application has no applets to give to the application, then the implementation should return an empty list.
This method is called by listAppletInfo prior to generating the list of applets installed on the system using the standard Plasma plugin mechanisms, and will try to find .desktop files for your applets.
- Parameters
-
category Only applets matching this category will be returned. Useful in conjunction with knownCategories. If "Misc" is passed in, then applets without a Categories= entry are also returned. If an empty string is passed in, all applets are returned.
- Returns
- list of applets
Definition at line 347 of file pluginloader.cpp.
|
protectedvirtual |
A re-implementable method that allows subclasses to provide additional DataEngines for DataEngineManager::listDataEngines.
- Returns
- list of DataEngines, or an empty list if none
Definition at line 353 of file pluginloader.cpp.
|
protectedvirtual |
A re-implementable method that allows subclasses to override the default behaviour of loadApplet.
If the applet requested is not recognized, then the implementation should return a NULL pointer. This method is called by loadApplet prior to attempting to load an applet using the standard Plasma plugin mechanisms.
- Parameters
-
name the plugin name, as returned by KPluginInfo::pluginName() appletId unique ID to assign the applet, or zero to have one assigned automatically. args to send the applet extra arguments
- Returns
- a pointer to the loaded applet, or 0 on load failure
Definition at line 319 of file pluginloader.cpp.
|
protectedvirtual |
A re-implementable method that allows subclasses to override the default behaviour of loadDataEngine.
If the engine requested is not recognized, then the implementation should return a NULL pointer. This method is called by loadDataEngine prior to attempting to load a DataEgine using the standard Plasma plugin mechanisms.
- Parameters
-
name the name of the engine
- Returns
- the data engine that was loaded, or the NullEngine on failure.
Definition at line 327 of file pluginloader.cpp.
|
protectedvirtual |
A re-implementable method that allows subclasses to override the default behaviour of loadRunner.
If the runner requested is not recognized, then the implementation should return a NULL pointer. This method is called by loadRunner prior to attempting to load a DataEgine using the standard Plasma plugin mechanisms.
- Parameters
-
name the name of the engine
- Returns
- the data engine that was loaded, or the NullEngine on failure.
Definition at line 333 of file pluginloader.cpp.
|
protectedvirtual |
A re-implementable method that allows subclasses to override the default behaviour of loadService.
If the service requested is not recognized, then the implementation should return a NULL pointer. This method is called by loadService prior to attempting to load a Service using the standard Plasma plugin mechanisms.
- Parameters
-
name the plugin name of the service to load args a list of arguments to supply to the service plugin when loading it parent the parent object, if any, for the service
- Returns
- a Service object, unlike Plasma::Service::loadService, this can return null.
Definition at line 339 of file pluginloader.cpp.
|
protectedvirtual |
Returns a list of all known Runner implementations.
- Returns
- list of AbstractRunners, or an empty list if none
Definition at line 358 of file pluginloader.cpp.
|
protectedvirtual |
Returns a list of all known Runner implementations.
- Returns
- list of AbstractRunners, or an empty list if none
Definition at line 363 of file pluginloader.cpp.
KPluginInfo::List Plasma::PluginLoader::listAppletInfo | ( | const QString & | category, |
const QString & | parentApp = QString() |
||
) |
Returns a list of all known applets.
This may skip applets based on security settings and ExcludeCategories in the application's config.
- Parameters
-
category Only applets matchin this category will be returned. Useful in conjunction with knownCategories. If "Misc" is passed in, then applets without a Categories= entry are also returned. If an empty string is passed in, all applets are returned. parentApp the application to filter applets on. Uses the X-KDE-ParentApp entry (if any) in the plugin info. The default value of QString() will result in a list containing only applets not specifically registered to an application.
- Returns
- list of applets
Definition at line 247 of file pluginloader.cpp.
KPluginInfo::List Plasma::PluginLoader::listDataEngineInfo | ( | const QString & | parentApp = QString() | ) |
Returns a list of all known DataEngines.
- Parameters
-
parentApp the application to filter applets on. Uses the X-KDE-ParentApp entry (if any) in the plugin info. The default value of QString() will result in a list containing only applets not specifically registered to an application.
- Returns
- list of DataEngines
Definition at line 281 of file pluginloader.cpp.
KPluginInfo::List Plasma::PluginLoader::listRunnerInfo | ( | const QString & | parentApp = QString() | ) |
Returns a list of all known Runner implementations.
- Parameters
-
parentApp the application to filter applets on. Uses the X-KDE-ParentApp entry (if any) in the plugin info. The default value of QString() will result in a list containing only applets not specifically registered to an application.
- Returns
- list of AbstractRunners
Definition at line 300 of file pluginloader.cpp.
Applet * Plasma::PluginLoader::loadApplet | ( | const QString & | name, |
uint | appletId = 0 , |
||
const QVariantList & | args = QVariantList() |
||
) |
Load an Applet plugin.
- Parameters
-
name the plugin name, as returned by KPluginInfo::pluginName() appletId unique ID to assign the applet, or zero to have one assigned automatically. args to send the applet extra arguments
- Returns
- a pointer to the loaded applet, or 0 on load failure
Definition at line 79 of file pluginloader.cpp.
DataEngine * Plasma::PluginLoader::loadDataEngine | ( | const QString & | name | ) |
Load a DataEngine plugin.
- Parameters
-
name the name of the engine
- Returns
- the DataEngine that was loaded, or the NullEngine on failure.
Definition at line 161 of file pluginloader.cpp.
AbstractRunner * Plasma::PluginLoader::loadRunner | ( | const QString & | name | ) |
Load a Runner plugin.
- Returns
- the Runner that was loaded, or 0 on failure.
Definition at line 199 of file pluginloader.cpp.
Service * Plasma::PluginLoader::loadService | ( | const QString & | name, |
const QVariantList & | args, | ||
QObject * | parent = 0 |
||
) |
Load a Service plugin.
- Parameters
-
name the plugin name of the service to load args a list of arguments to supply to the service plugin when loading it parent the parent object, if any, for the service
- Returns
- a Service object, unlike Plasma::Service::loadService, this can return null.
Definition at line 206 of file pluginloader.cpp.
|
static |
Return the active plugin loader.
Definition at line 67 of file pluginloader.cpp.
|
static |
Set the plugin loader which will be queried for all loads.
- Parameters
-
loader A subclass of PluginLoader which will be supplied by the application
Definition at line 58 of file pluginloader.cpp.
|
protected |
Standardized mechanism for providing internal Applets by install .desktop files in $APPPDATA/plasma/internal/applets/.
For applications that do this, internalAppletInfo can be implemented as a one-liner call to this method.
- Parameters
-
category Only applets matching this category will be returned. Useful in conjunction with knownCategories. If "Misc" is passed in, then applets without a Categories= entry are also returned. If an empty string is passed in, all applets are returned.
- Returns
- list of Applets, or an empty list if none
Definition at line 390 of file pluginloader.cpp.
|
protected |
Standardized mechanism for providing internal Applets by install .desktop files in $APPPDATA/plasma/internal/dataengines/.
For applications that do this, internalDataEngineInfo can be implemented as a one-liner call to this method.
- Returns
- list of applets
Definition at line 395 of file pluginloader.cpp.
|
protected |
Standardized mechanism for providing internal Applets by install .desktop files in $APPPDATA/plasma/internal/runners/.
For applications that do this, internalRunnerInfo can be implemented as a one-liner call to this method.
- Returns
- list of applets
Definition at line 400 of file pluginloader.cpp.
|
protected |
Standardized mechanism for providing internal Applets by install .desktop files in $APPPDATA/plasma/internal/services/.
For applications that do this, internalRunnerInfo can be implemented as a one-liner call to this method.
- Returns
- list of applets
Definition at line 405 of file pluginloader.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:48:35 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.