Plasma::Containment

Search for usage in LXR

#include <Plasma/Containment>

Inheritance diagram for Plasma::Containment:

Properties

bool isUiReady
 
QString wallpaper
 
- Properties inherited from Plasma::Applet
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
 
- Properties inherited from QObject
 objectName
 

Signals

void activityChanged (const QString &activity)
 
void appletAdded (Plasma::Applet *applet)
 
void appletAlternativesRequested (Plasma::Applet *applet)
 
void appletCreated (Plasma::Applet *applet)
 
void appletRemoved (Plasma::Applet *applet)
 
void configureRequested (Plasma::Applet *applet)
 
void containmentTypeChanged ()
 
void formFactorChanged (Plasma::Types::FormFactor formFactor)
 
void locationChanged (Plasma::Types::Location location)
 
void screenChanged (int newScreen)
 
void showAddWidgetsInterface (const QPointF &pos)
 
void uiReadyChanged (bool uiReady)
 
void wallpaperChanged ()
 
- Signals inherited from Plasma::Applet
void activated ()
 
void appletDeleted (Plasma::Applet *applet)
 
void backgroundHintsChanged ()
 
void busyChanged (bool busy)
 
void configNeedsSaving ()
 
void configurationRequiredChanged (bool needsConfig, const QString &reason)
 
void containmentDisplayHintsChanged (Plasma::Types::ContainmentDisplayHints hints)
 
void contextualActionsAboutToShow ()
 
void destroyedChanged (bool destroyed)
 
void effectiveBackgroundHintsChanged ()
 
void formFactorChanged (Plasma::Types::FormFactor formFactor)
 
void iconChanged (const QString &icon)
 
void immutabilityChanged (Plasma::Types::ImmutabilityType immutable)
 
void locationChanged (Plasma::Types::Location location)
 
void statusChanged (Plasma::Types::ItemStatus status)
 
void titleChanged (const QString &title)
 
void userBackgroundHintsChanged ()
 
void userConfiguringChanged (bool configuring)
 

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)
 
- Public Slots inherited from Plasma::Applet
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)
 

Public Member Functions

 Containment (QObject *parent, const QVariantList &args)
 
 Containment (QObject *parent=nullptr, const QString &serviceId=QString(), uint containmentId=0)
 
 Containment (QObject *parentObject, const KPluginMetaData &data, const QVariantList &args)
 
QString activity () const
 
void addApplet (Applet *applet)
 
QList< Applet * > applets () const
 
QHash< QString, ContainmentActions * > & containmentActions ()
 
Plasma::Types::ContainmentType containmentType () const
 
Coronacorona () const
 
AppletcreateApplet (const QString &name, const QVariantList &args=QVariantList())
 
void init () override
 
bool isUiReady () const
 
int lastScreen () const
 
void restore (KConfigGroup &group) override
 
void save (KConfigGroup &group) const override
 
int screen () const
 
void setActivity (const QString &activityId)
 
void setContainmentActions (const QString &trigger, const QString &pluginName)
 
void setWallpaper (const QString &pluginName)
 
QString wallpaper () const
 
- Public Member Functions inherited from Plasma::Applet
 Applet (const KPluginInfo &info, QObject *parent=nullptr, uint appletId=0)
 
 Applet (const KPluginMetaData &metadata, QObject *parent=nullptr, uint appletId=0)
 
 Applet (QObject *parent=nullptr, const QString &serviceId=QString(), uint appletId=0)
 
 Applet (QObject *parentObject, const KPluginMetaData &data, const QVariantList &args)
 
KActionCollectionactions () const
 
QString associatedApplication () const
 
QList< QUrlassociatedApplicationUrls () const
 
Plasma::Types::BackgroundHints backgroundHints () const
 
KConfigGroup config () const
 
KConfigLoaderconfigScheme () const
 
bool configurationRequired () const
 
QString configurationRequiredReason () const
 
Containmentcontainment () const
 
Types::ContainmentDisplayHints containmentDisplayHints () const
 
virtual QList< QAction * > contextualActions ()
 
bool destroyed () const
 
Plasma::Types::BackgroundHints effectiveBackgroundHints () const
 
bool failedToLaunch () const
 
