Plasma::Applet

Search for usage in LXR

#include <Plasma/Applet>

Inheritance diagram for Plasma::Applet:

Properties

Plasma::Types::BackgroundHints backgroundHints
 
bool busy
 
Plasma::Types::ContainmentDisplayHints containmentDisplayHints
 
Plasma::Types::BackgroundHints effectiveBackgroundHints
 
Plasma::Types::FormFactor formFactor
 
QString icon
 
Plasma::Types::ImmutabilityType immutability
 
Plasma::Types::Location location
 
Plasma::Types::ItemStatus status
 
QString title
 
Plasma::Types::BackgroundHints userBackgroundHints
 
- Properties inherited from QObject
 objectName
 

Signals

void activated ()
 
void appletDeleted (Plasma::Applet *applet)
 
void backgroundHintsChanged ()
 
void busyChanged (bool busy)
 
void configNeedsSaving ()
 
void configurationRequiredChanged (bool needsConfig, const QString &reason)
 
void containmentDisplayHintsChanged (Plasma::Types::ContainmentDisplayHints hints)
 
void contextualActionsAboutToShow ()
 
void destroyedChanged (bool destroyed)
 
void effectiveBackgroundHintsChanged ()
 
void formFactorChanged (Plasma::Types::FormFactor formFactor)
 
void iconChanged (const QString &icon)
 
void immutabilityChanged (Plasma::Types::ImmutabilityType immutable)
 
void locationChanged (Plasma::Types::Location location)
 
void statusChanged (Plasma::Types::ItemStatus status)
 
void titleChanged (const QString &title)
 
void userBackgroundHintsChanged ()
 
void userConfiguringChanged (bool configuring)
 

Public Slots

virtual void configChanged ()
 
void destroy ()
 
void flushPendingConstraintsEvents ()
 
virtual void init ()
 
void runAssociatedApplication ()
 
void setImmutability (const Types::ImmutabilityType immutable)
 
void setLaunchErrorMessage (const QString &reason=QString())
 
void setStatus (const Types::ItemStatus stat)
 

Public Member Functions

 Applet (const KPluginInfo &info, QObject *parent=nullptr, uint appletId=0)
 
 Applet (const KPluginMetaData &metadata, QObject *parent=nullptr, uint appletId=0)
 
 Applet (QObject *parent=nullptr, const QString &serviceId=QString(), uint appletId=0)
 
 Applet (QObject *parentObject, const KPluginMetaData &data, const QVariantList &args)
 
KActionCollectionactions () const
 
QString associatedApplication () const
 
QList< QUrlassociatedApplicationUrls () const
 
Plasma::Types::BackgroundHints backgroundHints () const
 
KConfigGroup config () const
 
KConfigLoaderconfigScheme () const
 
bool configurationRequired () const
 
QString configurationRequiredReason () const
 
Containmentcontainment () const
 
Types::ContainmentDisplayHints containmentDisplayHints () const
 
virtual QList< QAction * > contextualActions ()
 
bool destroyed () const
 
Plasma::Types::BackgroundHints effectiveBackgroundHints () const
 
bool failedToLaunch () const
 
Types::FormFactor formFactor () const
 
KConfigGroup globalConfig () const
 
QKeySequence globalShortcut () const
 
bool hasConfigurationInterface () const
 
bool hasValidAssociatedApplication () const
 
QString icon () const
 
uint id () const
 
Types::ImmutabilityType immutability () const
 
bool isBusy () const
 
bool isContainment () const
 
bool isUserConfiguring () const
 
KPackage::Package kPackage () const
 
QString launchErrorMessage () const
 
Types::Location location () const
 
Package package () const
 
KPluginInfo pluginInfo () const
 
KPluginMetaData pluginMetaData () const
 
virtual void restore (KConfigGroup &group)
 
virtual void save (KConfigGroup &group) const
 
void setAssociatedApplication (const QString &string)
 
