Plasma::Corona

Search for usage in LXR

Inheritance diagram for Plasma::Corona:

Properties

bool editMode
 
bool isStartupCompleted
 
KPackage::Package kPackage
 
- Properties inherited from QObject
 objectName
 

Signals

void availableScreenRectChanged (int id)
 
void availableScreenRegionChanged (int id)
 
void configSynced ()
 
void containmentAdded (Plasma::Containment *containment)
 
void containmentCreated (Plasma::Containment *containment)
 
void editModeChanged (bool edit)
 
void immutabilityChanged (Plasma::Types::ImmutabilityType immutability)
 
void kPackageChanged (const KPackage::Package &package)
 
void screenAdded (int id)
 
void screenGeometryChanged (int id)
 
void screenOwnerChanged (int isScreen)
 
void screenRemoved (int id)
 
void startupCompleted ()
 

Public Slots

void loadLayout (const QString &config=QString())
 
void requestConfigSync ()
 
void requireConfigSync ()
 
void saveLayout (const QString &config=QString()) const
 
void setImmutability (const Types::ImmutabilityType immutable)
 

Public Member Functions

 Corona (QObject *parent=nullptr)
 
Q_INVOKABLE QActionaction (const QString &name) const
 
QList< QAction * > actions () const
 
virtual QRect availableScreenRect (int id) const
 
virtual QRegion availableScreenRegion (int id) const
 
KSharedConfig::Ptr config () const
 
ContainmentcontainmentForScreen (int screen, const QString &activity, const QString &defaultPluginIfNonExistent, const QVariantList &defaultArgs=QVariantList())
 
QList< Containment * > containments () const
 
QList< Containment * > containmentsForActivity (const QString &activity)
 
QList< Containment * > containmentsForScreen (int screen)
 
ContainmentcreateContainment (const QString &name, const QVariantList &args=QVariantList())
 
void exportLayout (KConfigGroup &config, QList< Containment * > containments)
 
QList< Plasma::Types::LocationfreeEdges (int screen) const
 
Types::ImmutabilityType immutability () const
 
QList< Plasma::Containment * > importLayout (const KConfigGroup &config)
 
bool isEditMode () const
 
bool isStartupCompleted () const
 
KPackage::Package kPackage () const
 
virtual int numScreens () const
 
void removeAction (const QString &name)
 
virtual int screenForContainment (const Containment *containment) const
 
virtual QRect screenGeometry (int id) const =0
 
void setAction (const QString &name, QAction *action)
 
void setEditMode (bool edit)
 
void setKPackage (const KPackage::Package &package)
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
QBindable< QStringbindableObjectName ()
 
bool blockSignals (bool block)
 
const QObjectListchildren () const const
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method) const const
 
bool disconnect (const QObject *receiver, const char *method) const const
 
void dumpObjectInfo () const const
 
void dumpObjectTree () const const
 
QList< QByteArraydynamicPropertyNames () const const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
findChild (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (Qt::FindChildOptions options) const const
 
bool inherits (const char *className) const const
 
void installEventFilter (QObject *filterObj)
 
bool isQuickItemType () const const
 
bool isWidgetType () const const
 
bool isWindowType () const const
 
void killTimer (int id)
 
virtual const QMetaObjectmetaObject () const const
 
void moveToThread (QThread *targetThread)
 
QString objectName () const const
 
void objectNameChanged (const QString &objectName)
 
QObjectparent () const const
 
QVariant property (const char *name) const const
 
 Q_CLASSINFO (Name, Value)
 
 Q_EMIT Q_EMIT
 
 Q_ENUM (...)
 
 Q_ENUM_NS (...)
 
 Q_ENUMS (...)
 
 Q_FLAG (...)
 
 Q_FLAG_NS (...)
 
 Q_FLAGS (...)
 
 Q_GADGET Q_GADGET
 
 Q_GADGET_EXPORT (EXPORT_MACRO)
 
 Q_INTERFACES (...)
 
 Q_INVOKABLE Q_INVOKABLE
 
 Q_MOC_INCLUDE Q_MOC_INCLUDE
 
 Q_NAMESPACE Q_NAMESPACE
 
 Q_NAMESPACE_EXPORT (EXPORT_MACRO)
 
 Q_OBJECT Q_OBJECT
 
 Q_PROPERTY (...)
 
 Q_REVISION Q_REVISION
 
 Q_SET_OBJECT_NAME (Object)
 
 Q_SIGNAL Q_SIGNAL
 
 Q_SIGNALS Q_SIGNALS
 
 Q_SLOT Q_SLOT
 
 Q_SLOTS Q_SLOTS
 
qobject_cast (const QObject *object)
 
qobject_cast (QObject *object)
 
 QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
 
void removeEventFilter (QObject *obj)
 
void setObjectName (const QString &name)
 
void setObjectName (QAnyStringView name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool setProperty (const char *name, QVariant &&value)
 
bool signalsBlocked () const const
 
int startTimer (int interval, Qt::TimerType timerType)
 
int startTimer (std::chrono::milliseconds interval, Qt::TimerType timerType)
 
QThreadthread () const const
 

Protected Member Functions

ContainmentcreateContainmentDelayed (const QString &name, const QVariantList &args=QVariantList())
 
virtual void loadDefaultLayout ()
 
- Protected Member Functions inherited from QObject
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const QMetaMethod &signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const QMetaMethod &signal)
 
bool isSignalConnected (const QMetaMethod &signal) const const
 
int receivers (const char *signal) const const
 
QObjectsender () const const
 
int senderSignalIndex () const const
 
virtual void timerEvent (QTimerEvent *event)
 

Additional Inherited Members

- Public Types inherited from QObject
typedef  QObjectList
 
- Static Public Member Functions inherited from QObject
QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, Functor functor)
 
