Plasma-framework
applet.cpp
211 QString group = isContainment() ? QStringLiteral("ContainmentGlobals") : QStringLiteral("AppletGlobals");
247 const QString xmlPath = d->package.isValid() ? d->package.filePath("mainconfigxml") : QString();
254 QObject::connect(d->configLoader, SIGNAL(configChanged()), this, SLOT(propagateConfigChanged()));
265 connect(d->configPropertyMap, &KConfigPropertyMap::valueChanged, this, &Applet::configNeedsSaving);
547 // qCDebug(LOG_PLASMA) << "flushing constraints: " << d->pendingConstraints << "!!!!!!!!!!!!!!!!!!!!!!!!!!!";
568 bool canConfig = unlocked || KAuthorized::authorize(QStringLiteral("plasma/allow_configure_when_locked"));
585 bool canConfig = unlocked || KAuthorized::authorize(QStringLiteral("plasma/allow_configure_when_locked"));
731 connect(KGlobalAccel::self(), &KGlobalAccel::globalShortcutChanged, this, [this](QAction *action, const QKeySequence &shortcut) {
784 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:269
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:107
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:772
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:659
void setStatus(const Types::ItemStatus stat)
sets the status for this applet
Definition applet.cpp:527
Q_INVOKABLE QAction * internalAction(const QString &name) const
Definition applet.cpp:654
KConfigGroup config() const
Returns the KConfigGroup to access the applets configuration.
Definition applet.cpp:194
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:465
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
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:373
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:480
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:298
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.
void appletDeleted(Plasma::Applet *applet)
Emitted when the applet is deleted.
virtual void init()
This method is called once the applet is loaded and added to a Corona.
Definition applet.cpp:92
virtual void configChanged()
Called when applet configuration values have changed.
Definition applet.cpp:792
void setUserConfiguring(bool configuring)
Tells the applet the user is configuring.
Definition applet.cpp:512
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:723
void setConstraintHints(ConstraintHints constraintHints)
Sets the constraint hits which give a more granular control over sizing in constrained layouts such a...
Definition applet.cpp:492
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:207
void setLaunchErrorMessage(const QString &reason=QString())
Call this method when the applet fails to launch properly.
Definition applet.cpp:174
QString configurationRequiredReason() const
Definition applet.cpp:475
Q_INVOKABLE void setInternalAction(const QString &name, QAction *action)
Add a new internal action.
Definition applet.cpp:632
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:184
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:328
void setImmutability(const Types::ImmutabilityType immutable)
Sets the immutability type for this applet (not immutable, user immutable or system immutable)
Definition applet.cpp:441
void setBackgroundHints(Plasma::Types::BackgroundHints hint)
Sets the applet background hints.
Definition applet.cpp:343
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:536
Applet(QObject *parentObject, const KPluginMetaData &data, const QVariantList &args)
This constructor can be used with the KCoreAddons plugin loading system.
Definition applet.cpp:47
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:243
bool hasConfigurationInterface
True if this applet will provide a UI for its configuration.
Definition applet.h:173
void constraintHintsChanged(ConstraintHints constraintHints)
Emitted when the constraint hints changed.
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:460
virtual void restore(KConfigGroup &group)
Restores state information about this applet saved previously in save(KConfigGroup&).
Definition applet.cpp:140
The base class for plugins that provide backgrounds and applet grouping containers.
Definition containment.h:47
void requestConfigSync()
Schedules a flush-to-disk synchronization of the configuration state at the next convenient moment.
Definition corona.cpp:109
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
Q_SCRIPTABLE CaptureState status()
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
int keyToValue(const char *key, bool *ok) const const
const char * valueToKey(int value) const const
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
void setObjectName(QAnyStringView name)
bool setProperty(const char *name, QVariant &&value)
void valueChanged(const QString &key, const QVariant &value)
bool isEmpty() const const
QByteArray toUtf8() const const
UniqueConnection
bool canConvert() const const
QVariant fromValue(T &&value)
T value() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 17 2024 11:54:11 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 17 2024 11:54:11 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.