void setAssociatedApplicationUrls (const QList< QUrl > &urls)
 
void setBackgroundHints (Plasma::Types::BackgroundHints hint)
 
void setBusy (bool busy)
 
void setGlobalShortcut (const QKeySequence &shortcut)
 
void setIcon (const QString &icon)
 
void setTitle (const QString &title)
 
void setUserBackgroundHints (Plasma::Types::BackgroundHints hint)
 
void setUserConfiguring (bool configuring)
 
Types::ItemStatus status () const
 
QString title () const
 
void updateConstraints (Plasma::Types::Constraints constraints=Plasma::Types::AllConstraints)
 
Plasma::Types::BackgroundHints userBackgroundHints () const
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
bool blockSignals (bool block)
 
const QObjectListchildren () const const
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method) const const
 
bool disconnect (const QObject *receiver, const char *method) const const
 
void dumpObjectInfo ()
 
void dumpObjectInfo () const const
 
void dumpObjectTree ()
 
void dumpObjectTree () const const
 
QList< QByteArraydynamicPropertyNames () const const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
findChild (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegExp &regExp, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QString &name, Qt::FindChildOptions options) const const
 
bool inherits (const char *className) const const
 
void installEventFilter (QObject *filterObj)
 
bool isWidgetType () const const
 
bool isWindowType () const const
 
void killTimer (int id)
 
virtual const QMetaObjectmetaObject () const const
 
void moveToThread (QThread *targetThread)
 
QString objectName () const const
 
void objectNameChanged (const QString &objectName)
 
QObjectparent () const const
 
QVariant property (const char *name) const const
 
 Q_CLASSINFO (Name, Value)
 
 Q_DISABLE_COPY (Class)
 
 Q_DISABLE_COPY_MOVE (Class)
 
 Q_DISABLE_MOVE (Class)
 
 Q_EMIT Q_EMIT
 
 Q_ENUM (...)
 
 Q_ENUM_NS (...)
 
 Q_ENUMS (...)
 
 Q_FLAG (...)
 
 Q_FLAG_NS (...)
 
 Q_FLAGS (...)
 
 Q_GADGET Q_GADGET
 
 Q_INTERFACES (...)
 
 Q_INVOKABLE Q_INVOKABLE
 
 Q_NAMESPACE Q_NAMESPACE
 
 Q_NAMESPACE_EXPORT (EXPORT_MACRO)
 
 Q_OBJECT Q_OBJECT
 
 Q_PROPERTY (...)
 
 Q_REVISION Q_REVISION
 
 Q_SET_OBJECT_NAME (Object)
 
 Q_SIGNAL Q_SIGNAL
 
 Q_SIGNALS Q_SIGNALS
 
 Q_SLOT Q_SLOT
 
 Q_SLOTS Q_SLOTS
 
qFindChild (const QObject *obj, const QString &name)
 
QList< T > qFindChildren (const QObject *obj, const QRegExp &regExp)
 
QList< T > qFindChildren (const QObject *obj, const QString &name)
 
qobject_cast (const QObject *object)
 
qobject_cast (QObject *object)
 
 QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
 
void removeEventFilter (QObject *obj)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool signalsBlocked () const const
 
int startTimer (int interval, Qt::TimerType timerType)
 
int startTimer (std::chrono::milliseconds time, Qt::TimerType timerType)
 
QThreadthread () const const
 

Static Public Member Functions

static AppletloadPlasmoid (const QString &path, uint appletId=0)
 
- Static Public Member Functions inherited from QObject
QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, Functor functor)
 
bool disconnect (const QMetaObject::Connection &connection)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
bool disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 

Protected Member Functions

 Applet (QObject *parent, const QVariantList &args)
 
virtual void constraintsEvent (Plasma::Types::Constraints constraints)
 
virtual void saveState (KConfigGroup &config) const
 
void setConfigurationRequired (bool needsConfiguring, const QString &reason=QString())
 
