Plasma::Applet

Search for usage in LXR

#include <Plasma/Applet>

Inheritance diagram for Plasma::Applet:

Public Types

enum  Constraint {
  NoConstraint = 0 , FormFactorConstraint = 1 , LocationConstraint = 2 , ScreenConstraint = 4 ,
  ImmutableConstraint = 8 , StartupCompletedConstraint = 16 , UiReadyConstraint = 32 , AllConstraints = FormFactorConstraint | LocationConstraint | ScreenConstraint | ImmutableConstraint
}
 
enum  ConstraintHint { NoHint = 0 , CanFillArea = 1 , MarginAreasSeparator = CanFillArea | 2 }
 
typedef QFlags< ConstraintHintConstraintHints
 
typedef QFlags< ConstraintConstraints
 
- Public Types inherited from QObject
typedef  QObjectList
 

Properties

Plasma::Types::BackgroundHints backgroundHints
 
bool busy
 
KConfigPropertyMapconfiguration
 
bool configurationRequired
 
Applet::ConstraintHints constraintHints
 
Plasma::Containmentcontainment
 
Plasma::Types::ContainmentDisplayHints containmentDisplayHints
 
QQmlListProperty< QActioncontextualActions
 
Plasma::Types::BackgroundHints effectiveBackgroundHints
 
Plasma::Types::FormFactor formFactor
 
QKeySequence globalShortcut
 
bool hasConfigurationInterface
 
QString icon
 
uint id
 
Plasma::Types::ImmutabilityType immutability
 
bool immutable
 
bool isContainment
 
Plasma::Types::Location location
 
KPluginMetaData metaData
 
QString pluginName
 
Plasma::Types::ItemStatus status
 
QString title
 
Plasma::Types::BackgroundHints userBackgroundHints
 
bool userConfiguring
 
- 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 constraintHintsChanged (Plasma::Applet::ConstraintHints constraintHints)
 
void containmentChanged (Plasma::Containment *containment)
 
void containmentDisplayHintsChanged (Plasma::Types::ContainmentDisplayHints hints)
 
void contextualActionsAboutToShow ()
 
void contextualActionsChanged (const QList< QAction * > &actions)
 
void destroyedChanged (bool destroyed)
 
void effectiveBackgroundHintsChanged ()
 
void formFactorChanged (Plasma::Types::FormFactor formFactor)
 
void globalShortcutChanged (const QKeySequence &sequence)
 
void hasConfigurationInterfaceChanged (bool hasConfiguration)
 
void iconChanged (const QString &icon)
 
void immutabilityChanged (Plasma::Types::ImmutabilityType immutable)
 
void internalActionsChanged (const QList< QAction * > &actions)
 
void locationChanged (Plasma::Types::Location location)
 
void secondaryActivated ()
 
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 setImmutability (const Types::ImmutabilityType immutable)
 
void setLaunchErrorMessage (const QString &reason=QString())
 
void setStatus (const Types::ItemStatus stat)
 

Public Member Functions

 Applet (QObject *parentObject, const KPluginMetaData &data, const QVariantList &args)
 
Plasma::Types::BackgroundHints backgroundHints () const
 
KConfigGroup config () const
 
KConfigLoaderconfigScheme () const
 
KConfigPropertyMapconfiguration ()
 
bool configurationRequired () const
 
QString configurationRequiredReason () const
 
ConstraintHints constraintHints () 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
 
QString icon () const
 
uint id () const
 
Types::ImmutabilityType immutability () const
 
bool immutable () const
 
Q_INVOKABLE QActioninternalAction (const QString &name) const
 
QList< QAction * > internalActions () const
 
bool isBusy () const
 
bool isContainment () const
 
bool isUserConfiguring () const
 
QString launchErrorMessage () const
 
Types::Location location () const
 
KPluginMetaData pluginMetaData () const
 
QString pluginName () const
 
QML_LIST_PROPERTY_ASSIGN_BEHAVIOR_REPLACE QQmlListProperty< QActionqmlContextualActions ()
 
Q_INVOKABLE void removeInternalAction (const QString &name)
 
virtual void restore (KConfigGroup &group)
 
virtual void save (KConfigGroup &group) const
 
void setBackgroundHints (Plasma::Types::BackgroundHints hint)
 
void setBusy (bool busy)
 
void setConfigurationRequired (bool needsConfiguring, const QString &reason=QString())
 
void setConstraintHints (ConstraintHints constraintHints)
 
void setGlobalShortcut (const QKeySequence &shortcut=QKeySequence())
 
void setHasConfigurationInterface (bool hasInterface)
 
void setIcon (const QString &icon)
 
Q_INVOKABLE void setInternalAction (const QString &name, QAction *action)
 
