Plasma
containment.cpp
Go to the documentation of this file.
320 if (containmentType() != PanelContainment && containmentType() != CustomPanelContainment && geo.right() < 0) {
329 d->setScreen(group.readEntry("screen", d->screen), group.readEntry("desktop", d->desktop), false);
461 kDebug() << "!!{} STARTUP TIME" << QTime().msecsTo(QTime::currentTime()) << "Applet" << applet->name();
470 kDebug() << "!!{} STARTUP TIME" << QTime().msecsTo(QTime::currentTime()) << "Containment's applets initialized" << q->name();
497 d->addApplet(plugin, QVariantList(), appletConfig.readEntry("geometry", QRectF()), appId, true);
639 //kDebug() << "showing menu, actions" << desktopMenu.actions().size() << desktopMenu.actions().first()->menu();
704 KMenu *containmentMenu = new KMenu(i18nc("%1 is the name of the containment", "%1 Options", q->name()), &desktopMenu);
907 connect(applet, SIGNAL(appletDestroyed(Plasma::Applet*)), this, SLOT(appletDestroyed(Plasma::Applet*)));
908 connect(applet, SIGNAL(newStatus(Plasma::ItemStatus)), this, SLOT(checkStatus(Plasma::ItemStatus)));
986 if (newDesktop < -1 || (preventInvalidDesktops && newDesktop > KWindowSystem::numberOfDesktops() - 1)) {
990 //kDebug() << activity() << "setting screen to " << newScreen << newDesktop << "and type is" << type;
999 QObject::connect(KWindowSystem::self(), SIGNAL(workAreaChanged()), toolBox.data(), SLOT(reposition()), Qt::UniqueConnection);
1001 QObject::disconnect(KWindowSystem::self(), SIGNAL(workAreaChanged()), toolBox.data(), SLOT(reposition()));
1116 constraint.append(" or (not exist [X-KDE-PluginInfo-Category] or [X-KDE-PluginInfo-Category] == '')");
1129 const KService::List offers = KServiceTypeTrader::self()->query("Plasma/Containment", constraint);
1139 QStringList theseTypes = containmentInfo.service()->property("X-Plasma-ContainmentCategories").toStringList();
1223 } else if ((!d->showDropZoneDelayTimer || !d->showDropZoneDelayTimer->isActive()) && immutability() == Plasma::Mutable) {
1239 void ContainmentPrivate::dropData(QPointF scenePos, QPoint screenPos, QGraphicsSceneDragDropEvent *dropEvent)
1280 const ExtenderItemMimeData *extenderData = qobject_cast<const ExtenderItemMimeData*>(mimeData);
1285 Applet *applet = qobject_cast<ExtenderApplet *>(item->extender() ? item->extender()->applet() : 0);
1493 kDebug() << "No applets found matching the url (" << tjob->url() << ") or the mimetype (" << mimetype << ")";
1957 //but once we get context retrieving the name as soon as the id is set, this issue should go away
2111 const QString title = i18nc("@title:window %1 is the name of the containment", "Remove %1", name());
2127 toolBox = Plasma::AbstractToolBox::load(q->corona()->preferredToolBoxPlugin(type), QVariantList(), q);
2198 if (constraints & Plasma::StartupCompletedConstraint && type < Containment::CustomContainment) {
2232 //kDebug() << applet->name() << "sizehint:" << applet->sizeHint() << "geometry:" << applet->geometry();
2383 kDebug() << "moved to" << QPointF(bottom + q->size().width(), -INTER_CONTAINMENT_MARGIN - q->size().height());
virtual void saveContents(KConfigGroup &group) const
Called when the contents of the containment should be saved.
Definition: containment.cpp:447
virtual void removeAssociatedWidget(QWidget *widget)
un-associate actions from this widget, including ones added after this call.
Definition: applet.cpp:1613
static KPluginInfo::List listContainmentsOfType(const QString &type, const QString &category=QString(), const QString &parentApp=QString())
Returns a list of all known Containments that match the parameters.
Definition: containment.cpp:1089
KConfigGroup config() const
Returns the KConfigGroup to access the applets configuration.
Definition: applet.cpp:450
virtual void save(KConfigGroup &group) const
Saves state information about this applet that will be accessed when next instantiated in the restore...
Definition: applet.cpp:260
static KPluginInfo::List listWallpaperInfoForMimetype(const QString &mimetype, const QString &formFactor=QString())
Returns a list of all known wallpapers that can accept the given mimetype.
Definition: wallpaper.cpp:162
void enableAction(const QString &name, bool enable)
convenience function - enables or disables an action by name
Definition: containment.cpp:1714
virtual void showDropZone(const QPoint pos)
Shows a visual clue for drag and drop The default implementation does nothing, reimplement in contain...
Definition: containment.cpp:602
Containment * containmentForScreen(int screen, int desktop=-1) const
Returns the Containment, if any, for a given physical screen and desktop.
Definition: corona.cpp:296
void contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
Definition: containment.cpp:620
virtual Location location() const
Returns the location of the scene which is displaying applet.
Definition: applet.cpp:1618
Q_INVOKABLE QAction * action(QString name) const
Returns the QAction with the given name from our collection.
Definition: applet.cpp:1390
QVariant itemChange(GraphicsItemChange change, const QVariant &value)
Definition: containment.cpp:1691
This class is used for asynchronously accessing an applet published on a remote system.
Definition: accessappletjob.h:43
void showConfigurationInterface()
Definition: containment.cpp:2058
void setTargetWidget(QGraphicsWidget *widget)
Set the widget on which the animation is to be performed.
Definition: animation.cpp:62
A class that holds a map of triggers to plugin names.
Definition: containmentactionspluginsconfig.h:42
void dragMoveEvent(QGraphicsSceneDragDropEvent *event)
Definition: containment.cpp:1215
Definition: containment.h:78
void setBackgroundHints(const BackgroundHints hints)
Sets the BackgroundHints for this applet.
Definition: applet.cpp:938
void configChanged()
Called when applet configuration values have changed.
Definition: containment.cpp:2063
virtual QRect screenGeometry(int id) const
Returns the geometry of a given screen.
Definition: corona.cpp:445
void setLocation(Plasma::Location location)
Informs the Corona as to what position it is in.
Definition: containment.cpp:800
bool appletConfigLessThan(const KConfigGroup &c1, const KConfigGroup &c2)
Definition: containment.cpp:277
void appletAdded(Plasma::Applet *applet, const QPointF &pos)
This signal is emitted when a new applet is created by the containment.
void resizeEvent(QGraphicsSceneResizeEvent *event)
Reimplemented from QGraphicsItem.
Definition: applet.cpp:1879
void configNeedsSaving()
Emitted when an applet has changed values in its configuration and wishes for them to be saved at the...
Corona * corona() const
Returns the Corona (if any) that this Containment is hosted by.
Definition: containment.cpp:525
void setDrawWallpaper(bool drawWallpaper)
Sets whether wallpaper is painted or not.
Definition: containment.cpp:1796
virtual int numScreens() const
Returns the number of screens available to plasma.
Definition: corona.cpp:440
Definition: abstracttoolbox.h:41
ImmutabilityType
Defines the immutability of items like applets, corona and containments they can be free to modify,...
Definition: plasma.h:197
static KPluginInfo::List listAppletInfoForUrl(const QUrl &url)
Returns a list of all known applets associated with a certain URL.
Definition: applet.cpp:2327
@ Horizontal
The applet is constrained vertically, but can expand horizontally.
Definition: plasma.h:75
QStringList containmentActionsTriggers()
Definition: containment.cpp:1927
virtual void addAssociatedWidget(QWidget *widget)
associate actions with this widget, including ones added after this call.
Definition: applet.cpp:1608
virtual void restoreContents(KConfigGroup &group)
Called when the contents of the containment should be loaded.
Definition: containment.cpp:473
static Wallpaper * load(const QString &name, const QVariantList &args=QVariantList())
Attempts to load a wallpaper.
Definition: wallpaper.cpp:180
void dropEvent(QGraphicsSceneDragDropEvent *event)
Definition: containment.cpp:1228
void setContainmentActions(const QString &trigger, const QString &pluginName)
Sets a containmentactions plugin.
Definition: containment.cpp:1882
QGraphicsView * view() const
Returns the view this widget is visible on, or 0 if none can be found.
Definition: applet.cpp:696
KConfigGroup containmentActionsConfig()
Definition: containment.cpp:2433
void appletRemoved(Plasma::Applet *applet)
This signal is emitted when an applet is destroyed.
AccessAppletJob * accessRemoteApplet(const KUrl &location) const
Access a native plasmoid hosted on another machine.
Definition: accessmanager.cpp:71
Definition: context.h:34
static QStringList supportedProtocols()
Definition: accessmanager.cpp:97
static KPluginInfo::List listContainments(const QString &category=QString(), const QString &parentApp=QString())
Returns a list of all known containments.
Definition: containment.cpp:1082
@ NoConstraint
No constraint; never passed in to Applet::constraintsEvent on its own.
Definition: plasma.h:45
QPoint popupPosition(const QSize &s) const
Reccomended position for a popup window like a menu or a tooltip given its size.
Definition: applet.cpp:737
void configureRequested(Plasma::Containment *containment)
Emitted when the user wants to configure/change containment.
void setToolBoxOpen(bool open)
Sets the open or closed state of the Containment's toolbox.
Definition: containment.cpp:1738
void updateConstraints(Plasma::Constraints constraints=Plasma::AllConstraints)
Called when any of the geometry constraints have been updated.
Definition: applet.cpp:750
virtual void showConfigurationInterface()
Lets the user interact with the plasmoid options.
Definition: applet.cpp:1898
void setToolBox(AbstractToolBox *toolBox)
Sets a custom ToolBox if there was an old one it will be deleted and the new one won't have any actio...
Definition: containment.cpp:1614
void mousePressEvent(QGraphicsSceneMouseEvent *event)
Definition: containment.cpp:546
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
Definition: containment.cpp:578
void addOffscreenWidget(QGraphicsWidget *widget)
Adds a widget in the topleft quadrant in the scene.
Definition: corona.cpp:377
static Applet * load(const QString &name, uint appletId=0, const QVariantList &args=QVariantList())
Attempts to load an applet.
Definition: applet.cpp:2422
void dragLeaveEvent(QGraphicsSceneDragDropEvent *event)
Definition: containment.cpp:1195
virtual void init()
This method is called once the applet is loaded and added to a Corona.
Definition: applet.cpp:243
void setFormFactor(Plasma::FormFactor formFactor)
Sets the form factor for this Containment.
Definition: containment.cpp:776
void mouseMoveEvent(QGraphicsSceneMouseEvent *event)
Definition: containment.cpp:530
void mouseMoveEvent(QGraphicsSceneMouseEvent *event)
Definition: applet.cpp:1862
Location
The Location enumeration describes where on screen an element, such as an Applet or its managing cont...
Definition: plasma.h:108
void releaseVisualFocus()
This signal indicates that an application launch, window creation or window focus event was triggered...
void keyPressEvent(QKeyEvent *event)
Definition: containment.cpp:1644
void addSiblingContainment()
Tells the corona to create a new desktop containment.
Definition: containment.cpp:837
void setContainment(Containment *newContainment)
newContainment the containment the plugin should be associated with.
Definition: containmentactions.cpp:389
void appletDestroyed(Plasma::Applet *applet)
Emitted when the applet is deleted.
void toolBoxVisibilityChanged(bool)
Emitted when the toolbox is hidden or shown.
void setScreen(int screen, int desktop=-1)
Sets the physical screen this Containment is associated with.
Definition: containment.cpp:955
void setActivity(const QString &activity)
Sets the current activity by name.
Definition: containment.cpp:1938
static QStringList listContainmentTypes()
Definition: containment.cpp:1133
@ SystemImmutable
the item is locked down by the system, the user can't unlock it
Definition: plasma.h:201
void wheelEvent(QGraphicsSceneWheelEvent *event)
Definition: containment.cpp:1656
static AbstractToolBox * load(const QString &name, const QVariantList &args=QVariantList(), Plasma::Containment *containment=0)
Create a new AbstractToolBox, loading the proper plugin.
Definition: abstracttoolbox.cpp:59
void activate()
Emitted when activation is requested due to, for example, a global keyboard shortcut.
FormFactor
The FormFactor enumeration describes how a Plasma::Applet should arrange itself.
Definition: plasma.h:64
static Plasma::Animation * create(Animator::Animation type, QObject *parent=0)
Factory to build new animation objects.
Definition: animator.cpp:61
@ NoBackground
Not drawing a background under the applet, the applet has its own implementation.
Definition: applet.h:104
void newStatus(Plasma::ItemStatus status)
Emitted when the applet status changes.
void setCurrentActivity(const QString &name)
Definition: context.cpp:55
void setContainmentType(Containment::Type type)
Sets the type of this containment.
Definition: containment.cpp:506
void geometryChanged()
Emitted whenever the applet makes a geometry change, so that views can coordinate themselves with the...
ContainmentActionsPluginsConfig containmentActionsDefaults(Containment::Type containmentType)
Definition: corona.cpp:781
virtual void destroy()
Destroys the applet; it will be removed nicely and deleted.
Definition: applet.cpp:479
QVariant itemChange(GraphicsItemChange change, const QVariant &value)
Reimplemented from QGraphicsItem.
Definition: applet.cpp:2436
static QScriptValue type(QScriptContext *ctx, QScriptEngine *eng)
Definition: easingcurve.cpp:63
QString containmentActions(const QString &trigger)
Definition: containment.cpp:1932
virtual void restore(KConfigGroup &group)
Restores state information about this applet saved previously in save(KConfigGroup&).
Definition: applet.cpp:310
void flushPendingConstraintsEvents()
Sends all pending contraints updates to the applet.
Definition: applet.cpp:1204
bool isInitialized() const
Definition: containmentactions.cpp:166
void dragEnterEvent(QGraphicsSceneDragDropEvent *event)
Definition: containment.cpp:1148
void destroy()
Destroys this containment and all its applets (after a confirmation dialog); it will be removed nicel...
Definition: containment.cpp:2053
bool sceneEventFilter(QGraphicsItem *watched, QEvent *event)
Definition: containment.cpp:1686
void addAssociatedWidget(QWidget *widget)
associate actions with this widget, including ones added after this call.
Definition: containment.cpp:1768
virtual void configChanged()
Called when applet configuration values have changed.
Definition: applet.cpp:2198
void setWallpaper(const QString &pluginName, const QString &mode=QString())
Sets wallpaper plugin.
Definition: containment.cpp:1815
@ CustomContainment
A containment that is neither a desktop nor a panel but something application specific.
Definition: containment.h:103
static QString eventToString(QEvent *event)
Turns a mouse or wheel event into a string suitable for a ContainmentActions.
Definition: containmentactions.cpp:225
void focusPreviousApplet()
switch keyboard focus to the previous one of our applets
Definition: containment.cpp:2040
QAction * action(QString name) const
Returns the QAction with the given name from our collection.
Definition: corona.cpp:720
void resizeEvent(QGraphicsSceneResizeEvent *event)
Definition: containment.cpp:1627
const QGraphicsItem * toolBoxItem() const
Definition: containment.cpp:1608
The base class for plugins that provide backgrounds and applet grouping containers.
Definition: containment.h:73
static KPluginInfo::List listAppletInfoForMimetype(const QString &mimetype)
Returns a list of all known applets associated with a certain mimetype.
Definition: applet.cpp:2317
void showContextMenu(const QPointF &containmentPos, const QPoint &screenPos)
Shows the context menu for the containment directly, bypassing Applets altogether.
Definition: containment.cpp:608
bool sceneEventFilter(QGraphicsItem *watched, QEvent *event)
Definition: applet.cpp:1779
static ContainmentActions * load(Containment *parent, const QString &name, const QVariantList &args=QVariantList())
Attempts to load a containmentactions.
Definition: containmentactions.cpp:81
void restore(const KConfigGroup &config)
This method should be called once the plugin is loaded or settings are changed.
Definition: containmentactions.cpp:171
Applet * addApplet(const QString &name, const QVariantList &args=QVariantList(), const QRectF &geometry=QRectF(-1, -1, -1, -1))
Adds an applet to this Containment.
Definition: containment.cpp:851
void focusNextApplet()
switch keyboard focus to the next of our applets
Definition: containment.cpp:2027
void removeAssociatedWidget(QWidget *widget)
un-associate actions from this widget, including ones added after this call.
Definition: containment.cpp:1782
void setImmutability(const ImmutabilityType immutable)
Sets the immutability type for this applet (not immutable, user immutable or system immutable)
Definition: applet.cpp:919
QList< QGraphicsWidget * > offscreenWidgets() const
Definition: corona.cpp:426
static KPluginInfo::List listContainmentsForMimetype(const QString &mimetype)
Returns a list of all known applets associated with a certain mimetype.
Definition: containment.cpp:1125
void removeToolBoxAction(QAction *action)
Remove an action from the toolbox.
Definition: containment.cpp:1731
virtual FormFactor formFactor() const
Returns the current form factor the applet is being displayed in.
Definition: applet.cpp:1479
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Thu Aug 27 2020 00:00:00 by doxygen 1.8.20 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Thu Aug 27 2020 00:00:00 by doxygen 1.8.20 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.