Plasma::PluginLoader

Search for usage in LXR

#include <Plasma/PluginLoader>

Public Member Functions

QList< KPluginMetaDatalistAppletMetaData (const QString &category)
 
QList< KPluginMetaDatalistAppletMetaDataForMimeType (const QString &mimetype)
 
QList< KPluginMetaDatalistAppletMetaDataForUrl (const QUrl &url)
 
QList< KPluginMetaDatalistContainmentActionsMetaData (const QString &parentApp)
 
AppletloadApplet (const QString &name, uint appletId=0, const QVariantList &args=QVariantList())
 
ContainmentActionsloadContainmentActions (Containment *parent, const QString &containmentActionsName, const QVariantList &args=QVariantList())
 

Static Public Member Functions

static QList< KPluginMetaDatalistContainmentsMetaData (std::function< bool(const KPluginMetaData &)> filter={})
 
static QList< KPluginMetaDatalistContainmentsMetaDataOfType (const QString &type)
 
static PluginLoaderself ()
 

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.

Author
Ryan Rix ry@n..nosp@m.rix..nosp@m.si
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
categoryOnly 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 114 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 173 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 181 of file pluginloader.cpp.

◆ listContainmentActionsMetaData()

QList< KPluginMetaData > Plasma::PluginLoader::listContainmentActionsMetaData ( const QString & parentApp)

Returns a list of all known ContainmentActions.

Parameters
parentAppthe 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 220 of file pluginloader.cpp.

◆ listContainmentsMetaData()

QList< KPluginMetaData > Plasma::PluginLoader::listContainmentsMetaData ( std::function< bool(const KPluginMetaData &)> filter = {})
static

Returns a list of all known containments.

Parameters
filterAn optional predicate that can be used for filtering.
Returns
list of containments

Definition at line 202 of file pluginloader.cpp.

◆ listContainmentsMetaDataOfType()

QList< KPluginMetaData > Plasma::PluginLoader::listContainmentsMetaDataOfType ( const QString & type)
static

Returns a list of containments of the specified type.

Parameters
typeThe target containment type
Returns
list of containments

Definition at line 211 of file pluginloader.cpp.

◆ loadApplet()

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 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
parentthe parent containment.
Since
4.6 null is allowed.
Parameters
namethe plugin name, as returned by KPluginInfo::pluginName()
argsto send the containmentactions extra arguments
Returns
a ContainmentActions object

Definition at line 97 of file pluginloader.cpp.

◆ self()

PluginLoader * Plasma::PluginLoader::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:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 3 2024 11:46:04 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.