void setTitle (const QString &title)
 
void setUserBackgroundHints (Plasma::Types::BackgroundHints hint)
 
void setUserConfiguring (bool configuring)
 
QVariantList startupArguments () const
 
Types::ItemStatus status () const
 
QString title () const
 
QString translationDomain () const
 
void updateConstraints (Constraints constraints=AllConstraints)
 
Plasma::Types::BackgroundHints userBackgroundHints () const
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
QBindable< QStringbindableObjectName ()
 
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 () const const
 
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 QRegularExpression &re, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (Qt::FindChildOptions options) const const
 
bool inherits (const char *className) const const
 
void installEventFilter (QObject *filterObj)
 
bool isQuickItemType () const const
 
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_EMIT Q_EMIT
 
 Q_ENUM (...)
 
 Q_ENUM_NS (...)
 
 Q_ENUMS (...)
 
 Q_FLAG (...)
 
 Q_FLAG_NS (...)
 
 Q_FLAGS (...)
 
 Q_GADGET Q_GADGET
 
 Q_GADGET_EXPORT (EXPORT_MACRO)
 
 Q_INTERFACES (...)
 
 Q_INVOKABLE Q_INVOKABLE
 
 Q_MOC_INCLUDE Q_MOC_INCLUDE
 
 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
 
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 setObjectName (QAnyStringView name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool setProperty (const char *name, QVariant &&value)
 
bool signalsBlocked () const const
 
int startTimer (int interval, Qt::TimerType timerType)
 
int startTimer (std::chrono::milliseconds interval, Qt::TimerType timerType)
 
QThreadthread () const const
 

Protected Member Functions

virtual void constraintsEvent (Constraints constraints)
 
virtual void saveState (KConfigGroup &config) const
 
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

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

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. 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 63 of file applet.h.

Member Typedef Documentation

◆ ConstraintHints

◆ Constraints

Definition at line 225 of file applet.h.

Member Enumeration Documentation

◆ Constraint

The Constraint enumeration lists the various constraints that Plasma objects have managed for them and which they may wish to react to, for instance in Applet::constraintsUpdated.

Enumerator
NoConstraint 

No constraint; never passed in to Applet::constraintsEvent on its own.

FormFactorConstraint 

The FormFactor for an object.

LocationConstraint 

The Location of an object.

ScreenConstraint 

Which screen an object is on.

ImmutableConstraint 

the immutability (locked) nature of the applet changed

StartupCompletedConstraint 

application startup has completed

UiReadyConstraint 

The ui has been completely loaded.

Definition at line 213 of file applet.h.

◆ ConstraintHint

This enumeration lists the various hints that an applet can pass to its constraint regarding the way that it is represented.

Enumerator
CanFillArea 

The CompactRepresentation can fill the area and ignore constraint margins.

MarginAreasSeparator 

The applet acts as a separator between the standard and slim panel margin areas.

Definition at line 231 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 135 of file applet.h.

◆ busy

bool Plasma::Applet::busy
readwrite

True if the applet should show a busy status, for instance doing some network operation.

Definition at line 125 of file applet.h.

◆ configuration

KConfigPropertyMap * Plasma::Applet::configuration
read

A KConfigPropertyMap instance that represents the configuration which is usable from QML to read and write settings like any JavaScript Object.

Definition at line 154 of file applet.h.

◆ configurationRequired

bool Plasma::Applet::configurationRequired
readwrite

If true the applet requires manual configuration from the user TODO KF6: having just a reson property and required would be string not empty? Uglier from c++ pov but more straight forward from qml pov.

Definition at line 168 of file applet.h.

◆ constraintHints

Applet::ConstraintHints Plasma::Applet::constraintHints
readwrite

The hints that the applet gives to its constraint, such as asking to fill all the available space ignoring margins.

Definition at line 179 of file applet.h.

◆ containment

Plasma::Containment * Plasma::Applet::containment
read

The Containment managing this applet.

Definition at line 189 of file applet.h.

◆ containmentDisplayHints

Plasma::Types::ContainmentDisplayHints Plasma::Applet::containmentDisplayHints
read

Display hints that come from the containment that suggest the applet how to look and behave.

TODO: only in containment?

Definition at line 119 of file applet.h.

◆ contextualActions

QList< QAction * > Plasma::Applet::contextualActions
read

Actions to be added in the plasmoid context menu.

To instantiate QActions in a declarative way, PlasmaCore.Action {} can be used

Definition at line 195 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 145 of file applet.h.

◆ formFactor

Plasma::Types::FormFactor Plasma::Applet::formFactor
read

The current form factor the applet is being displayed in.

See also
Plasma::FormFactor

Definition at line 88 of file applet.h.

◆ globalShortcut

QKeySequence Plasma::Applet::globalShortcut
readwrite

The global shortcut to activate the plasmoid.

This is typically only used by the default configuration module

Definition at line 162 of file applet.h.

◆ hasConfigurationInterface

bool Plasma::Applet::hasConfigurationInterface
readwrite

True if this applet will provide a UI for its configuration.

Definition at line 173 of file applet.h.

◆ icon

QString Plasma::Applet::icon
readwrite

Icon to represent the plasmoid.

Definition at line 79 of file applet.h.

◆ id

uint Plasma::Applet::id
read

Applet id: is unique in the whole Plasma session and will never change across restarts.

Definition at line 69 of file applet.h.

◆ immutability

Plasma::Types::ImmutabilityType Plasma::Applet::immutability
readwrite

The immutability of the Corona.

Tells the applet whether it should allow for any modification by the user.

Definition at line 106 of file applet.h.

◆ immutable

bool Plasma::Applet::immutable
read

Whether the Corona is immutable.

The plasmoid implementation should avoid allowing "dangerous" modifications from the user when in an immutable mode

This is true when immutability is not Mutable

Definition at line 113 of file applet.h.

◆ isContainment

bool Plasma::Applet::isContainment
read

True if this applet is a Containment and is acting as one, such as a desktop or a panel.

Definition at line 200 of file applet.h.

◆ location

Plasma::Types::Location Plasma::Applet::location
read

The location of the scene which is displaying applet.

See also
Plasma::Types::Location

Definition at line 95 of file applet.h.

◆ metaData

KPluginMetaData Plasma::Applet::metaData
read

The metadata of the applet.

Definition at line 184 of file applet.h.

◆ pluginName

QString Plasma::Applet::pluginName
read

Plugin name for the applet.

Definition at line 205 of file applet.h.

◆ status

Plasma::Types::ItemStatus Plasma::Applet::status
readwrite

Status of the plasmoid: useful to instruct the shell if this plasmoid is requesting attention, if is accepting input, or if is in an idle, inactive state.

Definition at line 100 of file applet.h.

◆ title

QString Plasma::Applet::title
readwrite

User friendly title for the plasmoid: it's the localized applet name by default.

Definition at line 74 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 140 of file applet.h.

◆ userConfiguring

bool Plasma::Applet::userConfiguring
read

True when the user is configuring, for instance when the configuration dialog is open.

Definition at line 130 of file applet.h.

Constructor & Destructor Documentation

◆ Applet()

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 41 of file applet.cpp.

◆ ~Applet()

Plasma::Applet::~Applet ( )
override

Definition at line 62 of file applet.cpp.

Member Function Documentation

◆ 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.

◆ 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

Definition at line 335 of file applet.cpp.

◆ 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 189 of file applet.cpp.

◆ configChanged

void Plasma::Applet::configChanged ( )
virtualslot

Called when applet configuration values have changed.

Definition at line 800 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 238 of file applet.cpp.

◆ configuration()

KConfigPropertyMap * Plasma::Applet::configuration ( )
Returns
a KConfigPropertyMap instance that represents the configuration which is usable from QML to read and write settings like any JavaScript Object

◆ configurationRequired()

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

Definition at line 467 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 472 of file applet.cpp.

◆ constraintHints()

Applet::ConstraintHints Plasma::Applet::constraintHints ( ) const
Returns
The constraint hints such as CanFillArea or MarginAreasSeparator, they can be in bitwise OR

Definition at line 499 of file applet.cpp.

◆ constraintHintsChanged

void Plasma::Applet::constraintHintsChanged ( Plasma::Applet::ConstraintHints constraintHints)
signal

Emitted when the constraint hints changed.

See also
setConstraintHints

◆ constraintsEvent()

void Plasma::Applet::constraintsEvent ( Constraints constraints)
protectedvirtual

Definition at line 271 of file applet.cpp.

◆ containment()

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

Definition at line 707 of file applet.cpp.

◆ containmentChanged

void Plasma::Applet::containmentChanged ( Plasma::Containment * containment)
signal

Emitted when the containment changes.

◆ 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

Definition at line 700 of file applet.cpp.

◆ containmentDisplayHintsChanged

void Plasma::Applet::containmentDisplayHintsChanged ( Plasma::Types::ContainmentDisplayHints hints)
signal

Emitted when the containment display hints change.

◆ contextualActions()

virtual 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.

◆ 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.

◆ contextualActionsChanged

void Plasma::Applet::contextualActionsChanged ( const QList< QAction * > & actions)
signal

Emitted when the list of contextual actions has changed.

◆ 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 222 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 233 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

Definition at line 356 of file applet.cpp.

◆ 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 462 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 533 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

Definition at line 686 of file applet.cpp.

◆ 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 202 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 757 of file applet.cpp.

◆ globalShortcutChanged

void Plasma::Applet::globalShortcutChanged ( const QKeySequence & sequence)
signal

Emitted when the global shortcut to activate this applet has chanaged.

◆ hasConfigurationInterface()

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

Definition at line 775 of file applet.cpp.

◆ hasConfigurationInterfaceChanged

void Plasma::Applet::hasConfigurationInterfaceChanged ( bool hasConfiguration)
signal

Emitted when the applet gains or loses the ability to show a configuration interface.

See also
hasConfigurationInterface
Since
6.0

◆ icon()

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

Definition at line 305 of file applet.cpp.

◆ 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 92 of file applet.cpp.

◆ immutability()

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

Definition at line 401 of file applet.cpp.

◆ immutabilityChanged

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

Emitted when the immutability changes.

Since
4.4

◆ immutable()

bool Plasma::Applet::immutable ( ) const
Returns
true if immutability() is not Types::Mutable

Definition at line 452 of file applet.cpp.

◆ 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 87 of file applet.cpp.

◆ internalAction()

QAction * Plasma::Applet::internalAction ( const QString & name) const
Returns
the internal action with the given name if available
Parameters
namethe unique name of the action we want

Definition at line 662 of file applet.cpp.

◆ internalActions()

QList< QAction * > Plasma::Applet::internalActions ( ) const
Returns
All the internal actions such as configure, remove, alternatives etc

Definition at line 681 of file applet.cpp.

◆ internalActionsChanged

void Plasma::Applet::internalActionsChanged ( const QList< QAction * > & actions)
signal

Emitted when the list of internal actions has changed.

◆ 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 320 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 865 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 504 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 457 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

Definition at line 769 of file applet.cpp.

◆ locationChanged

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

Emitted when the location changes.

◆ pluginMetaData()

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

Definition at line 391 of file applet.cpp.

◆ pluginName()

QString Plasma::Applet::pluginName ( ) const
Returns
the plugin name form KPluginMetaData

Definition at line 396 of file applet.cpp.

◆ qmlContextualActions()

QQmlListProperty< QAction > Plasma::Applet::qmlContextualActions ( )

Definition at line 628 of file applet.cpp.

◆ removeInternalAction()

void Plasma::Applet::removeInternalAction ( const QString & name)

Removes an action from the internal actions.

Parameters
namethe action to be removed

Definition at line 667 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 135 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 102 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 179 of file applet.cpp.

◆ secondaryActivated

void Plasma::Applet::secondaryActivated ( )
signal

Emitted when activation is requested due to, for example, middle click.

Since
6.3

◆ 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 340 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 325 of file applet.cpp.

◆ setConfigurationRequired()

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

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 477 of file applet.cpp.

◆ setConstraintHints()

void Plasma::Applet::setConstraintHints ( ConstraintHints constraintHints)

Sets the constraint hits which give a more granular control over sizing in constrained layouts such as panels.

Parameters
constraintHintssuch as CanFillArea or MarginAreasSeparator, they can be in bitwise OR

Definition at line 489 of file applet.cpp.

◆ setGlobalShortcut()

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

Sets the global shortcut to associate with this widget.

Definition at line 731 of file applet.cpp.

◆ setHasConfigurationInterface()

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

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 780 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 310 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 438 of file applet.cpp.

◆ setInternalAction()

void Plasma::Applet::setInternalAction ( const QString & name,
QAction * action )

Add a new internal action.

if an internal action with the same name already exists, it will be replaced with this new one. Those are usually actions defined by the system, such as "configure" and "remove"

Parameters
nameThe unique name for the action
actionThe new QAction to be added

Definition at line 640 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 169 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 524 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 295 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 370 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 509 of file applet.cpp.

◆ startupArguments()

QVariantList Plasma::Applet::startupArguments ( ) const
Returns
the arguments this applet was started with. Some applets support arguments, for instance the notes applet supports to be instantiated with a given text already passed as paramenter

Definition at line 97 of file applet.cpp.

◆ status()

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

Definition at line 519 of file applet.cpp.

◆ 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 837 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.

Definition at line 282 of file applet.cpp.

◆ titleChanged

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

Emitted when the title has changed.

Since
5.20

◆ translationDomain()

QString Plasma::Applet::translationDomain ( ) const

The translation domain for this applet.

Since
6.1

Definition at line 877 of file applet.cpp.

◆ updateConstraints()

void Plasma::Applet::updateConstraints ( Constraints constraints = 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 266 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

Definition at line 365 of file applet.cpp.

◆ 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-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:10:41 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.