Plasma::PluginLoader
#include <Plasma/PluginLoader>
Public Member Functions | |
QList< KPluginMetaData > | listAppletMetaData (const QString &category) |
QList< KPluginMetaData > | listAppletMetaDataForMimeType (const QString &mimetype) |
QList< KPluginMetaData > | listAppletMetaDataForUrl (const QUrl &url) |
QList< KPluginMetaData > | listContainmentActionsMetaData (const QString &parentApp) |
Applet * | loadApplet (const QString &name, uint appletId=0, const QVariantList &args=QVariantList()) |
ContainmentActions * | loadContainmentActions (Containment *parent, const QString &containmentActionsName, const QVariantList &args=QVariantList()) |
Static Public Member Functions | |
static QList< KPluginMetaData > | listContainmentsMetaData (std::function< bool(const KPluginMetaData &)> filter={}) |
static QList< KPluginMetaData > | listContainmentsMetaDataOfType (const QString &type) |
static PluginLoader * | self () |
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.
- Since
- 4.6
Definition at line 41 of file pluginloader.h.
Member Function Documentation
◆ listAppletMetaData()
QList< KPluginMetaData > Plasma::PluginLoader::listAppletMetaData | ( | const QString & | category | ) |
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 matching this category will be returned. 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
- Since
- 5.28
Definition at line 129 of file pluginloader.cpp.
◆ listAppletMetaDataForMimeType()
QList< KPluginMetaData > Plasma::PluginLoader::listAppletMetaDataForMimeType | ( | const QString & | mimetype | ) |
Returns a list of all known applets associated with a certain mimetype.
- Returns
- list of applets
- Since
- 5.36
Definition at line 188 of file pluginloader.cpp.
◆ listAppletMetaDataForUrl()
QList< KPluginMetaData > Plasma::PluginLoader::listAppletMetaDataForUrl | ( | const QUrl & | url | ) |
Returns a list of all known applets associated with a certain URL.
- Returns
- list of applets
- Since
- 5.36
Definition at line 196 of file pluginloader.cpp.
◆ listContainmentActionsMetaData()
QList< KPluginMetaData > Plasma::PluginLoader::listContainmentActionsMetaData | ( | const QString & | parentApp | ) |
Returns a list of all known ContainmentActions.
- Parameters
-
parentApp the application to filter ContainmentActions on. Uses the X-KDE-ParentApp entry (if any) in the plugin metadata. The default value of QString() will result in a list of all ContainmentActions.
- Returns
- list of ContainmentActions
- Since
- 5.77
Definition at line 235 of file pluginloader.cpp.
◆ listContainmentsMetaData()
|
static |
Returns a list of all known containments.
- Parameters
-
filter An optional predicate that can be used for filtering.
- Returns
- list of containments
Definition at line 217 of file pluginloader.cpp.
◆ listContainmentsMetaDataOfType()
|
static |
Returns a list of containments of the specified type.
- Parameters
-
type The target containment type
- Returns
- list of containments
Definition at line 226 of file pluginloader.cpp.
◆ loadApplet()
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 41 of file pluginloader.cpp.
◆ loadContainmentActions()
ContainmentActions * Plasma::PluginLoader::loadContainmentActions | ( | Containment * | parent, |
const QString & | containmentActionsName, | ||
const QVariantList & | args = QVariantList() ) |
Load a ContainmentActions plugin.
Returns a pointer to the containmentactions if successful. The caller takes responsibility for the containmentactions, including deleting it when no longer needed.
- Parameters
-
parent the parent containment.
- Since
- 4.6 null is allowed.
- Parameters
-
name the plugin name, as returned by KPluginInfo::pluginName() args to send the containmentactions extra arguments
- Returns
- a ContainmentActions object
Definition at line 110 of file pluginloader.cpp.
◆ self()
|
static |
Return the active plugin loader.
Definition at line 35 of file pluginloader.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:01:36 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.