bool disconnect (const QMetaObject::Connection &connection)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
bool disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 

Detailed Description

A bookkeeping Scene for Plasma::Applets.

Definition at line 27 of file corona.h.

Property Documentation

◆ editMode

bool Plasma::Corona::editMode
readwrite

Definition at line 31 of file corona.h.

◆ isStartupCompleted

bool Plasma::Corona::isStartupCompleted
read

Definition at line 30 of file corona.h.

◆ kPackage

KPackage::Package Plasma::Corona::kPackage
read

Definition at line 32 of file corona.h.

Constructor & Destructor Documentation

◆ Corona()

Plasma::Corona::Corona ( QObject * parent = nullptr)
explicit

Definition at line 35 of file corona.cpp.

◆ ~Corona()

Plasma::Corona::~Corona ( )
override

Definition at line 42 of file corona.cpp.

Member Function Documentation

◆ action()

QAction * Plasma::Corona::action ( const QString & name) const
Returns
The action with the given name, if any

Definition at line 397 of file corona.cpp.

◆ actions()

QList< QAction * > Plasma::Corona::actions ( ) const
Returns
all the actions supported by the corona

Definition at line 427 of file corona.cpp.

◆ availableScreenRect()

QRect Plasma::Corona::availableScreenRect ( int id) const
virtual

Returns the available rect for a given screen.

