Plasma
applet.cpp
56 : KPluginMetaData::fromDesktopFile(path + QLatin1String("/metadata.desktop"), {QStringLiteral("plasma-applet.desktop")});
221 // qCDebug(LOG_PLASMA) << "got global shortcut for" << name() << "of" << QKeySequence(shortcutText);
286 QString group = isContainment() ? QStringLiteral("ContainmentGlobals") : QStringLiteral("AppletGlobals");
310 // FIXME: an animation on leave if !isContainment() would be good again .. which should be handled by the containment class
322 const QString xmlPath = d->package.isValid() ? d->package.filePath("mainconfigxml") : QString();
329 QObject::connect(d->configLoader, SIGNAL(configChanged()), this, SLOT(propagateConfigChanged()));
445 if (d->userBackgroundHintsInitialized && (d->backgroundHints & Plasma::Types::ConfigurableBackground)) {
499 // Returning the more strict immutability between the applet immutability, Containment and Corona
612 // qCDebug(LOG_PLASMA) << "flushing constraints: " << d->pendingConstraints << "!!!!!!!!!!!!!!!!!!!!!!!!!!!";
633 bool canConfig = unlocked || KAuthorized::authorize(QStringLiteral("plasma/allow_configure_when_locked"));
639 QAction *runAssociatedApplication = d->actions->action(QStringLiteral("run associated application"));
641 connect(runAssociatedApplication, &QAction::triggered, this, &Applet::runAssociatedApplication, Qt::UniqueConnection);
657 bool canConfig = unlocked || KAuthorized::authorize(QStringLiteral("plasma/allow_configure_when_locked"));
762 connect(KGlobalAccel::self(), &KGlobalAccel::globalShortcutChanged, this, [this](QAction *action, const QKeySequence &shortcut) {
813 enable = unlocked || KAuthorized::authorize(QStringLiteral("plasma/allow_configure_when_locked"));
835 QAction *runAssociatedApplication = d->actions->action(QStringLiteral("run associated application"));
847 QAction *runAssociatedApplication = d->actions->action(QStringLiteral("run associated application"));
882 if (types.contains(QLatin1String("Plasma/Containment")) || md.rawData().contains(QStringLiteral("X-Plasma-ContainmentType"))) {
T & first()
QString readEntry(const char *key, const char *aDefault=nullptr) const
void writeEntry(const char *key, const char *value, WriteConfigFlags pFlags=Normal)
QJsonObject rawData() const
KConfigGroup config() const
Returns the KConfigGroup to access the applets configuration.
Definition: applet.cpp:270
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:178
KActionCollection * actions() const
Returns the collection of actions for this Applet.
Definition: applet.cpp:705
KConfigLoader * configScheme() const
Returns the config skeleton object from this applet's package, if any.
Definition: applet.cpp:319
bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *method)
void requestConfigSync()
Schedules a flush-to-disk synchronization of the configuration state at the next convenient moment.
Definition: corona.cpp:133
void setStatus(const Types::ItemStatus stat)
sets the status for this applet
Definition: applet.cpp:593
QVariant fromValue(const T &value)
Q_EMITQ_EMIT
QStringList serviceTypes() const
NoAutoloading
T value() const const
bool contains(const QString &str, Qt::CaseSensitivity cs) const const
QString name() const
bool hasValidAssociatedApplication() const
Definition: applet.cpp:870
void runAssociatedApplication()
Open the application associated to this applet, if it's not set but some urls are,...
Definition: applet.cpp:865
void configurationRequiredChanged(bool needsConfig, const QString &reason)
Emitted when setConfigurationRequired was called.
QJsonObject fromVariantMap(const QVariantMap &map)
Plasma::Types::BackgroundHints backgroundHints
How the applet wants its background to be drawn.
Definition: applet.h:86
QString readEntryUntranslated(const char *key, const QString &aDefault=QString()) const
bool isValid() const
bool isValid() const
void configNeedsSaving()
Emitted when an applet has changed values in its configuration and wishes for them to be saved at the...
Plasma::Types::BackgroundHints effectiveBackgroundHints
The effective background hints the applet has, internally decided how to mix with userBackgroundHints...
Definition: applet.h:96
Corona * corona() const
Returns the Corona (if any) that this Containment is hosted by.
Definition: containment.cpp:318
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:561
void statusChanged(Plasma::Types::ItemStatus status)
Emitted when the applet status changes.
void setImmutability(const Types::ImmutabilityType immutable)
Sets the immutability type for this applet (not immutable, user immutable or system immutable)
Definition: applet.cpp:527
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:541
FormFactor
The FormFactor enumeration describes how a Plasma::Applet should arrange itself.
Definition: plasma.h:72
void setBusy(bool busy)
Sets the Applet to have a busy status hint, for instance the applet doing some network operation.
Definition: applet.cpp:412
bool exists() const const
void setGlobalShortcut(const QKeySequence &shortcut)
Sets the global shortcut to associate with this widget.
Definition: applet.cpp:755
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
bool contains(const QString &key) const const
@ NoConstraint
No constraint; never passed in to Applet::constraintsEvent on its own.
Definition: plasma.h:40
void effectiveBackgroundHintsChanged()
Emitted when the effective background hints have changed.
QString configurationRequiredReason() const
Definition: applet.cpp:556
KConfigGroup globalConfig() const
Returns a KConfigGroup object to be shared by all applets of this type.
Definition: applet.cpp:283
bool setShortcut(QAction *action, const QList< QKeySequence > &shortcut, GlobalShortcutLoading loadFlag=Autoloading)
void userBackgroundHintsChanged()
Emitted when the user background hints have changed.
bool hasConfigurationInterface() const
Definition: applet.cpp:797
virtual QList< QAction * > contextualActions()
Returns a list of context-related QAction instances.
Definition: applet.cpp:699
virtual bool event(QEvent *e)
QString i18n(const char *text, const TYPE &arg...)
void formFactorChanged(Plasma::Types::FormFactor formFactor)
Emitted when the formfactor changes.
@ Desktop
On the planar desktop layer, extending across the full screen from edge to edge.
Definition: plasma.h:161
static Applet * loadPlasmoid(const QString &path, uint appletId=0)
Attempts to load an applet from a package.
Definition: applet.cpp:876
const char * valueToKey(int value) const const
@ SystemImmutable
the item is locked down by the system, the user can't unlock it
Definition: plasma.h:239
void userConfiguringChanged(bool configuring)
emitted when the config ui appears or disappears
void setUserConfiguring(bool configuring)
Tells the applet the user is configuring.
Definition: applet.cpp:578
virtual void init()
This method is called once the applet is loaded and added to a Corona.
Definition: applet.cpp:168
int keyToValue(const char *key, bool *ok) const const
void iconChanged(const QString &icon)
Emitted when the icon name for the applet has changed.
bool isEmpty() const const
QByteArray toUtf8() const const
void immutabilityChanged(Plasma::Types::ImmutabilityType immutable)
Emitted when the immutability changes.
void setBackgroundHints(Plasma::Types::BackgroundHints hint)
Sets the applet background hints.
Definition: applet.cpp:427
KPackage::Package kPackage() const
Accessor for the associated Package object if any.
Definition: applet.cpp:345
Q_SCRIPTABLE CaptureState status()
UniqueConnection
bool isEmpty() const const
Plasma::Types::BackgroundHints userBackgroundHints
The containment (and/or the user) may decide to use another kind of background instead (if supported ...
Definition: applet.h:91
void locationChanged(Plasma::Types::Location location)
Emitted when the location changes.
void globalShortcutChanged(QAction *action, const QKeySequence &seq)
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:546
QMap< QString, QVariant > toMap() const const
KCONFIGCORE_EXPORT bool authorize(const QString &action)
bool canConvert(int targetTypeId) const const
void setVisible(bool)
void activated()
Emitted when activation is requested due to, for example, a global keyboard shortcut.
void setAssociatedApplication(const QString &string)
Sets an application associated to this applet, that will be regarded as a full view of what is repres...
Definition: applet.cpp:831
bool setProperty(const char *name, const QVariant &value)
void triggered(bool checked)
virtual void restore(KConfigGroup &group)
Restores state information about this applet saved previously in save(KConfigGroup&).
Definition: applet.cpp:211
void flushPendingConstraintsEvents()
Sends all pending constraints updates to the applet.
Definition: applet.cpp:602
void setEnabled(bool)
const char * constData() const const
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:256
void setUserBackgroundHints(Plasma::Types::BackgroundHints hint)
Sets the hints the user wished the background style for the applet to be.
Definition: applet.cpp:457
void setAssociatedApplicationUrls(const QList< QUrl > &urls)
Sets a list of urls associated to this application, they will be used as parameters for the associate...
Definition: applet.cpp:843
void setHasConfigurationInterface(bool hasInterface)
Sets whether or not this applet provides a user interface for configuring the applet.
Definition: applet.cpp:802
void setParent(QObject *parent)
Location
The Location enumeration describes where on screen an element, such as an Applet or its managing cont...
Definition: plasma.h:158
void setTitle(const QString &title)
Sets a custom title for this instance of the applet.
Definition: applet.cpp:382
void copyTo(KConfigBase *other, WriteConfigFlags pFlags=Normal) const
KGuiItem cont()
ImmutabilityType
Defines the immutability of items like applets, corona and containments they can be free to modify,...
Definition: plasma.h:235
void setLaunchErrorMessage(const QString &reason=QString())
Call this method when the applet fails to launch properly.
Definition: applet.cpp:246
virtual void configChanged()
Called when applet configuration values have changed.
Definition: applet.cpp:821
KConfig * config()
static KGlobalAccel * self()
void titleChanged(const QString &title)
Emitted when the title has changed.
Applet(QObject *parentObject, const KPluginMetaData &data, const QVariantList &args)
This constructor can be used with the KCoreAddons plugin loading system.
Definition: applet.cpp:128
void appletDeleted(Plasma::Applet *applet)
Emitted when the applet is deleted.
QString mid(int position, int n) const const
The base class for plugins that provide backgrounds and applet grouping containers.
Definition: containment.h:45
QString associatedApplication() const
Definition: applet.cpp:855
QList< QUrl > associatedApplicationUrls() const
Definition: applet.cpp:860
void backgroundHintsChanged()
Emitted when the background hints have changed.
QObject * parent() const const
QString message
void updateConstraints(Plasma::Types::Constraints constraints=Plasma::Types::AllConstraints)
Called when any of the geometry constraints have been updated.
Definition: applet.cpp:350
QList< QKeySequence > shortcut(const QAction *action) const
QString toString() const const
KSharedConfig::Ptr config() const
Returns the config file used to store the configuration for this Corona.
Definition: corona.cpp:276
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Feb 7 2023 04:15:01 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Feb 7 2023 04:15:01 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.