Plasma::PluginLoader
#include <Plasma/PluginLoader>
Static Public Member Functions | |
static QStringList | listAllEngines (const QString &parentApp=QString()) |
static KPluginInfo::List | listContainments (const QString &category=QString(), const QString &parentApp=QString()) |
static KPluginInfo::List | listContainmentsForMimeType (const QString &mimeType) |
static QList< KPluginMetaData > | listContainmentsMetaData (std::function< bool(const KPluginMetaData &)> filter={}) |
static QList< KPluginMetaData > | listContainmentsMetaDataOfType (const QString &type) |
static KPluginInfo::List | listContainmentsOfType (const QString &type, const QString &category=QString(), const QString &parentApp=QString()) |
static QStringList | listContainmentTypes () |
static KPluginInfo::List | listEngineInfo (const QString &parentApp=QString()) |
static KPluginInfo::List | listEngineInfoByCategory (const QString &category, const QString &parentApp=QString()) |
static PluginLoader * | self () |
static void | setPluginLoader (PluginLoader *loader) |
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 55 of file pluginloader.h.
Member Function Documentation
◆ appletCategory()
Get the category of the given applet.
- Parameters
-
appletName the name of the applet
Definition at line 613 of file pluginloader.cpp.
◆ customAppletCategories()
QStringList Plasma::PluginLoader::customAppletCategories | ( | ) | const |
- Returns
- the list of custom categories known to libplasma
- Since
- 4.3
Definition at line 608 of file pluginloader.cpp.
◆ internalAppletInfo()
|
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. 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
- Deprecated:
- Since 5.86, deprecated for lack of usage, use default behaviour instead
Definition at line 813 of file pluginloader.cpp.
◆ internalContainmentActionsInfo()
|
protectedvirtual |
Returns a list of all known ContainmentActions implementations.
- Returns
- list of ContainmentActions info, or an empty list if none
- Deprecated:
- Since 5.86, deprecated for lack of usage, use default behaviour instead
Definition at line 829 of file pluginloader.cpp.
◆ internalDataEngineInfo()
|
protectedvirtual |
A re-implementable method that allows subclasses to provide additional dataengines for DataEngine::listDataEngines.
- Returns
- list of dataengine info, or an empty list if none
- Deprecated:
- Since 5.86, deprecated for lack of usage, use default behaviour instead
Definition at line 819 of file pluginloader.cpp.
◆ internalLoadApplet()
|
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
- Deprecated:
- Since 5.86, deprecated for lack of usage, use default behaviour instead
Definition at line 774 of file pluginloader.cpp.
◆ internalLoadContainmentActions()
|
protectedvirtual |
A re-implementable method that allows subclasses to override the default behaviour of loadContainmentActions.
If the ContainmentActions 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.
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
- Deprecated:
- Since 5.86, deprecated for lack of usage, use default behaviour instead
Definition at line 788 of file pluginloader.cpp.
◆ internalLoadDataEngine()
|
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.
- Deprecated:
- Since 5.86, deprecated for lack of usage, use default behaviour instead
Definition at line 782 of file pluginloader.cpp.
◆ internalLoadPackage()
|
protectedvirtual |
A re-implementable method that allows subclasses to override the default behaviour of loadPackage.
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.
- Deprecated:
- since 5.30, use KPackage API
Definition at line 805 of file pluginloader.cpp.
◆ internalLoadService()
|
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.
- Deprecated:
- Since 5.86, deprecated for lack of usage, use default behaviour instead
Definition at line 796 of file pluginloader.cpp.
◆ internalServiceInfo()
|
protectedvirtual |
Returns a list of all known Service implementations.
- Returns
- list of Service info, or an empty list if none
- Deprecated:
- Since 5.86, deprecated for lack of usage, use default behaviour instead
Definition at line 824 of file pluginloader.cpp.
◆ listAllEngines()
|
static |
- Returns
- a listing of all known dataengines by name
- Parameters
-
parentApp the application to filter dataengines on. Uses the X-KDE-ParentApp entry (if any) in the plugin info. The default value of QString() will result in a list of all dataengines.
- Deprecated:
- Since 5.94, Dataengines are being phased out, please port away from them if possible or query the plugins in the "plasma/dataengine" namespace manually using KPluginMetaData
Definition at line 227 of file pluginloader.cpp.
◆ listAppletCategories()
QStringList Plasma::PluginLoader::listAppletCategories | ( | const QString & | parentApp = QString() , |
bool | visibleOnly = true |
||
) |
Returns a list of all the categories used by installed applets.
- 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 of all Applets.
- Returns
- list of categories
- Parameters
-
visibleOnly true if it should only return applets that are marked as visible
Definition at line 577 of file pluginloader.cpp.
◆ listAppletInfo()
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 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. 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 of all applets in specified category.
- Returns
- list of applets
- Deprecated:
- Since 5.28. Doesn't support metadata.json packages. Use listAppletMetaData(const QString &category, const QString &parentApp) instead.
Definition at line 500 of file pluginloader.cpp.
◆ listAppletInfoForMimeType()
KPluginInfo::List Plasma::PluginLoader::listAppletInfoForMimeType | ( | const QString & | mimetype | ) |
Returns a list of all known applets associated with a certain mimetype.
- Returns
- list of applets
- Deprecated:
- Since 5.36, use listAppletMetaDataForMimeType(const QString &mimetype) instead.
Definition at line 535 of file pluginloader.cpp.
◆ listAppletInfoForUrl()
KPluginInfo::List Plasma::PluginLoader::listAppletInfoForUrl | ( | const QUrl & | url | ) |
Returns a list of all known applets associated with a certain URL.
- Returns
- list of applets
- Deprecated:
- Since 5.36, use listAppletMetaDataForUrl(const QUrl &url) instead.
Definition at line 571 of file pluginloader.cpp.
◆ listAppletMetaData() [1/2]
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 487 of file pluginloader.cpp.
◆ listAppletMetaData() [2/2]
QList< KPluginMetaData > Plasma::PluginLoader::listAppletMetaData | ( | const QString & | category, |
const QString & | parentApp | ||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- 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 of all applets in specified categories.
- Since
- 5.28
Definition at line 493 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 527 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 541 of file pluginloader.cpp.
◆ listContainmentActionsInfo()
KPluginInfo::List Plasma::PluginLoader::listContainmentActionsInfo | ( | 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 info. The default value of QString() will result in a list of all ContainmentActions.
- Returns
- list of ContainmentActions
- Deprecated:
- since 5.77, use listContainmentActionsMetaData()
Definition at line 730 of file pluginloader.cpp.
◆ listContainmentActionsMetaData()
QVector< 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 736 of file pluginloader.cpp.
◆ listContainments()
|
static |
Returns a list of all known containments.
- Parameters
-
category Only containments matching this category will be returned. If "Miscellaneous" is passed in, then containments without a Categories= entry are also returned. If an empty string is passed in, all containments are returned. parentApp the application to filter containments on. Uses the X-KDE-ParentApp entry (if any) in the plugin info. The default value of QString() will result in a list of all containments.
- Deprecated:
- since 5.83, use PluginLoader::listContainmentsMetaData
- Returns
- list of containments
Definition at line 628 of file pluginloader.cpp.
◆ listContainmentsForMimeType()
|
static |
Returns a list of all known containments associated with a certain MimeType.
- Returns
- list of containments
- Deprecated:
- since 5.83, use listAppletMetaData() with custom filtering instead.
Definition at line 679 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 634 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 643 of file pluginloader.cpp.
◆ listContainmentsOfType()
|
static |
Returns a list of all known containments that match the parameters.
- Parameters
-
type Only containments with this string in X-Plasma-ContainmentType in their .desktop files will be returned. Common values are panel and desktop category Only containments matching this category will be returned. If "Miscellaneous" is passed in, then containments without a Categories= entry are also returned. If an empty string is passed in, all containments are returned. parentApp the application to filter containments on. Uses the X-KDE-ParentApp entry (if any) in the plugin info. The default value of QString() will result in a list of all containments, matching categories/type.
- Deprecated:
- since 5.83, use PluginLoader::listContainmentsMetaDataOfType
- Returns
- list of containments
Definition at line 653 of file pluginloader.cpp.
◆ listContainmentTypes()
|
static |
- Returns
- a list of all known types of containments on this system
Definition at line 690 of file pluginloader.cpp.
◆ listDataEngineInfo()
KPluginInfo::List Plasma::PluginLoader::listDataEngineInfo | ( | const QString & | parentApp = QString() | ) |
Returns a list of all known dataengines.
- Parameters
-
parentApp the application to filter dataengines on. Uses the X-KDE-ParentApp entry (if any) in the plugin info. The default value of QString() will result in a list of all dataengines
- Returns
- list of dataengines
- Deprecated:
- since 5.77, use listDataEngineMetaData()
Definition at line 707 of file pluginloader.cpp.
◆ listDataEngineMetaData()
QVector< KPluginMetaData > Plasma::PluginLoader::listDataEngineMetaData | ( | const QString & | parentApp = QString() | ) |
Returns a list of all known dataengines.
- Parameters
-
parentApp the application to filter dataengines on. Uses the X-KDE-ParentApp entry (if any) in the plugin info. The default value of QString() will result in a list of all dataengines
- Returns
- list of dataengines
- Since
- 5.77
Definition at line 713 of file pluginloader.cpp.
◆ listEngineInfo()
|
static |
Returns a list of all known dataengines.
- Parameters
-
parentApp the application to filter dataengines on. Uses the X-KDE-ParentApp entry (if any) in the plugin info. The default value of QString() will result in a list of all dataengines.
- Returns
- list of dataengines
- Deprecated:
- since 5.77, use listDataEngineMetaData instead.
Definition at line 255 of file pluginloader.cpp.
◆ listEngineInfoByCategory()
|
static |
Returns a list of all known dataengines filtering by category.
- Parameters
-
category the category to filter dataengines on. Uses the X-KDE-PluginInfo-Category entry (if any) in the plugin info. The value of QString() will result in a list of dataengines with an empty category. parentApp the application to filter dataengines on. Uses the X-KDE-ParentApp entry (if any) in the plugin info. The default value of QString() will result in a list of all dataengines in specified categories.
- Returns
- list of dataengines
- Deprecated:
- since 5.81, use listDataEngineMetaData() instead.
- Since
- 4.3
Definition at line 262 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 134 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 325 of file pluginloader.cpp.
◆ loadDataEngine()
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.
- Deprecated:
- Since 5.94, Dataengines are being phased out, please port away from them if possible or load the plugin from the "plasma/dataengine" namespace manually using KPluginMetaData/KPluginFactory
Definition at line 196 of file pluginloader.cpp.
◆ loadPackage()
Package Plasma::PluginLoader::loadPackage | ( | const QString & | packageFormat, |
const QString & | specialization = QString() |
||
) |
Load a Package plugin.
- Parameters
-
name the plugin name of the package to load specialization used to find script extensions for the given format, e.g. "QML" for "Plasma/Applet"
- Returns
- a Package object matching name, or an invalid package on failure
- Deprecated:
- Since 5.30, use KPackage::PackageLoader::loadPackage(const QString& packageFormat, const QString& packagePath) instead.
Definition at line 371 of file pluginloader.cpp.
◆ loadService()
Service * Plasma::PluginLoader::loadService | ( | const QString & | name, |
const QVariantList & | args, | ||
QObject * | parent = nullptr |
||
) |
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 291 of file pluginloader.cpp.
◆ self()
|
static |
Return the active plugin loader.
Definition at line 121 of file pluginloader.cpp.
◆ setCustomAppletCategories()
void Plasma::PluginLoader::setCustomAppletCategories | ( | const QStringList & | categories | ) |
Sets the list of custom categories that are used in addition to the default set of categories known to libplasma for applets.
- Parameters
-
categories a list of categories
- Since
- 4.3
Definition at line 603 of file pluginloader.cpp.
◆ setPluginLoader()
|
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
- Deprecated:
- Since 5.86, method is obsolete with the deprecation of the virtual methods
Definition at line 113 of file pluginloader.cpp.
◆ standardInternalAppletInfo()
|
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. 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
- Deprecated:
- Since 5.88, deprecated for lack of usage & obsolete with json metadata
Definition at line 858 of file pluginloader.cpp.
◆ standardInternalDataEngineInfo()
|
protected |
Standardized mechanism for providing internal dataengines 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 dataengines
- Deprecated:
- Since 5.88, deprecated for lack of usage & obsolete with json metadata
Definition at line 863 of file pluginloader.cpp.
◆ standardInternalServiceInfo()
|
protected |
Standardized mechanism for providing internal services by install .desktop files in $APPPDATA/plasma/internal/services/.
For applications that do this, internalServiceInfo can be implemented as a one-liner call to this method.
- Returns
- list of services
- Deprecated:
- Since 5.88, deprecated for lack of usage & obsolete with json metadata
Definition at line 868 of file pluginloader.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sun Mar 26 2023 04:14:49 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.