The difference between this and availableScreenRegion() is that this method returns only a rectangular available space (it doesn't care if your panel is not 100% width). The available rect excludes panels and similar windows. Valid screen ids are 0 to numScreens()-1. By default this method returns a rectangular region equal to screenGeometry(id); subclasses that need another behavior should override this method.

Definition at line 272 of file corona.cpp.

◆ availableScreenRectChanged

void Plasma::Corona::availableScreenRectChanged ( int id)
signal

This signal indicates that a change in available screen geometry occurred.

◆ availableScreenRegion()

QRegion Plasma::Corona::availableScreenRegion ( int id) const
virtual

Returns the available region for a given screen.

The available region excludes panels and similar windows. Valid screen ids are 0 to numScreens()-1. By default this method returns a rectangular region equal to screenGeometry(id); subclasses that need another behavior should override this method.

Definition at line 267 of file corona.cpp.

◆ availableScreenRegionChanged

void Plasma::Corona::availableScreenRegionChanged ( int id)
signal

This signal indicates that a change in available screen geometry occurred.

◆ config()

KSharedConfigPtr Plasma::Corona::config ( ) const

Returns the config file used to store the configuration for this Corona.

Definition at line 230 of file corona.cpp.

◆ configSynced

void Plasma::Corona::configSynced ( )
signal

This signal indicates that the configuration file was flushed to disk.

◆ containmentAdded

void Plasma::Corona::containmentAdded ( Plasma::Containment * containment)
signal

This signal indicates a new containment has been added to the Corona: it may occur after creation or restore from config.

◆ containmentCreated

void Plasma::Corona::containmentCreated ( Plasma::Containment * containment)
signal

This signal indicates a new containment has been created in the Corona.

Compared to containmentAdded it can only happen after the creation of a new containment.

See also
containmentAdded
Since
5.16

◆ containmentForScreen()

Containment * Plasma::Corona::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.

Parameters
screennumber of the physical screen to locate
activitythe activity id of the containment we want, and empty string if the activity is not important
defaultPluginIfNonExistentthe plugin to load by default; "null" won't create it and "default" creates the default plugin
defaultArgsoptional arguments to pass in when creating a Containment if needed
Since
5.45

Definition at line 157 of file corona.cpp.

◆ containments()

QList< Containment * > Plasma::Corona::containments ( ) const
Returns
all containments on this Corona

Definition at line 220 of file corona.cpp.

◆ containmentsForActivity()

QList< Containment * > Plasma::Corona::containmentsForActivity ( const QString & activity)

Returns all containments which match a particular activity, for any screen.

Parameters
activitythe activity id we want
Returns
the list of matching containments if any, empty if activity is an empty string
Since
5.45

Definition at line 187 of file corona.cpp.

◆ containmentsForScreen()

QList< Containment * > Plasma::Corona::containmentsForScreen ( int screen)

Returns all containments which match a particular screen, for any activity.

Parameters
screenthe screen number we want
Returns
the list of matching containments if any, empty if screen is < 0
Since
5.45

Definition at line 203 of file corona.cpp.

◆ createContainment()

Containment * Plasma::Corona::createContainment ( const QString & name,
const QVariantList & args = QVariantList() )

Adds a Containment to the Corona.

Parameters
namethe plugin name for the containment, as given by KPluginInfo::pluginName(). If an empty string is passed in, the default containment plugin will be used (usually DesktopContainment). If the string literal "null" is passed in, then no plugin will be loaded and a simple Containment object will be created instead.
argsargument list to pass to the containment
Returns
a pointer to the containment on success, or 0 on failure. Failure can be caused by too restrictive of an Immutability type, as containments cannot be added when widgets are locked. If the requested containment plugin can not be located or successfully loaded, the Containment will have an invalid pluginInfo().

Definition at line 239 of file corona.cpp.

◆ createContainmentDelayed()

Containment * Plasma::Corona::createContainmentDelayed ( const QString & name,
const QVariantList & args = QVariantList() )
protected

Loads a containment with delayed initialization, primarily useful for implementations of loadDefaultLayout.

The caller is responsible for all initialization, saving and notification of a new containment.

Parameters
namethe plugin name for the containment, as given by KPluginInfo::pluginName(). If an empty string is passed in, the default containment plugin will be used (usually DesktopContainment). If the string literal "null" is passed in, then no plugin will be loaded and a simple Containment object will be created instead.
argsargument list to pass to the containment
Returns
a pointer to the containment on success, or 0 on failure. Failure can be caused by the Immutability type being too restrictive, as containments can't be added when widgets are locked, or if the requested containment plugin can not be located or successfully loaded.
See also
addContainment

Definition at line 248 of file corona.cpp.

◆ editModeChanged

void Plasma::Corona::editModeChanged ( bool edit)
signal

emitted when the editMode state changes

See also
isEditMode()
Since
5.63

◆ exportLayout()

void Plasma::Corona::exportLayout ( KConfigGroup & config,
QList< Containment * > containments )

Exports a set of containments to a config file.

Parameters
configthe config group to save to
containmentsthe list of containments to save
Since
4.6

Definition at line 74 of file corona.cpp.

◆ freeEdges()

QList< Plasma::Types::Location > Plasma::Corona::freeEdges ( int screen) const

This method is useful in order to retrieve the list of available screen edges for panel type containments.

Parameters
screenthe id of the screen to look for free edges.
Returns
a list of free edges not filled with panel type containments.

Definition at line 377 of file corona.cpp.

◆ immutability()

Types::ImmutabilityType Plasma::Corona::immutability ( ) const
Returns
The type of immutability of this Corona

Definition at line 282 of file corona.cpp.

◆ immutabilityChanged

void Plasma::Corona::immutabilityChanged ( Plasma::Types::ImmutabilityType immutability)
signal

emitted when immutability changes.

this is for use by things that don't get constraints events, like plasmaapp. it's NOT for containments or applets or any of the other stuff on the scene. if your code's not in shells/ it probably shouldn't be using it.

◆ importLayout()

QList< Plasma::Containment * > Plasma::Corona::importLayout ( const KConfigGroup & config)

Imports an applet layout from a config file.

The results will be added to the current set of Containments.

Parameters
configthe name of the config file to load from, or the default config file if QString()
Returns
the list of containments that were loaded
Since
4.6

Definition at line 152 of file corona.cpp.

◆ isEditMode()

bool Plasma::Corona::isEditMode ( ) const
Returns
true if the corona is in edit mode
Since
5.63

Definition at line 372 of file corona.cpp.

◆ isStartupCompleted()

bool Plasma::Corona::isStartupCompleted ( ) const
Returns
true when the startup is over, and all the ui graphics has been instantiated

Definition at line 225 of file corona.cpp.

◆ kPackage()

KPackage::Package Plasma::Corona::kPackage ( ) const

Accessor for the associated Package object if any.

A Corona package defines how Containments are laid out in a View, ToolBoxes, default layout, error messages and in general all the furniture specific of a particular device form factor.

Returns
the Package object, or an invalid one if none
Since
5.5

Definition at line 50 of file corona.cpp.

◆ kPackageChanged

void Plasma::Corona::kPackageChanged ( const KPackage::Package & package)
signal

Emitted when the package for this corona has been changed.

Shells must support changing the shell package on the fly (for instance due to device form factor changing)

Parameters
packagethe new package that defines the Corona furniture and behavior

◆ loadDefaultLayout()

void Plasma::Corona::loadDefaultLayout ( )
protectedvirtual

Loads the default (system wide) layout for this user.

Definition at line 277 of file corona.cpp.

◆ loadLayout

void Plasma::Corona::loadLayout ( const QString & config = QString())
slot

Load applet layout from a config file.

The results will be added to the current set of Containments.

Parameters
configthe name of the config file to load from, or the default config file if QString()

Definition at line 132 of file corona.cpp.

◆ numScreens()

int Plasma::Corona::numScreens ( ) const
virtual

Returns the number of screens available to plasma.

Subclasses should override this method as the default implementation returns a meaningless value.

Definition at line 262 of file corona.cpp.

◆ removeAction()

void Plasma::Corona::removeAction ( const QString & name)

Remove the action with the given name, if exists.

Definition at line 418 of file corona.cpp.

◆ requestConfigSync

void Plasma::Corona::requestConfigSync ( )
slot

Schedules a flush-to-disk synchronization of the configuration state at the next convenient moment.

Definition at line 109 of file corona.cpp.

◆ requireConfigSync

void Plasma::Corona::requireConfigSync ( )
slot

Schedules a time sensitive flush-to-disk synchronization of the configuration state.

Since this method does not provide any sort of event compression, it should only be used when an immediate disk sync is absolutely required. Otherwise, use

See also
requestConfigSync() which does do event compression.

Definition at line 127 of file corona.cpp.

◆ saveLayout

void Plasma::Corona::saveLayout ( const QString & config = QString()) const
slot

Save applets layout to file.

Parameters
configthe file to save to, or the default config file if QString()

Definition at line 61 of file corona.cpp.

◆ screenAdded

void Plasma::Corona::screenAdded ( int id)
signal

This signal indicates a new screen with the specified id was added.

Since
5.40

◆ screenForContainment()

int Plasma::Corona::screenForContainment ( const Containment * containment) const
virtual
Returns
the id of the screen which is showing containment -1 is returned if the containment is not associated with a screen.

Definition at line 257 of file corona.cpp.

◆ screenGeometry()

virtual QRect Plasma::Corona::screenGeometry ( int id) const
pure virtual

Returns the geometry of a given screen.

Valid screen ids are 0 to numScreen()-1, or -1 for the full desktop geometry. Subclasses should override this method as the default implementation returns a meaningless value.

◆ screenGeometryChanged

void Plasma::Corona::screenGeometryChanged ( int id)
signal

This signal indicates that a change in geometry for the screen occurred.

◆ screenOwnerChanged

void Plasma::Corona::screenOwnerChanged ( int isScreen)
signal

This signal indicates that a containment has been newly associated (or dissociated) with a physical screen.

Parameters
isScreenthe screen it is now associated with

◆ screenRemoved

void Plasma::Corona::screenRemoved ( int id)
signal

This signal indicates the screen with the specified id was removed.

Since
5.40

◆ setAction()

void Plasma::Corona::setAction ( const QString & name,
QAction * action )

Defines a new action with the given name in the internal collection.

Definition at line 402 of file corona.cpp.

◆ setEditMode()

void Plasma::Corona::setEditMode ( bool edit)

Set the Corona globally into "edit mode" Only when the corona is of mutable type can be set of edit mode.

This indicates the UI to make easy for the user to manipulate applets.

Parameters
edit
Since
5.63

Definition at line 349 of file corona.cpp.

◆ setImmutability

void Plasma::Corona::setImmutability ( const Types::ImmutabilityType immutable)
slot

Sets the immutability type for this Corona (not immutable, user immutable or system immutable)

Parameters
immutablethe new immutability type of this applet

Definition at line 287 of file corona.cpp.

◆ setKPackage()

void Plasma::Corona::setKPackage ( const KPackage::Package & package)

Setting the package for the corona.

Since
5.5

Definition at line 55 of file corona.cpp.

◆ startupCompleted

void Plasma::Corona::startupCompleted ( )
signal

Emitted when the startup phase has been completed.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 13 2024 11:54:24 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.