Plasma
containment.cpp
40 Containment::Containment(QObject *parentObject, const KPluginMetaData &data, const QVariantList &args)
201 defaultActionsCfg = KConfigGroup(KSharedConfig::openConfig(corona()->kPackage().filePath("defaults")), "Panel");
204 defaultActionsCfg = KConfigGroup(KSharedConfig::openConfig(corona()->kPackage().filePath("defaults")), "Desktop");
398 if (immutability() != Types::Mutable && !applet->property("org.kde.plasma:force-create").toBool()) {
429 const QString oldGroupPrefix = QStringLiteral("Containments") + QString::number(currentContainment->id()) + QStringLiteral("Applets");
430 const QString newGroupPrefix = QStringLiteral("Containments") + QString::number(id()) + QStringLiteral("Applets");
432 applet->configScheme()->setCurrentGroup(applet->configScheme()->currentGroup().replace(0, oldGroupPrefix.length(), newGroupPrefix));
444 auto position = std::lower_bound(d->applets.begin(), d->applets.end(), applet, [](Plasma::Applet *a1, Plasma::Applet *a2) {
454 connect(applet, SIGNAL(appletDeleted(Plasma::Applet *)), this, SLOT(appletDeleted(Plasma::Applet *)));
455 connect(applet, SIGNAL(statusChanged(Plasma::Types::ItemStatus)), this, SLOT(checkStatus(Plasma::Types::ItemStatus)));
457 connect(this, &Containment::containmentDisplayHintsChanged, applet, &Applet::containmentDisplayHintsChanged);
virtual void saveContents(KConfigGroup &group) const
Called when the contents of the containment should be saved.
Definition: containment.cpp:247
void append(const T &value)
void restore(KConfigGroup &group) override
Definition: containment.cpp:160
QAction * addAction(const QString &name, const QObject *receiver=nullptr, const char *member=nullptr)
void setFormFactor(Plasma::Types::FormFactor formFactor)
Sets the form factor for this Containment.
Definition: containment.cpp:333
QString readEntry(const char *key, const char *aDefault=nullptr) const
void writeEntry(const char *key, const char *value, WriteConfigFlags pFlags=Normal)
QAction * action(const QString &name) const
void appletAdded(Plasma::Applet *applet)
This signal is emitted when a new applet is added in the containment It may happen in the following s...
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
void setCurrentGroup(const QString &group)
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)
QString number(int n, int base)
void deleteEntry(const char *key, WriteConfigFlags pFlags=Normal)
KConfigSkeletonItem::List items() const
Q_EMITQ_EMIT
void appletCreated(Plasma::Applet *applet)
This signal is emitted when a new applet is created by the containment.
@ CustomContainment
A containment that is neither a desktop nor a panel but something application specific.
Definition: plasma.h:119
QIcon fromTheme(const QString &name)
bool isValid() const
void configNeedsSaving()
Emitted when an applet has changed values in its configuration and wishes for them to be saved at the...
Corona * corona() const
Returns the Corona (if any) that this Containment is hosted by.
Definition: containment.cpp:318
ContainmentActions * loadContainmentActions(Containment *parent, const QString &containmentActionsName, const QVariantList &args=QVariantList())
Load a ContainmentActions plugin.
Definition: pluginloader.cpp:325
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
FormFactor
The FormFactor enumeration describes how a Plasma::Applet should arrange itself.
Definition: plasma.h:72
void deleteGroup(const char *group, WriteConfigFlags flags=Normal)
virtual void restoreContents(KConfigGroup &group)
Called when the contents of the containment should be loaded.
Definition: containment.cpp:256
KActionCollection * actions() const
The actions associated with this Corona.
Definition: corona.cpp:443
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
void setContainmentActions(const QString &trigger, const QString &pluginName)
Sets a containmentactions plugin.
Definition: containment.cpp:526
void save(KConfigGroup &group) const override
Definition: containment.cpp:222
void appletRemoved(Plasma::Applet *applet)
This signal is emitted when an applet is destroyed.
Plasma::Types::ContainmentType containmentType() const
Returns the type of containment.
Definition: containment.cpp:303
void reparent(KConfigBase *parent, WriteConfigFlags pFlags=Normal)
bool exists() const
T & next()
void setIcon(const QIcon &icon)
void containmentTypeChanged()
emitted when the containment type changed
QString i18n(const char *text, const TYPE &arg...)
KPluginMetaData metadata() const
Definition: containmentactions.cpp:57
bool hasNext() const const
void setContainmentDisplayHints(Plasma::Types::ContainmentDisplayHints hints)
Set Display hints that come from the containment that suggest the applet how to look and behave.
Definition: containment.cpp:350
@ SystemImmutable
the item is locked down by the system, the user can't unlock it
Definition: plasma.h:239
virtual void init()
This method is called once the applet is loaded and added to a Corona.
Definition: applet.cpp:168
bool isEmpty() const const
QString currentGroup() const
int length() const const
KPackage::Package kPackage() const
Accessor for the associated Package object if any.
Definition: applet.cpp:345
void setContainment(Containment *newContainment)
newContainment the containment the plugin should be associated with.
Definition: containmentactions.cpp:153
void setText(const QString &text)
KConfigGroup group(const char *group)
uint toUInt(bool *ok, int base) const const
bool toBool() const const
bool value(const QString &key, bool defaultValue) const
QString & replace(int position, int n, QChar after)
KCONFIGCORE_EXPORT bool authorize(const QString &action)
void setVisible(bool)
void activated()
Emitted when activation is requested due to, for example, a global keyboard shortcut.
void wallpaperChanged()
Emitted when the wallpaper plugin is changed.
void addApplet(Applet *applet)
Add an existing applet to this Containment.
Definition: containment.cpp:389
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)
QStringList keyList() const
void locationChanged(Plasma::Types::Location location)
Emitted when the location has changed.
void activityChanged(const QString &activity)
Emitted when the activity id has changed.
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
ImmutabilityType
Defines the immutability of items like applets, corona and containments they can be free to modify,...
Definition: plasma.h:235
void configureRequested(Plasma::Applet *applet)
Emitted when the user wants to configure/change the containment, or an applet inside it.
QString i18nc(const char *context, const char *text, const TYPE &arg...)
QList::iterator begin()
QString name() const
void formFactorChanged(Plasma::Types::FormFactor formFactor)
Emitted when the formFactor has changed.
void setContainmentType(Plasma::Types::ContainmentType type)
Sets the type of this containment.
Definition: containment.cpp:308
void setActivity(const QString &activityId)
Sets the current activity by id.
Definition: containment.cpp:575
QList::iterator end()
QString pluginId() const
void appletDeleted(Plasma::Applet *applet)
Emitted when the applet is deleted.
The base class for plugins that provide backgrounds and applet grouping containers.
Definition: containment.h:45
void setLocation(Plasma::Types::Location location)
Informs the Corona as to what position it is in.
Definition: containment.cpp:360
QHash< QString, ContainmentActions * > & containmentActions()
Definition: containment.cpp:565
QObject * parent() const const
void screenChanged(int newScreen)
This signal indicates that a containment has been associated (or dissociated) with a physical screen.
void updateConstraints(Plasma::Types::Constraints constraints=Plasma::Types::AllConstraints)
Called when any of the geometry constraints have been updated.
Definition: applet.cpp:350
virtual void restore(const KConfigGroup &config)
This method should be called once the plugin is loaded or settings are changed.
Definition: containmentactions.cpp:70
Applet * createApplet(const QString &name, const QVariantList &args=QVariantList())
Adds an applet to this Containment.
Definition: containment.cpp:380
QVariant property(const char *name) const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Sep 26 2023 04:05:56 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Sep 26 2023 04:05:56 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.