Libplasma
applet.cpp
206 QString group = isContainment() ? QStringLiteral("ContainmentGlobals") : QStringLiteral("AppletGlobals");
242 const QString xmlPath = d->package.isValid() ? d->package.filePath("mainconfigxml") : QString();
249 QObject::connect(d->configLoader, SIGNAL(configChanged()), this, SLOT(propagateConfigChanged()));
544 // qCDebug(LOG_PLASMA) << "flushing constraints: " << d->pendingConstraints << "!!!!!!!!!!!!!!!!!!!!!!!!!!!";
565 bool canConfig = unlocked || KAuthorized::authorize(QStringLiteral("plasma/allow_configure_when_locked"));
582 bool canConfig = unlocked || KAuthorized::authorize(QStringLiteral("plasma/allow_configure_when_locked"));
739 connect(KGlobalAccel::self(), &KGlobalAccel::globalShortcutChanged, this, [this](QAction *action, const QKeySequence &shortcut) {
792 enable = unlocked || KAuthorized::authorize(QStringLiteral("plasma/allow_configure_when_locked"));
static Q_INVOKABLE bool authorize(const QString &action)
QString readEntryUntranslated(const char *key, const QString &aDefault=QString()) const
void writeEntry(const char *key, const char *value, WriteConfigFlags pFlags=Normal)
bool isValid() const
KConfig * config()
QString readEntry(const char *key, const char *aDefault=nullptr) const
void copyTo(KConfigBase *other, WriteConfigFlags pFlags=Normal) const
QString name() const
static KGlobalAccel * self()
bool setShortcut(QAction *action, const QList< QKeySequence > &shortcut, GlobalShortcutLoading loadFlag=Autoloading)
NoAutoloading
QList< QKeySequence > shortcut(const QAction *action) const
void globalShortcutChanged(QAction *action, const QKeySequence &seq)
uint id
Applet id: is unique in the whole Plasma session and will never change across restarts.
Definition applet.h:69
void updateConstraints(Constraints constraints=AllConstraints)
Called when any of the geometry constraints have been updated.
Definition applet.cpp:266
virtual void save(KConfigGroup &group) const
Saves state information about this applet that will be accessed when next instantiated in the restore...
Definition applet.cpp:102
Plasma::Types::ContainmentDisplayHints containmentDisplayHints
Display hints that come from the containment that suggest the applet how to look and behave.
Definition applet.h:119
QQmlListProperty< QAction > contextualActions
Actions to be added in the plasmoid context menu.
Definition applet.h:195
void setHasConfigurationInterface(bool hasInterface)
Sets whether or not this applet provides a user interface for configuring the applet.
Definition applet.cpp:780
Plasma::Types::Location location
The location of the scene which is displaying applet.
Definition applet.h:95
Q_INVOKABLE void removeInternalAction(const QString &name)
Removes an action from the internal actions.
Definition applet.cpp:667
void setStatus(const Types::ItemStatus stat)
sets the status for this applet
Definition applet.cpp:524
Q_INVOKABLE QAction * internalAction(const QString &name) const
Definition applet.cpp:662
KConfigGroup config() const
Returns the KConfigGroup to access the applets configuration.
Definition applet.cpp:189
bool failedToLaunch() const
If for some reason, the applet fails to get up on its feet (the library couldn't be loaded,...
Definition applet.cpp:462
void titleChanged(const QString &title)
Emitted when the title has changed.
Plasma::Types::BackgroundHints backgroundHints
How the applet wants its background to be drawn.
Definition applet.h:135
void constraintHintsChanged(Plasma::Applet::ConstraintHints constraintHints)
Emitted when the constraint hints changed.
Plasma::Types::BackgroundHints userBackgroundHints
The containment (and/or the user) may decide to use another kind of background instead (if supported ...
Definition applet.h:140
void setUserBackgroundHints(Plasma::Types::BackgroundHints hint)
Sets the hints the user wished the background style for the applet to be.
Definition applet.cpp:370
void 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 stand...
Definition applet.cpp:477
void internalActionsChanged(const QList< QAction * > &actions)
Emitted when the list of internal actions has changed.
@ NoConstraint
No constraint; never passed in to Applet::constraintsEvent on its own.
Definition applet.h:214
Applet::ConstraintHints constraintHints
The hints that the applet gives to its constraint, such as asking to fill all the available space ign...
Definition applet.h:179
bool isContainment
True if this applet is a Containment and is acting as one, such as a desktop or a panel.
Definition applet.h:200
void globalShortcutChanged(const QKeySequence &sequence)
Emitted when the global shortcut to activate this applet has chanaged.
void effectiveBackgroundHintsChanged()
Emitted when the effective background hints have changed.
void setTitle(const QString &title)
Sets a custom title for this instance of the applet.
Definition applet.cpp:295
void configNeedsSaving()
Emitted when an applet has changed values in its configuration and wishes for them to be saved at the...
void activated()
Emitted when activation is requested due to, for example, a global keyboard shortcut.
virtual void init()
This method is called once the applet is loaded and added to a Corona.
Definition applet.cpp:87
virtual void configChanged()
Called when applet configuration values have changed.
Definition applet.cpp:800
void setUserConfiguring(bool configuring)
Tells the applet the user is configuring.
Definition applet.cpp:509
void hasConfigurationInterfaceChanged(bool hasConfiguration)
Emitted when the applet gains or loses the ability to show a configuration interface.
void setGlobalShortcut(const QKeySequence &shortcut=QKeySequence())
Sets the global shortcut to associate with this widget.
Definition applet.cpp:731
void setConstraintHints(ConstraintHints constraintHints)
Sets the constraint hits which give a more granular control over sizing in constrained layouts such a...
Definition applet.cpp:489
void statusChanged(Plasma::Types::ItemStatus status)
Emitted when the applet status changes.
bool busy
True if the applet should show a busy status, for instance doing some network operation.
Definition applet.h:125
KConfigPropertyMap * configuration
A KConfigPropertyMap instance that represents the configuration which is usable from QML to read and ...
Definition applet.h:154
Plasma::Types::FormFactor formFactor
The current form factor the applet is being displayed in.
Definition applet.h:88
KConfigGroup globalConfig() const
Returns a KConfigGroup object to be shared by all applets of this type.
Definition applet.cpp:202
void setLaunchErrorMessage(const QString &reason=QString())
Call this method when the applet fails to launch properly.
Definition applet.cpp:169
QString configurationRequiredReason() const
Definition applet.cpp:472
Q_INVOKABLE void setInternalAction(const QString &name, QAction *action)
Add a new internal action.
Definition applet.cpp:640
void iconChanged(const QString &icon)
Emitted when the icon name for the applet has changed.
virtual void saveState(KConfigGroup &config) const
When called, the Applet should write any information needed as part of the Applet's running state to ...
Definition applet.cpp:179
Plasma::Types::ItemStatus status
Status of the plasmoid: useful to instruct the shell if this plasmoid is requesting attention,...
Definition applet.h:100
QString title
User friendly title for the plasmoid: it's the localized applet name by default.
Definition applet.h:74
void immutabilityChanged(Plasma::Types::ImmutabilityType immutable)
Emitted when the immutability changes.
void setBusy(bool busy)
Sets the Applet to have a busy status hint, for instance the applet doing some network operation.
Definition applet.cpp:325
void setImmutability(const Types::ImmutabilityType immutable)
Sets the immutability type for this applet (not immutable, user immutable or system immutable)
Definition applet.cpp:438
void setBackgroundHints(Plasma::Types::BackgroundHints hint)
Sets the applet background hints.
Definition applet.cpp:340
void backgroundHintsChanged()
Emitted when the background hints have changed.
void configurationRequiredChanged(bool needsConfig, const QString &reason)
Emitted when setConfigurationRequired was called.
Plasma::Types::BackgroundHints effectiveBackgroundHints
The effective background hints the applet has, internally decided how to mix with userBackgroundHints...
Definition applet.h:145
void formFactorChanged(Plasma::Types::FormFactor formFactor)
Emitted when the formfactor changes.
void flushPendingConstraintsEvents()
Sends all pending constraints updates to the applet.
Definition applet.cpp:533
Applet(QObject *parentObject, const KPluginMetaData &data, const QVariantList &args)
This constructor can be used with the KCoreAddons plugin loading system.
Definition applet.cpp:41
void locationChanged(Plasma::Types::Location location)
Emitted when the location changes.
void userConfiguringChanged(bool configuring)
emitted when the config ui appears or disappears
bool configurationRequired
If true the applet requires manual configuration from the user TODO KF6: having just a reson property...
Definition applet.h:168
KConfigLoader * configScheme() const
Returns the config skeleton object from this applet's package, if any.
Definition applet.cpp:238
bool hasConfigurationInterface
True if this applet will provide a UI for its configuration.
Definition applet.h:173
void userBackgroundHintsChanged()
Emitted when the user background hints have changed.
QString launchErrorMessage() const
If for some reason, the applet fails to get up on its feet (the library couldn't be loaded,...
Definition applet.cpp:457
virtual void restore(KConfigGroup &group)
Restores state information about this applet saved previously in save(KConfigGroup&).
Definition applet.cpp:135
KSharedConfig::Ptr config() const
Returns the config file used to store the configuration for this Corona.
Definition corona.cpp:230
ImmutabilityType
Defines the immutability of items like applets, corona and containments they can be free to modify,...
Definition plasma.h:99
@ SystemImmutable
the item is locked down by the system, the user can't unlock it
Definition plasma.h:103
Location
The Location enumeration describes where on screen an element, such as an Applet or its managing cont...
Definition plasma.h:81
@ Desktop
On the planar desktop layer, extending across the full screen from edge to edge.
Definition plasma.h:84
FormFactor
The FormFactor enumeration describes how a Plasma::Applet should arrange itself.
Definition plasma.h:40
QString i18n(const char *text, const TYPE &arg...)
void setEnabled(bool)
void triggered(bool checked)
void setVisible(bool)
const char * constData() const const
CppOwnership
ObjectOwnership objectOwnership(QObject *object)
T & first()
bool isEmpty() const const
QMetaEnum fromType()
int keyToValue(const char *key, bool *ok) const const
const char * valueToKey(int value) const const
QObject(QObject *parent)
Q_EMITQ_EMIT
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
void destroyed(QObject *obj)
bool disconnect(const QMetaObject::Connection &connection)
virtual bool event(QEvent *e)
QObject * parent() const const
T qobject_cast(QObject *object)
void setObjectName(QAnyStringView name)
void valueChanged(const QString &key, const QVariant &value)
bool isEmpty() const const
UniqueConnection
QVariant fromValue(T &&value)
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:48:23 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:48:23 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.