void setHasConfigurationInterface (bool hasInterface)
 
void timerEvent (QTimerEvent *event) override
 
- Protected Member Functions inherited from QObject
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const QMetaMethod &signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const QMetaMethod &signal)
 
bool isSignalConnected (const QMetaMethod &signal) const const
 
int receivers (const char *signal) const const
 
QObjectsender () const const
 
int senderSignalIndex () const const
 

Additional Inherited Members

- Public Attributes inherited from QObject
typedef QObjectList
 

Detailed Description

The base Applet class.

Applet provides several important roles for add-ons widgets in Plasma.

First, it is the base class for the plugin system and therefore is the interface to applets for host applications. It also handles the life time management of data engines (e.g. all data engines accessed via Applet::dataEngine(const QString&) are properly deref'd on Applet destruction), background painting (allowing for consistent and complex look and feel in just one line of code for applets), loading and starting of scripting support for each applet, providing access to the associated plasmoid package (if any) and access to configuration data.

See techbase.kde.org for tutorials on writing Applets using this class.

Definition at line 71 of file applet.h.

Property Documentation

◆ backgroundHints

Plasma::Types::BackgroundHints Plasma::Applet::backgroundHints
readwrite

How the applet wants its background to be drawn.

The containment may chose to ignore this hint.

Definition at line 86 of file applet.h.

◆ effectiveBackgroundHints

Plasma::Types::BackgroundHints Plasma::Applet::effectiveBackgroundHints
read

The effective background hints the applet has, internally decided how to mix with userBackgroundHints.

Definition at line 96 of file applet.h.

◆ userBackgroundHints

Plasma::Types::BackgroundHints Plasma::Applet::userBackgroundHints
readwrite

The containment (and/or the user) may decide to use another kind of background instead (if supported by the applet)

Definition at line 91 of file applet.h.

Constructor & Destructor Documentation

◆ Applet() [1/5]

Plasma::Applet::Applet ( QObject parentObject,
const KPluginMetaData data,
const QVariantList &  args 
)

This constructor can be used with the KCoreAddons plugin loading system.

The argument list is expected to have contain the KPackage of the applet, the meta data file path (for compatibility) and an applet ID which must be a base 10 number.

Parameters
parenta QObject parent; you probably want to pass in 0
data,KPluginMetaDataused to create this plugin
argsa list of strings containing the applet id @Since 5.86

Definition at line 128 of file applet.cpp.

◆ Applet() [2/5]

Plasma::Applet::Applet ( QObject parent = nullptr,
const QString serviceId = QString(),
uint  appletId = 0 
)
explicit
Parameters
parentthe QObject this applet is parented to
serviceIdthe name of the .desktop file containing the information about the widget
appletIda unique id used to differentiate between multiple instances of the same Applet type
Deprecated:
Since 5.86, use Applet(QObject *, KPluginMetaData, QVariantList) instead

Definition at line 77 of file applet.cpp.

◆ Applet() [3/5]

Plasma::Applet::Applet ( const KPluginInfo info,
QObject parent = nullptr,
uint  appletId = 0 
)
explicit
Parameters
parentthe QObject this applet is parented to
infothe plugin information object for this Applet
appletIda unique id used to differentiate between multiple instances of the same Applet type
Since
4.6
Deprecated:
Since 5.28, prefer using KPluginMetaData

Definition at line 71 of file applet.cpp.

◆ Applet() [4/5]

Plasma::Applet::Applet ( const KPluginMetaData metadata,
QObject parent = nullptr,
uint  appletId = 0 
)
explicit
Parameters
parentthe QObject this applet is parented to
metadatathe plugin information object for this Applet
appletIda unique id used to differentiate between multiple instances of the same Applet type
Since
5.27
Deprecated:
Since 5.86, use Applet(QObject *, KPluginMetaData, QVariantList) instead

Definition at line 59 of file applet.cpp.

◆ Applet() [5/5]

Plasma::Applet::Applet ( QObject parent,
const QVariantList &  args 
)
protected

This constructor is to be used with the plugin loading systems found in KPluginInfo and KService.

The argument list is expected to have two elements: the KService service ID for the desktop entry and an applet ID which must be a base 10 number.

Parameters
parenta QObject parent; you probably want to pass in 0
argsa list of strings containing two entries: the service id and the applet id
Deprecated:
Since 5.86, use Applet(QObject *, KPluginMetaData, QVariantList) instead

Definition at line 87 of file applet.cpp.

Member Function Documentation

◆ actions()

KActionCollection * Plasma::Applet::actions ( ) const

Returns the collection of actions for this Applet.

Definition at line 705 of file applet.cpp.

◆ activated

void Plasma::Applet::activated ( )
signal

Emitted when activation is requested due to, for example, a global keyboard shortcut.

By default the widget is given focus.

◆ appletDeleted

void Plasma::Applet::appletDeleted ( Plasma::Applet applet)
signal

Emitted when the applet is deleted.

◆ associatedApplication()

QString Plasma::Applet::associatedApplication ( ) const
Returns
the application associated to this applet
Since
4.4

Definition at line 855 of file applet.cpp.

◆ associatedApplicationUrls()

QList< QUrl > Plasma::Applet::associatedApplicationUrls ( ) const
Returns
the urls associated to this applet
Since
4.4

Definition at line 860 of file applet.cpp.

◆ backgroundHints()

Plasma::Types::BackgroundHints Plasma::Applet::backgroundHints ( ) const

How the applet wants its background to be drawn.

The containment may chose to ignore this hint.

Since
5.65

◆ backgroundHintsChanged

void Plasma::Applet::backgroundHintsChanged ( )
signal

Emitted when the background hints have changed.

Since
5.65

◆ busyChanged

void Plasma::Applet::busyChanged ( bool  busy)
signal

Emitted when the busy status has changed.

Since
5.21

◆ config()

KConfigGroup Plasma::Applet::config ( ) const

Returns the KConfigGroup to access the applets configuration.

This config object will write to an instance specific config file named <appletname><instanceid>rc in the Plasma appdata directory.

Definition at line 270 of file applet.cpp.

◆ configChanged

void Plasma::Applet::configChanged ( )
virtualslot

Called when applet configuration values have changed.

Definition at line 821 of file applet.cpp.

◆ configNeedsSaving

void Plasma::Applet::configNeedsSaving ( )
signal

Emitted when an applet has changed values in its configuration and wishes for them to be saved at the next save point.

As this implies disk activity, this signal should be used with care.

Note
This does not need to be emitted from saveState by individual applets.

◆ configScheme()

KConfigLoader * Plasma::Applet::configScheme ( ) const

Returns the config skeleton object from this applet's package, if any.

Returns
config skeleton object, or 0 if none

Definition at line 319 of file applet.cpp.

◆ configurationRequired()

bool Plasma::Applet::configurationRequired ( ) const
Returns
true if the applet currently needs to be configured, otherwise, false

Definition at line 551 of file applet.cpp.

◆ configurationRequiredChanged

void Plasma::Applet::configurationRequiredChanged ( bool  needsConfig,
const QString reason 
)
signal

Emitted when setConfigurationRequired was called.

See also
setConfigurationRequired
Since
5.20

◆ configurationRequiredReason()

QString Plasma::Applet::configurationRequiredReason ( ) const
Returns
A translated message for the user explaining that the applet needs configuring; this should note what needs to be configured
See also
setConfigurationRequired
Since
5.20

Definition at line 556 of file applet.cpp.

◆ containment()

Containment * Plasma::Applet::containment ( ) const
Returns
the Containment, if any, this applet belongs to

Definition at line 731 of file applet.cpp.

◆ containmentDisplayHints()

Types::ContainmentDisplayHints Plasma::Applet::containmentDisplayHints ( ) const
Returns
Display hints that come from the containment that suggest the applet how to look and behave.
Since
5.77

◆ contextualActions()

QList< QAction * > Plasma::Applet::contextualActions ( )
virtual

Returns a list of context-related QAction instances.

This is used e.g. within the DesktopView to display a contextmenu.

Returns
A list of actions. The default implementation returns an empty list.

Definition at line 699 of file applet.cpp.

◆ contextualActionsAboutToShow

void Plasma::Applet::contextualActionsAboutToShow ( )
signal

Emitted just before the contextual actions are about to show For instance just before the context menu containing the actions added with setAction() is shown.

◆ destroy

void Plasma::Applet::destroy ( )
slot

Destroys the applet; it will be removed nicely and deleted.

Its configuration will also be deleted. If you want to remove the Applet configuration, use this, don't just delete the Applet *

Definition at line 303 of file applet.cpp.

◆ destroyed()

bool Plasma::Applet::destroyed ( ) const
Returns
true if destroy() was called; useful for Applets which should avoid certain tasks if they are about to be deleted permanently

Definition at line 314 of file applet.cpp.

◆ destroyedChanged

void Plasma::Applet::destroyedChanged ( bool  destroyed)
signal

Emitted when the applet has been scheduled for destruction or the destruction has been undone.

Since
5.4

◆ effectiveBackgroundHints()

Plasma::Types::BackgroundHints Plasma::Applet::effectiveBackgroundHints ( ) const

The effective background hints the applet will have: it will follow userBackgroundHints only if backgroundHints has the Plasma::Types::ConfigurableBackground flag set.

Since
5.65

◆ effectiveBackgroundHintsChanged

void Plasma::Applet::effectiveBackgroundHintsChanged ( )
signal

Emitted when the effective background hints have changed.

Since
5.65

◆ failedToLaunch()

bool Plasma::Applet::failedToLaunch ( ) const

If for some reason, the applet fails to get up on its feet (the library couldn't be loaded, necessary hardware support wasn't found, etc..) this method returns true.

Definition at line 546 of file applet.cpp.

◆ flushPendingConstraintsEvents

void Plasma::Applet::flushPendingConstraintsEvents ( )
slot

Sends all pending constraints updates to the applet.

Will usually be called automatically, but can also be called manually if needed.

Definition at line 602 of file applet.cpp.

◆ formFactor()

Types::FormFactor Plasma::Applet::formFactor ( ) const

Returns the current form factor the applet is being displayed in.

See also
Plasma::FormFactor

◆ formFactorChanged

void Plasma::Applet::formFactorChanged ( Plasma::Types::FormFactor  formFactor)
signal

Emitted when the formfactor changes.

◆ globalConfig()

KConfigGroup Plasma::Applet::globalConfig ( ) const

Returns a KConfigGroup object to be shared by all applets of this type.

This config object will write to an applet-specific config object named plasma_<appletname>rc in the local config directory.

Definition at line 283 of file applet.cpp.

◆ globalShortcut()

QKeySequence Plasma::Applet::globalShortcut ( ) const
Returns
the global shortcut associated with this widget, or an empty shortcut if no global shortcut is associated.

Definition at line 779 of file applet.cpp.

◆ hasConfigurationInterface()

bool Plasma::Applet::hasConfigurationInterface ( ) const
Returns
true if this plasmoid provides a GUI configuration

Definition at line 797 of file applet.cpp.

◆ hasValidAssociatedApplication()

bool Plasma::Applet::hasValidAssociatedApplication ( ) const
Returns
true if the applet has a valid associated application or urls
Since
4.4

Definition at line 870 of file applet.cpp.

◆ icon()

QString Plasma::Applet::icon ( ) const
Returns
The icon name related to this applet By default is the one in the plasmoid desktop file

◆ iconChanged

void Plasma::Applet::iconChanged ( const QString icon)
signal

Emitted when the icon name for the applet has changed.

Since
5.20

◆ id()

uint Plasma::Applet::id ( ) const
Returns
the id of this applet

Definition at line 173 of file applet.cpp.

◆ immutability()

Types::ImmutabilityType Plasma::Applet::immutability ( ) const
Returns
The type of immutability of this applet

◆ immutabilityChanged

void Plasma::Applet::immutabilityChanged ( Plasma::Types::ImmutabilityType  immutable)
signal

Emitted when the immutability changes.

Since
4.4

◆ init

void Plasma::Applet::init ( )
virtualslot

This method is called once the applet is loaded and added to a Corona.

If the applet requires a Scene or has an particularly intensive set of initialization routines to go through, consider implementing it in this method instead of the constructor.

Note: paintInterface may get called before init() depending on initialization order. Painting is managed by the canvas (QGraphisScene), and may schedule a paint event prior to init() being called.

Reimplemented in Plasma::Containment.

Definition at line 168 of file applet.cpp.

◆ isBusy()

bool Plasma::Applet::isBusy ( ) const
Returns
true if the applet should show a busy status, for instance doing some network operation
Since
5.21

Definition at line 407 of file applet.cpp.

◆ isContainment()

bool Plasma::Applet::isContainment ( ) const
Returns
true if this Applet is currently being used as a Containment, false otherwise

Definition at line 929 of file applet.cpp.

◆ isUserConfiguring()

bool Plasma::Applet::isUserConfiguring ( ) const
Returns
true when the configuration interface is being shown
Since
4.5

Definition at line 573 of file applet.cpp.

◆ kPackage()

KPackage::Package Plasma::Applet::kPackage ( ) const

Accessor for the associated Package object if any.

Generally, only Plasmoids come in a Package.

Returns
the Package object, or an invalid one if none
Since
5.6
Deprecated:
Since 5.100, accessing an applets KPackage is deprecated. For using the metadata, use pluginMetaData instead.

Definition at line 345 of file applet.cpp.

◆ launchErrorMessage()

QString Plasma::Applet::launchErrorMessage ( ) const

If for some reason, the applet fails to get up on its feet (the library couldn't be loaded, necessary hardware support wasn't found, etc..) this method returns the reason why, in an user-readable way.

Since
5.0

Definition at line 541 of file applet.cpp.

◆ loadPlasmoid()

Applet * Plasma::Applet::loadPlasmoid ( const QString path,
uint  appletId = 0 
)
static

Attempts to load an applet from a package.

Returns a pointer to the applet if successful. The caller takes responsibility for the applet, including deleting it when no longer needed. If you instance a plasmoid with this deprecated API, the automated default setup scripts won't be executed for that plasmoid

Parameters
paththe path to the package
appletIdunique ID to assign the applet, or zero to have one assigned automatically.
Returns
a pointer to the loaded applet, or 0 on load failure
Since
4.3
Deprecated:
Since 5.19, use Containment::createApplet() instead, you are not supposed to have applets without containments

Definition at line 876 of file applet.cpp.

◆ location()

Types::Location Plasma::Applet::location ( ) const

Returns the location of the scene which is displaying applet.

See also
Plasma::Types::Location

◆ locationChanged

void Plasma::Applet::locationChanged ( Plasma::Types::Location  location)
signal

Emitted when the location changes.

◆ package()

Package Plasma::Applet::package ( ) const

Accessor for the associated Package object if any.

Generally, only Plasmoids come in a Package.

Returns
the Package object, or an invalid one if none
Deprecated:
Since 5.6, use kPackage() instead

Definition at line 337 of file applet.cpp.

◆ pluginInfo()

KPluginInfo Plasma::Applet::pluginInfo ( ) const
Returns
metadata information about this plugin
See also
KPluginInfo, pluginMetaData
Since
5.0
Deprecated:
Since 5.28, use pluginMetaData instead

Definition at line 479 of file applet.cpp.

◆ pluginMetaData()

KPluginMetaData Plasma::Applet::pluginMetaData ( ) const
Returns
metadata information about this plugin
Since
5.27

Definition at line 485 of file applet.cpp.

◆ restore()

void Plasma::Applet::restore ( KConfigGroup group)
virtual

Restores state information about this applet saved previously in save(KConfigGroup&).

This method does not need to be reimplemented by Applet subclasses, but can be useful for Applet specializations (such as Containment) to do so.

Reimplemented in Plasma::Containment.

Definition at line 211 of file applet.cpp.

◆ runAssociatedApplication

void Plasma::Applet::runAssociatedApplication ( )
slot

Open the application associated to this applet, if it's not set but some urls are, open those urls with the proper application for their mimetype.

See also
setAssociatedApplication()
setAssociatedApplicationUrls()
Since
4.4

Definition at line 865 of file applet.cpp.

◆ save()

void Plasma::Applet::save ( KConfigGroup group) const
virtual

Saves state information about this applet that will be accessed when next instantiated in the restore(KConfigGroup&) method.

This method does not need to be reimplemented by Applet subclasses, but can be useful for Applet specializations (such as Containment) to do so.

Applet subclasses may instead want to reimplement saveState().

Reimplemented in Plasma::Containment.

Definition at line 178 of file applet.cpp.

◆ saveState()

void Plasma::Applet::saveState ( KConfigGroup config) const
protectedvirtual

When called, the Applet should write any information needed as part of the Applet's running state to the configuration object in config() and/or globalConfig().

Applets that always sync their settings/state with the config objects when these settings/states change do not need to reimplement this method.

Definition at line 256 of file applet.cpp.

◆ setAssociatedApplication()

void Plasma::Applet::setAssociatedApplication ( const QString string)

Sets an application associated to this applet, that will be regarded as a full view of what is represented in the applet.

Parameters
stringthe name of the application. it can be
Since
4.4

Definition at line 831 of file applet.cpp.

◆ setAssociatedApplicationUrls()

void Plasma::Applet::setAssociatedApplicationUrls ( const QList< QUrl > &  urls)

Sets a list of urls associated to this application, they will be used as parameters for the associated application.

See also
setAssociatedApplication()
Parameters
urls

Definition at line 843 of file applet.cpp.

◆ setBackgroundHints()

void Plasma::Applet::setBackgroundHints ( Plasma::Types::BackgroundHints  hint)

Sets the applet background hints.

Only Applet implementations should write this property

Since
5.65

Definition at line 427 of file applet.cpp.

◆ setBusy()

void Plasma::Applet::setBusy ( bool  busy)

Sets the Applet to have a busy status hint, for instance the applet doing some network operation.

The graphical representation of the busy status depends completely from the visualization.

Parameters
busytrue if the applet is busy
Since
5.21

Definition at line 412 of file applet.cpp.

◆ setConfigurationRequired()

void Plasma::Applet::setConfigurationRequired ( bool  needsConfiguring,
const QString reason = QString() 
)
protected

When the applet needs to be configured before being usable, this method can be called to show a standard interface prompting the user to configure the applet.

Parameters
needsConfiguringtrue if the applet needs to be configured, or false if it doesn't
reasona translated message for the user explaining that the applet needs configuring; this should note what needs to be configured

Definition at line 561 of file applet.cpp.

◆ setGlobalShortcut()

void Plasma::Applet::setGlobalShortcut ( const QKeySequence shortcut)

Sets the global shortcut to associate with this widget.

Definition at line 755 of file applet.cpp.

◆ setHasConfigurationInterface()

void Plasma::Applet::setHasConfigurationInterface ( bool  hasInterface)
protected

Sets whether or not this applet provides a user interface for configuring the applet.

It defaults to false, and if true is passed in you should also reimplement createConfigurationInterface()

Parameters
hasInterfacewhether or not there is a user interface available

Definition at line 802 of file applet.cpp.

◆ setIcon()

void Plasma::Applet::setIcon ( const QString icon)

Sets an icon name for this applet.

Parameters
iconFreedesktop compatible icon name

Definition at line 397 of file applet.cpp.

◆ setImmutability

void Plasma::Applet::setImmutability ( const Types::ImmutabilityType  immutable)
slot

Sets the immutability type for this applet (not immutable, user immutable or system immutable)

Parameters
immutablethe new immutability type of this applet

Definition at line 527 of file applet.cpp.

◆ setLaunchErrorMessage

void Plasma::Applet::setLaunchErrorMessage ( const QString reason = QString())
slot

Call this method when the applet fails to launch properly.

An optional reason can be provided.

Not that all children items will be deleted when this method is called. If you have pointers to these items, you will need to reset them after calling this method.

Parameters
failedtrue when the applet failed, false when it succeeded
reasonan optional reason to show the user why the applet failed to launch
Since
5.0

Definition at line 246 of file applet.cpp.

◆ setStatus

void Plasma::Applet::setStatus ( const Types::ItemStatus  stat)
slot

sets the status for this applet

Since
4.4

Definition at line 593 of file applet.cpp.

◆ setTitle()

void Plasma::Applet::setTitle ( const QString title)

Sets a custom title for this instance of the applet.

E.g. a clock might use the timezone as its name rather than the .desktop file

Since
5.0
Parameters
titlethe user-visible title for the applet.

Definition at line 382 of file applet.cpp.

◆ setUserBackgroundHints()

void Plasma::Applet::setUserBackgroundHints ( Plasma::Types::BackgroundHints  hint)

Sets the hints the user wished the background style for the applet to be.

Since
5.65

Definition at line 457 of file applet.cpp.

◆ setUserConfiguring()

void Plasma::Applet::setUserConfiguring ( bool  configuring)

Tells the applet the user is configuring.

Parameters
configuringtrue if the configuration ui is showing

Definition at line 578 of file applet.cpp.

◆ status()

Types::ItemStatus Plasma::Applet::status ( ) const
Returns
the status of the applet
Since
4.4

◆ statusChanged

void Plasma::Applet::statusChanged ( Plasma::Types::ItemStatus  status)
signal

Emitted when the applet status changes.

Since
4.4

◆ timerEvent()

void Plasma::Applet::timerEvent ( QTimerEvent event)
overrideprotectedvirtual

Reimplemented from QObject.

Reimplemented from QObject.

Definition at line 901 of file applet.cpp.

◆ title()

QString Plasma::Applet::title ( ) const

Returns the user-visible title for the applet, as specified in the Name field of the .desktop file.

Can be changed with

See also
setTitle
Since
5.0
Returns
the user-visible title for the applet.

◆ titleChanged

void Plasma::Applet::titleChanged ( const QString title)
signal

Emitted when the title has changed.

Since
5.20

◆ updateConstraints()

void Plasma::Applet::updateConstraints ( Plasma::Types::Constraints  constraints = Plasma::Types::AllConstraints)

Called when any of the geometry constraints have been updated.

This method calls constraintsEvent, which may be reimplemented, once the Applet has been prepared for updating the constraints.

Parameters
constraintsthe type of constraints that were updated

Definition at line 350 of file applet.cpp.

◆ userBackgroundHints()

Plasma::Types::BackgroundHints Plasma::Applet::userBackgroundHints ( ) const

The containment (and/or the user) may decide to use another kind of background instead if supported by the applet.

In order for an applet to support user configuration of the background, it needs to have the Plasma::Types::ConfigurableBackground flag set in its backgroundHints

Since
5.65

◆ userBackgroundHintsChanged

void Plasma::Applet::userBackgroundHintsChanged ( )
signal

Emitted when the user background hints have changed.

Since
5.65

◆ userConfiguringChanged

void Plasma::Applet::userConfiguringChanged ( bool  configuring)
signal

emitted when the config ui appears or disappears


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Mar 21 2023 04:13:11 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.