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 (QObject *parent=nullptr, const QString &serviceId=QString(), uint appletId=0)
 
 Applet (const KPluginInfo &info, QObject *parent=nullptr, uint appletId=0)
 
 Applet (const KPluginMetaData &metadata, QObject *parent=nullptr, uint appletId=0)
 
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 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
 
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 (QObject *object)
 
qobject_cast (const 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 *receiver, PointerToMemberFunction method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, Functor functor)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type)
 
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, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &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 53 of file applet.h.

Property Documentation

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

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

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

Definition at line 78 of file applet.h.

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

Constructor & Destructor Documentation

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

Definition at line 72 of file applet.cpp.

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

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

Definition at line 56 of file applet.cpp.

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

Definition at line 82 of file applet.cpp.

Member Function Documentation

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

Returns the collection of actions for this Applet.

Definition at line 682 of file applet.cpp.

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.

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

Emitted when the applet is deleted.

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

Definition at line 828 of file applet.cpp.

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

Definition at line 833 of file applet.cpp.

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
void Plasma::Applet::backgroundHintsChanged ( )
signal

Emitted when the background hints have changed.

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

Emitted when the busy status has changed.

Since
5.21
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 251 of file applet.cpp.

void Plasma::Applet::configChanged ( )
virtualslot

Called when applet configuration values have changed.

Definition at line 794 of file applet.cpp.

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

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

Definition at line 528 of file applet.cpp.

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

Emitted when setConfigurationRequired was called.

See also
setConfigurationRequired
Since
5.20
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 533 of file applet.cpp.

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

Definition at line 708 of file applet.cpp.

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

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.

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

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

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
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
void Plasma::Applet::effectiveBackgroundHintsChanged ( )
signal

Emitted when the effective background hints have changed.

Since
5.65
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 523 of file applet.cpp.

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

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

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

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

Emitted when the formfactor changes.

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

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

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

Definition at line 770 of file applet.cpp.

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

Definition at line 843 of file applet.cpp.

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

Emitted when the icon name for the applet has changed.

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

Definition at line 142 of file applet.cpp.

Types::ImmutabilityType Plasma::Applet::immutability ( ) const
Returns
The type of immutability of this applet
void Plasma::Applet::immutabilityChanged ( Plasma::Types::ImmutabilityType  immutable)
signal

Emitted when the immutability changes.

Since
4.4
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 137 of file applet.cpp.

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

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

Definition at line 892 of file applet.cpp.

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

Definition at line 550 of file applet.cpp.

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

Definition at line 324 of file applet.cpp.

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

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

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

Returns the location of the scene which is displaying applet.

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

Emitted when the location changes.

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

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

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

Definition at line 462 of file applet.cpp.

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 reimplmented by Applet subclasses, but can be useful for Applet specializations (such as Containment) to do so.

Reimplemented in Plasma::Containment.

Definition at line 180 of file applet.cpp.

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

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

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

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

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

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

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

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

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

Sets the global shortcut to associate with this widget.

Definition at line 732 of file applet.cpp.

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

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

Sets an icon name for this applet.

Parameters
iconFreedesktop compatible icon name

Definition at line 376 of file applet.cpp.

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

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

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

sets the status for this applet

Since
4.4

Definition at line 570 of file applet.cpp.

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

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

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

Tells the applet the user is configuring.

Parameters
configuringtrue if the configuration ui is showing

Definition at line 555 of file applet.cpp.

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

Emitted when the applet status changes.

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

Reimplemented from QObject.

Reimplemented from QObject.

Definition at line 864 of file applet.cpp.

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.
void Plasma::Applet::titleChanged ( const QString title)
signal

Emitted when the title has changed.

Since
5.20
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 329 of file applet.cpp.

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
void Plasma::Applet::userBackgroundHintsChanged ( )
signal

Emitted when the user background hints have changed.

Since
5.65
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-2021 The KDE developers.
Generated on Wed May 12 2021 22:41:03 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.