• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

Plasma

  • Plasma
  • PluginLoader
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
Plasma::PluginLoader Class Reference

#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).

Author
Ryan Rix ry@n..nosp@m.rix..nosp@m.si
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.

Plasma::PluginLoader::~PluginLoader ( )
virtual

Definition at line 53 of file pluginloader.cpp.

Member Function Documentation

KPluginInfo::List Plasma::PluginLoader::internalAppletInfo ( const QString &  category) const
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
categoryOnly 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.

KPluginInfo::List Plasma::PluginLoader::internalDataEngineInfo ( ) const
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.

Applet * Plasma::PluginLoader::internalLoadApplet ( const QString &  name,
uint  appletId = 0,
const QVariantList &  args = QVariantList() 
)
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
namethe plugin name, as returned by KPluginInfo::pluginName()
appletIdunique ID to assign the applet, or zero to have one assigned automatically.
argsto 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.

DataEngine * Plasma::PluginLoader::internalLoadDataEngine ( const QString &  name)
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
namethe name of the engine
Returns
the data engine that was loaded, or the NullEngine on failure.

Definition at line 327 of file pluginloader.cpp.

AbstractRunner * Plasma::PluginLoader::internalLoadRunner ( const QString &  name)
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
namethe name of the engine
Returns
the data engine that was loaded, or the NullEngine on failure.

Definition at line 333 of file pluginloader.cpp.

Service * Plasma::PluginLoader::internalLoadService ( const QString &  name,
const QVariantList &  args,
QObject *  parent = 0 
)
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
namethe plugin name of the service to load
argsa list of arguments to supply to the service plugin when loading it
parentthe 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.

KPluginInfo::List Plasma::PluginLoader::internalRunnerInfo ( ) const
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.

KPluginInfo::List Plasma::PluginLoader::internalServiceInfo ( ) const
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
categoryOnly 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.
parentAppthe 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
parentAppthe 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
parentAppthe 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
namethe plugin name, as returned by KPluginInfo::pluginName()
appletIdunique ID to assign the applet, or zero to have one assigned automatically.
argsto 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
namethe 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
namethe plugin name of the service to load
argsa list of arguments to supply to the service plugin when loading it
parentthe 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.

PluginLoader * Plasma::PluginLoader::pluginLoader ( )
static

Return the active plugin loader.

Definition at line 67 of file pluginloader.cpp.

void Plasma::PluginLoader::setPluginLoader ( PluginLoader *  loader)
static

Set the plugin loader which will be queried for all loads.

Parameters
loaderA subclass of PluginLoader which will be supplied by the application

Definition at line 58 of file pluginloader.cpp.

KPluginInfo::List Plasma::PluginLoader::standardInternalAppletInfo ( const QString &  category) const
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
categoryOnly 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.

KPluginInfo::List Plasma::PluginLoader::standardInternalDataEngineInfo ( ) const
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.

KPluginInfo::List Plasma::PluginLoader::standardInternalRunnerInfo ( ) const
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.

KPluginInfo::List Plasma::PluginLoader::standardInternalServiceInfo ( ) const
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:
  • pluginloader.h
  • pluginloader.cpp
This file is part of the KDE documentation.
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.

Plasma

Skip menu "Plasma"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal