Libplasma
corona.cpp
149 setImmutability((Plasma::Types::ImmutabilityType)cg.readEntry("immutability", (int)Plasma::Types::Mutable));
157Containment *Corona::containmentForScreen(int screen, const QString &activity, const QString &defaultPluginIfNonExistent, const QVariantList &defaultArgs)
165 || cont->containmentType() == Plasma::Containment::Type::Custom || cont->containmentType() == Plasma::Containment::Type::NoContainment)) {
195 std::copy_if(d->containments.begin(), d->containments.end(), std::back_inserter(conts), [activity](Containment *cont) {
211 std::copy_if(d->containments.begin(), d->containments.end(), std::back_inserter(conts), [screen](Containment *cont) {
241 if (d->immutability == Types::Mutable || args.contains(QVariant::fromValue(QStringLiteral("org.kde.plasma:force-create")))) {
310 action->setIcon(QIcon::fromTheme(unlocked ? QStringLiteral("object-locked") : QStringLiteral("object-unlocked")));
450 // Do not qDeleteAll. The list gets mutated as objects are destroyed because we are connected to the destroyed signal!
458 desktopDefaultsConfig = KConfigGroup(KSharedConfig::openConfig(package.filePath("defaults")), QStringLiteral("Desktop"));
472 auto containmentActions = AppletPrivate::defaultActions(q); // containment has to start with applet stuff
473 ContainmentPrivate::addDefaultActions(containmentActions, nullptr, q); // now it's really containment
536Containment *CoronaPrivate::addContainment(const QString &name, const QVariantList &args, uint id, int lastScreen, bool delayedInit)
592 const auto position = std::lower_bound(containments.begin(), containments.end(), containment, [](Plasma::Containment *c1, Plasma::Containment *c2) {
597 QObject::connect(containment, SIGNAL(destroyed(QObject *)), q, SLOT(containmentDestroyed(QObject *)));
619QList<Plasma::Containment *> CoronaPrivate::importLayout(const KConfigGroup &conf, bool mergeConfig)
661 // qCDebug(LOG_PLASMA) << "got a containment in the config, trying to make a" << containmentConfig.readEntry("plugin", QString()) << "from" << group;
663 // qCDebug(LOG_PLASMA) << "!!{} STARTUP TIME" << QTime().msecsTo(QTime::currentTime()) << "Adding Containment" << containmentConfig.readEntry("plugin",
666 Containment *c = addContainment(containmentConfig.readEntry("plugin", QString()), QVariantList(), cid, -1);
675// qCDebug(LOG_PLASMA) << "!!{} STARTUP TIME" << QTime().msecsTo(QTime::currentTime()) << "Restored Containment" << c->pluginName();
void writeEntry(const char *key, const char *value, WriteConfigFlags pFlags=Normal)
void deleteGroup(const QString &group, WriteConfigFlags flags=Normal)
bool isValid() const
QString readEntry(const char *key, const char *aDefault=nullptr) const
bool sync() override
SimpleConfig
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
KConfigGroup config() const
Returns the KConfigGroup to access the applets configuration.
Definition applet.cpp:189
void configNeedsSaving()
Emitted when an applet has changed values in its configuration and wishes for them to be saved at the...
virtual void init()
This method is called once the applet is loaded and added to a Corona.
Definition applet.cpp:87
void flushPendingConstraintsEvents()
Sends all pending constraints updates to the applet.
Definition applet.cpp:533
The base class for plugins that provide backgrounds and applet grouping containers.
Definition containment.h:47
void save(KConfigGroup &group) const override
Definition containment.cpp:203
void setActivity(const QString &activityId)
Sets the current activity by id.
Definition containment.cpp:637
void uiReadyChanged(bool uiReady)
Emitted when the ui has been fully loaded and is fully working.
@ Custom
A containment that is neither a desktop nor a panel but something application specific.
Definition containment.h:138
void setFormFactor(Plasma::Types::FormFactor formFactor)
Sets the form factor for this Containment.
Definition containment.cpp:306
int screen
The screen number this containment is serving as the desktop for, or -1 if none.
Definition containment.h:87
void screenChanged(int newScreen)
This signal indicates that a containment has been associated (or dissociated) with a physical screen.
void restore(KConfigGroup &group) override
Definition containment.cpp:142
virtual int numScreens() const
Returns the number of screens available to plasma.
Definition corona.cpp:262
QList< Plasma::Containment * > importLayout(const KConfigGroup &config)
Imports an applet layout from a config file.
Definition corona.cpp:152
void kPackageChanged(const KPackage::Package &package)
Emitted when the package for this corona has been changed.
QList< Plasma::Types::Location > freeEdges(int screen) const
This method is useful in order to retrieve the list of available screen edges for panel type containm...
Definition corona.cpp:377
virtual void loadDefaultLayout()
Loads the default (system wide) layout for this user.
Definition corona.cpp:277
Q_INVOKABLE QAction * action(const QString &name) const
Definition corona.cpp:397
void requestConfigSync()
Schedules a flush-to-disk synchronization of the configuration state at the next convenient moment.
Definition corona.cpp:109
void exportLayout(KConfigGroup &config, QList< Containment * > containments)
Exports a set of containments to a config file.
Definition corona.cpp:74
void immutabilityChanged(Plasma::Types::ImmutabilityType immutability)
emitted when immutability changes.
virtual int screenForContainment(const Containment *containment) const
Definition corona.cpp:257
virtual QRect screenGeometry(int id) const =0
Returns the geometry of a given screen.
void setEditMode(bool edit)
Set the Corona globally into "edit mode" Only when the corona is of mutable type can be set of edit m...
Definition corona.cpp:349
void loadLayout(const QString &config=QString())
Load applet layout from a config file.
Definition corona.cpp:132
QList< Containment * > containmentsForScreen(int screen)
Returns all containments which match a particular screen, for any activity.
Definition corona.cpp:203
void setAction(const QString &name, QAction *action)
Defines a new action with the given name in the internal collection.
Definition corona.cpp:402
void setKPackage(const KPackage::Package &package)
Setting the package for the corona.
Definition corona.cpp:55
virtual QRegion availableScreenRegion(int id) const
Returns the available region for a given screen.
Definition corona.cpp:267
void screenOwnerChanged(int isScreen)
This signal indicates that a containment has been newly associated (or dissociated) with a physical s...
Containment * containmentForScreen(int screen, const QString &activity, const QString &defaultPluginIfNonExistent, const QVariantList &defaultArgs=QVariantList())
Returns the Containment for a given physical screen and desktop, creating one if none exists.
Definition corona.cpp:157
void setImmutability(const Types::ImmutabilityType immutable)
Sets the immutability type for this Corona (not immutable, user immutable or system immutable)
Definition corona.cpp:287
KSharedConfig::Ptr config() const
Returns the config file used to store the configuration for this Corona.
Definition corona.cpp:230
void editModeChanged(bool edit)
emitted when the editMode state changes
Containment * createContainment(const QString &name, const QVariantList &args=QVariantList())
Adds a Containment to the Corona.
Definition corona.cpp:239
void requireConfigSync()
Schedules a time sensitive flush-to-disk synchronization of the configuration state.
Definition corona.cpp:127
virtual QRect availableScreenRect(int id) const
Returns the available rect for a given screen.
Definition corona.cpp:272
Containment * createContainmentDelayed(const QString &name, const QVariantList &args=QVariantList())
Loads a containment with delayed initialization, primarily useful for implementations of loadDefaultL...
Definition corona.cpp:248
void removeAction(const QString &name)
Remove the action with the given name, if exists.
Definition corona.cpp:418
QList< Containment * > containmentsForActivity(const QString &activity)
Returns all containments which match a particular activity, for any screen.
Definition corona.cpp:187
void saveLayout(const QString &config=QString()) const
Save applets layout to file.
Definition corona.cpp:61
Applet * loadApplet(const QString &name, uint appletId=0, const QVariantList &args=QVariantList())
Load an Applet plugin.
Definition pluginloader.cpp:41
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
@ UserImmutable
The user has requested a lock down, and can undo the lock down at any time.
Definition plasma.h:101
QString i18n(const char *text, const TYPE &arg...)
QString name(GameStandardAction id)
void setAutoRepeat(bool)
void setEnabled(bool)
void setIcon(const QIcon &icon)
void setShortcut(const QKeySequence &shortcut)
void setShortcutContext(Qt::ShortcutContext context)
void setText(const QString &text)
void triggered(bool checked)
void setVisible(bool)
applicationName
QCoreApplication * instance()
QIcon fromTheme(const QString &name)
CppOwnership
ObjectOwnership objectOwnership(QObject *object)
void append(QList< T > &&value)
iterator begin()
iterator end()
Q_EMITQ_EMIT
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
void destroyed(QObject *obj)
void setObjectName(QAnyStringView name)
void setParent(QObject *parent)
bool contains(const QSet< T > &other) const const
iterator insert(const T &value)
bool isEmpty() const const
QString number(double n, char format, int precision)
ApplicationShortcut
QVariant fromValue(T &&value)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:34:35 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:34:35 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.