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=nullptr, const QString &serviceId=QString(), uint containmentId=0)
 
 Containment (QObject *parent, 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 (QObject *parent=nullptr, const QString &serviceId=QString(), uint appletId=0)
 
 Applet (const KPluginInfo &info, QObject *parent=nullptr, uint appletId=0)
 
 Applet (const KPluginMetaData &metadata, QObject *parent=nullptr, uint appletId=0)
 
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 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
 
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 (QObject *object)
 
qobject_cast (const 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 *receiver, PointerToMemberFunction method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, Functor functor)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type)
 
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, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &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 44 of file containment.h.

Constructor & Destructor Documentation

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

Definition at line 40 of file containment.cpp.

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

Definition at line 50 of file containment.cpp.

Member Function Documentation

QString Plasma::Containment::activity ( ) const
Returns
the current activity id associated with this containment

Definition at line 582 of file containment.cpp.

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

Emitted when the activity id has changed.

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 382 of file containment.cpp.

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

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

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

This signal is emitted when an applet is destroyed.

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

Definition at line 482 of file containment.cpp.

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

Emitted when the user wants to configure/change the containment, or an applet inside it.

QHash< QString, ContainmentActions * > & Plasma::Containment::containmentActions ( )
Returns
All the loaded containment action plugins, indexed by trigger name
Since
5.0

Definition at line 558 of file containment.cpp.

Plasma::Types::ContainmentType Plasma::Containment::containmentType ( ) const

Returns the type of containment.

Definition at line 296 of file containment.cpp.

void Plasma::Containment::containmentTypeChanged ( )
signal

emitted when the containment type changed

Corona * Plasma::Containment::corona ( ) const

Returns the Corona (if any) that this Containment is hosted by.

Definition at line 311 of file containment.cpp.

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 373 of file containment.cpp.

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

Emitted when the formFactor has changed.

Since
5.0
void Plasma::Containment::init ( )
overridevirtual

Reimplemented from Applet.

Reimplemented from Plasma::Applet.

Definition at line 74 of file containment.cpp.

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
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 497 of file containment.cpp.

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

Emitted when the location has changed.

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

Reimplemented from Plasma::Applet.

Definition at line 149 of file containment.cpp.

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 253 of file containment.cpp.

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

Reimplemented from Plasma::Applet.

Definition at line 219 of file containment.cpp.

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 244 of file containment.cpp.

int Plasma::Containment::screen ( ) const
Returns
the screen number this containment is serving as the desktop for or -1 if none

Definition at line 487 of file containment.cpp.

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
void Plasma::Containment::setActivity ( const QString activityId)

Sets the current activity by id.

Parameters
activitythe id of the activity

Definition at line 568 of file containment.cpp.

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 519 of file containment.cpp.

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 343 of file containment.cpp.

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

Sets the type of this containment.

Definition at line 301 of file containment.cpp.

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 326 of file containment.cpp.

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 353 of file containment.cpp.

void Plasma::Containment::setWallpaper ( const QString pluginName)

Sets wallpaper plugin.

Parameters
pluginNamethe name of the wallpaper to attempt to load

Definition at line 502 of file containment.cpp.

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
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
QString Plasma::Containment::wallpaper ( ) const

Return wallpaper plugin.

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-2021 The KDE developers.
Generated on Tue Apr 20 2021 22:41:10 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.