Plasma::Containment
#include <Plasma/Containment>

Properties | |
bool | isUiReady |
QString | wallpaper |
![]() | |
Plasma::Types::BackgroundHints | backgroundHints |
bool | busy |
Plasma::Types::ContainmentDisplayHints | containmentDisplayHints |
Plasma::Types::BackgroundHints | effectiveBackgroundHints |
Plasma::Types::FormFactor | formFactor |
QString | icon |
Plasma::Types::ImmutabilityType | immutability |
Plasma::Types::Location | location |
Plasma::Types::ItemStatus | status |
QString | title |
Plasma::Types::BackgroundHints | userBackgroundHints |
![]() | |
objectName | |
Public Slots | |
void | reactToScreenChange () |
void | setContainmentDisplayHints (Plasma::Types::ContainmentDisplayHints hints) |
void | setContainmentType (Plasma::Types::ContainmentType type) |
void | setFormFactor (Plasma::Types::FormFactor formFactor) |
void | setLocation (Plasma::Types::Location location) |
![]() | |
virtual void | configChanged () |
void | destroy () |
void | flushPendingConstraintsEvents () |
void | runAssociatedApplication () |
void | setImmutability (const Types::ImmutabilityType immutable) |
void | setLaunchErrorMessage (const QString &reason=QString()) |
void | setStatus (const Types::ItemStatus stat) |
Protected Member Functions | |
virtual void | restoreContents (KConfigGroup &group) |
virtual void | saveContents (KConfigGroup &group) const |
![]() | |
Applet (QObject *parent, const QVariantList &args) | |
virtual void | constraintsEvent (Plasma::Types::Constraints constraints) |
virtual void | saveState (KConfigGroup &config) const |
void | setConfigurationRequired (bool needsConfiguring, const QString &reason=QString()) |
void | setHasConfigurationInterface (bool hasInterface) |
void | timerEvent (QTimerEvent *event) override |
![]() | |
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 |
QObject * | sender () const const |
int | senderSignalIndex () const const |
Additional Inherited Members | |
![]() | |
static Applet * | loadPlasmoid (const QString &path, uint appletId=0) |
![]() | |
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) |
QString | trUtf8 (const char *sourceText, const char *disambiguation, int n) |
![]() | |
typedef | QObjectList |
Detailed Description
The base class for plugins that provide backgrounds and applet grouping containers.
Containment objects provide the means to group applets into functional sets. They also provide the following:
creation of focusing event
- drawing of the background image (which can be interactive)
- form factors (e.g. panel, desktop, full screen, etc)
- applet layout management
Since containment is actually just a Plasma::Applet, all the techniques used for writing the visual presentation of Applets is applicable to Containtments. Containments are differentiated from Applets by being marked with the ServiceType of Plasma/Containment. Plugins registered with both the Applet and the Containment ServiceTypes can be loaded for us in either situation.
See techbase.kde.org for a tutorial on writing Containments using this class.
Definition at line 45 of file containment.h.
Constructor & Destructor Documentation
◆ Containment() [1/3]
|
explicit |
This constructor can be used with the KCoreAddons plugin loading system.
The argument list is expected to have contain the KPackage of the applet, the meta data file path (for compatibility) and an applet ID which must be a base 10 number.
- Parameters
-
parent a QObject parent; you probably want to pass in 0 data,KPluginMetaData used to create this plugin args a list of strings containing the applet id
- Since
- 5.86
Definition at line 40 of file containment.cpp.
◆ Containment() [2/3]
|
explicit |
- Parameters
-
parent the QObject this applet is parented to serviceId the name of the .desktop file containing the information about the widget containmentId a unique id used to differentiate between multiple instances of the same Applet type
- Deprecated:
- Since 5.86, use Containment(QObject *, KPluginMetaData, QVariantList) instead
Definition at line 50 of file containment.cpp.
◆ Containment() [3/3]
Plasma::Containment::Containment | ( | QObject * | parent, |
const QVariantList & | args | ||
) |
This constructor is to be used with the plugin loading systems found in KPluginInfo and KService.
The argument list is expected to have two elements: the KService service ID for the desktop entry and an applet ID which must be a base 10 number.
- Parameters
-
parent a QObject parent; you probably want to pass in 0 args a list of strings containing two entries: the service id and the applet id
- Deprecated:
- Since 5.86, use Containment(QObject *, KPluginMetaData, QVariantList) instead
Definition at line 60 of file containment.cpp.
Member Function Documentation
◆ activity()
QString Plasma::Containment::activity | ( | ) | const |
- Returns
- the current activity id associated with this containment
Definition at line 589 of file containment.cpp.
◆ activityChanged
|
signal |
Emitted when the activity id has changed.
◆ addApplet()
void Plasma::Containment::addApplet | ( | Applet * | applet | ) |
Add an existing applet to this Containment.
- Parameters
-
applet the applet that should be added pos the containment-relative position
Definition at line 389 of file containment.cpp.
◆ appletAdded
|
signal |
This signal is emitted when a new applet is added in the containment It may happen in the following situations:
- The user created the applet
- The applet was moved in from another containment
- The applet got restored at startup
◆ appletAlternativesRequested
|
signal |
Emitted when the user wants to chose an alternative for this applet or containment.
◆ appletCreated
|
signal |
This signal is emitted when a new applet is created by the containment.
Compared to appletAdded, this gets emitted only when the user explicitly creates a new applet, either via the widget explorer or the scripting environment.
- See also
- appletAdded
- Since
- 5.16
◆ appletRemoved
|
signal |
This signal is emitted when an applet is destroyed.
◆ applets()
- Returns
- the applets currently in this Containment
Definition at line 489 of file containment.cpp.
◆ configureRequested
|
signal |
Emitted when the user wants to configure/change the containment, or an applet inside it.
◆ containmentActions()
QHash< QString, ContainmentActions * > & Plasma::Containment::containmentActions | ( | ) |
- Returns
- All the loaded containment action plugins, indexed by trigger name
- Since
- 5.0
Definition at line 565 of file containment.cpp.
◆ containmentType()
Plasma::Types::ContainmentType Plasma::Containment::containmentType | ( | ) | const |
Returns the type of containment.
Definition at line 303 of file containment.cpp.
◆ containmentTypeChanged
|
signal |
emitted when the containment type changed
◆ corona()
Corona * Plasma::Containment::corona | ( | ) | const |
Returns the Corona (if any) that this Containment is hosted by.
Definition at line 318 of file containment.cpp.
◆ createApplet()
Applet * Plasma::Containment::createApplet | ( | const QString & | name, |
const QVariantList & | args = QVariantList() |
||
) |
Adds an applet to this Containment.
- Parameters
-
name the plugin name for the applet, as given by KPluginInfo::pluginName() args argument list to pass to the plasmoid geometry where to place the applet, or to auto-place it if an invalid is provided
- Returns
- a pointer to the applet on success, or 0 on failure
Definition at line 380 of file containment.cpp.
◆ formFactorChanged
|
signal |
Emitted when the formFactor has changed.
- Since
- 5.0
◆ init()
|
overridevirtual |
Reimplemented from Applet.
Reimplemented from Plasma::Applet.
Definition at line 85 of file containment.cpp.
◆ isUiReady()
bool Plasma::Containment::isUiReady | ( | ) | const |
- Returns
- true when the ui of this containment is fully loaded, as well the ui of every applet in it
◆ lastScreen()
int Plasma::Containment::lastScreen | ( | ) | const |
- Returns
- the last screen number this containment had only returns -1 if it's never ever been on a screen
- Since
- 4.5
Definition at line 504 of file containment.cpp.
◆ locationChanged
|
signal |
Emitted when the location has changed.
- Since
- 5.0
◆ restore()
|
overridevirtual |
- Reimplemented from superclass.
- See also
- Applet::restore(KConfigGroup &)
Reimplemented from Plasma::Applet.
Definition at line 160 of file containment.cpp.
◆ restoreContents()
|
protectedvirtual |
Called when the contents of the containment should be loaded.
By default this loads all previously saved Applets
- Parameters
-
group the KConfigGroup to save settings under
Definition at line 256 of file containment.cpp.
◆ save()
|
overridevirtual |
- Reimplemented from superclass.
- See also
- Applet::save(KConfigGroup &)
Reimplemented from Plasma::Applet.
Definition at line 222 of file containment.cpp.
◆ saveContents()
|
protectedvirtual |
Called when the contents of the containment should be saved.
By default this saves all loaded Applets
- Parameters
-
group the KConfigGroup to save settings under
Definition at line 247 of file containment.cpp.
◆ screen()
int Plasma::Containment::screen | ( | ) | const |
- Returns
- the screen number this containment is serving as the desktop for or -1 if none
Definition at line 494 of file containment.cpp.
◆ screenChanged
|
signal |
This signal indicates that a containment has been associated (or dissociated) with a physical screen.
- Parameters
-
newScreen the screen it is now associated with
◆ setActivity()
void Plasma::Containment::setActivity | ( | const QString & | activityId | ) |
Sets the current activity by id.
- Parameters
-
activity the id of the activity
Definition at line 575 of file containment.cpp.
◆ setContainmentActions()
void Plasma::Containment::setContainmentActions | ( | const QString & | trigger, |
const QString & | pluginName | ||
) |
Sets a containmentactions plugin.
- Parameters
-
trigger the mouse button (and optional modifier) to associate the plugin with pluginName the name of the plugin to attempt to load. blank = set no plugin.
- Since
- 4.4
Definition at line 526 of file containment.cpp.
◆ setContainmentDisplayHints
|
slot |
Set Display hints that come from the containment that suggest the applet how to look and behave.
- Parameters
-
hints the new hints, as bitwise OR
- Since
- 5.77
Definition at line 350 of file containment.cpp.
◆ setContainmentType
|
slot |
Sets the type of this containment.
Definition at line 308 of file containment.cpp.
◆ setFormFactor
|
slot |
Sets the form factor for this Containment.
This may cause changes in both the arrangement of Applets as well as the display choices of individual Applets.
Definition at line 333 of file containment.cpp.
◆ setLocation
|
slot |
Informs the Corona as to what position it is in.
This is informational only, as the Corona doesn't change its actual location. This is, however, passed on to Applets that may be managed by this Corona.
- Parameters
-
location the new location of this Corona
Definition at line 360 of file containment.cpp.
◆ setWallpaper()
void Plasma::Containment::setWallpaper | ( | const QString & | pluginName | ) |
Sets wallpaper plugin.
- Parameters
-
pluginName the name of the wallpaper to attempt to load
Definition at line 509 of file containment.cpp.
◆ showAddWidgetsInterface
|
signal |
Emitted when the containment requests an add widgets dialog is shown.
Usually only used for desktop containments.
- Parameters
-
pos where in the containment this request was made from, or an invalid position (QPointF()) is not location specific
◆ uiReadyChanged
|
signal |
Emitted when the ui has been fully loaded and is fully working.
- Parameters
-
uiReady true when the ui of the containment is ready, as well the ui of each applet in it
◆ wallpaper()
QString Plasma::Containment::wallpaper | ( | ) | const |
Return wallpaper plugin.
◆ wallpaperChanged
|
signal |
Emitted when the wallpaper plugin is changed.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Mar 21 2023 04:13:11 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.