Types::FormFactor formFactor () const
 
KConfigGroup globalConfig () const
 
QKeySequence globalShortcut () const
 
bool hasConfigurationInterface () const
 
bool hasValidAssociatedApplication () const
 
QString icon () const
 
uint id () const
 
Types::ImmutabilityType immutability () const
 
bool isBusy () const
 
bool isContainment () const
 
bool isUserConfiguring () const
 
KPackage::Package kPackage () const
 
QString launchErrorMessage () const
 
Types::Location location () const
 
Package package () const
 
KPluginInfo pluginInfo () const
 
KPluginMetaData pluginMetaData () const
 
void setAssociatedApplication (const QString &string)
 
void setAssociatedApplicationUrls (const QList< QUrl > &urls)
 
void setBackgroundHints (Plasma::Types::BackgroundHints hint)
 
void setBusy (bool busy)
 
void setGlobalShortcut (const QKeySequence &shortcut)
 
void setIcon (const QString &icon)
 
void setTitle (const QString &title)
 
void setUserBackgroundHints (Plasma::Types::BackgroundHints hint)
 
void setUserConfiguring (bool configuring)
 
Types::ItemStatus status () const
 
QString title () const
 
void updateConstraints (Plasma::Types::Constraints constraints=Plasma::Types::AllConstraints)
 
Plasma::Types::BackgroundHints userBackgroundHints () const
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
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 ()
 
void dumpObjectInfo () const const
 
void dumpObjectTree ()
 
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 QRegExp &regExp, 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
 
bool inherits (const char *className) const const
 
void installEventFilter (QObject *filterObj)
 
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_DISABLE_COPY (Class)
 
 Q_DISABLE_COPY_MOVE (Class)
 
 Q_DISABLE_MOVE (Class)
 
 Q_EMIT Q_EMIT
 
 Q_ENUM (...)
 
 Q_ENUM_NS (...)
 
 Q_ENUMS (...)
 
 Q_FLAG (...)
 
 Q_FLAG_NS (...)
 
 Q_FLAGS (...)
 
 Q_GADGET Q_GADGET
 
 Q_INTERFACES (...)
 
 Q_INVOKABLE Q_INVOKABLE
 
 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
 
qFindChild (const QObject *obj, const QString &name)
 
QList< T > qFindChildren (const QObject *obj, const QRegExp &regExp)
 
QList< T > qFindChildren (const QObject *obj, const QString &name)
 
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 setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool signalsBlocked () const const
 
int startTimer (int interval, Qt::TimerType timerType)
 
int startTimer (std::chrono::milliseconds time, Qt::TimerType timerType)
 
QThreadthread () const const
 

Protected Member Functions

virtual void restoreContents (KConfigGroup &group)
 
virtual void saveContents (KConfigGroup &group) const
 
- Protected Member Functions inherited from Plasma::Applet
 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
 
- 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
 

Additional Inherited Members

- Static Public Member Functions inherited from Plasma::Applet
static AppletloadPlasmoid (const QString &path, uint appletId=0)
 
- 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)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 
- Public Attributes inherited from QObject
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]

Plasma::Containment::Containment ( QObject parentObject,
const KPluginMetaData data,
const QVariantList &  args 
)
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
parenta QObject parent; you probably want to pass in 0
data,KPluginMetaDataused to create this plugin
argsa list of strings containing the applet id
Since
5.86

Definition at line 40 of file containment.cpp.

◆ Containment() [2/3]

Plasma::Containment::Containment ( QObject parent = nullptr,
const QString serviceId = QString(),
uint  containmentId = 0 
)
explicit
Parameters
parentthe QObject this applet is parented to
serviceIdthe name of the .desktop file containing the information about the widget
containmentIda 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
parenta QObject parent; you probably want to pass in 0
argsa 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

void Plasma::Containment::activityChanged ( const QString activity)
signal

Emitted when the activity id has changed.

◆ addApplet()

void Plasma::Containment::addApplet ( Applet applet)

Add an existing applet to this Containment.

Parameters
appletthe applet that should be added
posthe containment-relative position

Definition at line 389 of file containment.cpp.

◆ appletAdded

void Plasma::Containment::appletAdded ( Plasma::Applet applet)
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

void Plasma::Containment::appletAlternativesRequested ( Plasma::Applet applet)
signal

Emitted when the user wants to chose an alternative for this applet or containment.

◆ appletCreated

void Plasma::Containment::appletCreated ( Plasma::Applet applet)
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

void Plasma::Containment::appletRemoved ( Plasma::Applet applet)
signal

This signal is emitted when an applet is destroyed.

◆ applets()

QList< Applet * > Plasma::Containment::applets ( ) const
Returns
the applets currently in this Containment

Definition at line 489 of file containment.cpp.

◆ configureRequested

void Plasma::Containment::configureRequested ( Plasma::Applet applet)
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

void Plasma::Containment::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
namethe plugin name for the applet, as given by KPluginInfo::pluginName()
argsargument list to pass to the plasmoid
geometrywhere 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

void Plasma::Containment::formFactorChanged ( Plasma::Types::FormFactor  formFactor)
signal

Emitted when the formFactor has changed.

Since
5.0

◆ init()

void Plasma::Containment::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

void Plasma::Containment::locationChanged ( Plasma::Types::Location  location)
signal

Emitted when the location has changed.

Since
5.0

◆ restore()

void Plasma::Containment::restore ( KConfigGroup group)
overridevirtual
Reimplemented from superclass.
See also
Applet::restore(KConfigGroup &)

Reimplemented from Plasma::Applet.

Definition at line 160 of file containment.cpp.

◆ restoreContents()

void Plasma::Containment::restoreContents ( KConfigGroup group)
protectedvirtual

Called when the contents of the containment should be loaded.

By default this loads all previously saved Applets

Parameters
groupthe KConfigGroup to save settings under

Definition at line 256 of file containment.cpp.

◆ save()

void Plasma::Containment::save ( KConfigGroup group) const
overridevirtual
Reimplemented from superclass.
See also
Applet::save(KConfigGroup &)

Reimplemented from Plasma::Applet.

Definition at line 222 of file containment.cpp.

◆ saveContents()

void Plasma::Containment::saveContents ( KConfigGroup group) const
protectedvirtual

Called when the contents of the containment should be saved.

By default this saves all loaded Applets

Parameters
groupthe 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

void Plasma::Containment::screenChanged ( int  newScreen)
signal

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

Parameters
newScreenthe screen it is now associated with

◆ setActivity()

void Plasma::Containment::setActivity ( const QString activityId)

Sets the current activity by id.

Parameters
activitythe 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
triggerthe mouse button (and optional modifier) to associate the plugin with
pluginNamethe name of the plugin to attempt to load. blank = set no plugin.
Since
4.4

Definition at line 526 of file containment.cpp.

◆ setContainmentDisplayHints

void Plasma::Containment::setContainmentDisplayHints ( Plasma::Types::ContainmentDisplayHints  hints)
slot

Set Display hints that come from the containment that suggest the applet how to look and behave.

Parameters
hintsthe new hints, as bitwise OR
Since
5.77

Definition at line 350 of file containment.cpp.

◆ setContainmentType

void Plasma::Containment::setContainmentType ( Plasma::Types::ContainmentType  type)
slot

Sets the type of this containment.

Definition at line 308 of file containment.cpp.

◆ setFormFactor

void Plasma::Containment::setFormFactor ( Plasma::Types::FormFactor  formFactor)
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

void Plasma::Containment::setLocation ( Plasma::Types::Location  location)
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
locationthe 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
pluginNamethe name of the wallpaper to attempt to load

Definition at line 509 of file containment.cpp.

◆ showAddWidgetsInterface

void Plasma::Containment::showAddWidgetsInterface ( const QPointF pos)
signal

Emitted when the containment requests an add widgets dialog is shown.

Usually only used for desktop containments.

Parameters
poswhere in the containment this request was made from, or an invalid position (QPointF()) is not location specific

◆ uiReadyChanged

void Plasma::Containment::uiReadyChanged ( bool  uiReady)
signal

Emitted when the ui has been fully loaded and is fully working.

Parameters
uiReadytrue 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

void Plasma::Containment::wallpaperChanged ( )
signal

Emitted when the wallpaper plugin is changed.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
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.