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());
2391 bool ContainmentPrivate::prepareContainmentActions(const QString &trigger, const QPoint &screenPos, KMenu *menu)
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
virtual void destroy()
Destroys the applet; it will be removed nicely and deleted.
Definition: applet.cpp:479
void setText(const QString &text)
virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
const QMimeData * mimeData() const
The applet is constrained horizontally, but can expand vertically.
Definition: plasma.h:77
virtual void restoreContents(KConfigGroup &group)
Called when the contents of the containment should be loaded.
Definition: containment.cpp:473
void activate()
Emitted when activation is requested due to, for example, a global keyboard shortcut.
static KPluginInfo::List listContainments(const QString &category=QString(), const QString &parentApp=QString())
Returns a list of all known containments.
Definition: containment.cpp:1082
QString & append(QChar ch)
QSize size() const
iterator insert(const Key &key, const T &value)
QByteArray data(const QString &mimeType) const
virtual void showConfigurationInterface()
Lets the user interact with the plasmoid options.
Definition: applet.cpp:1898
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
Definition: containment.cpp:578
Qt::LayoutDirection layoutDirection()
virtual QRect screenGeometry(int id) const
Returns the geometry of a given screen.
Definition: corona.cpp:441
void flushPendingConstraintsEvents()
Sends all pending contraints updates to the applet.
Definition: applet.cpp:1204
virtual int numScreens() const
Returns the number of screens available to plasma.
Definition: corona.cpp:436
void setCursor(const QCursor &)
ImmutabilityType
Defines the immutability of items like applets, corona and containments they can be free to modify...
Definition: plasma.h:197
QList< QGraphicsWidget * > offscreenWidgets() const
Definition: corona.cpp:422
QGraphicsItem * itemAt(const QPointF &position) const
const QMimeData * mimeData(Mode mode) const
void setMinimumSize(const QSizeF &size)
void destroy()
Destroys this containment and all its applets (after a confirmation dialog); it will be removed nicel...
Definition: containment.cpp:2053
void configureRequested(Plasma::Containment *containment)
Emitted when the user wants to configure/change containment.
const QGraphicsItem * toolBoxItem() const
Definition: containment.cpp:1608
void setFlag(GraphicsItemFlag flag, bool enabled)
void addAction(QAction *action)
void setParentItem(QGraphicsItem *newParent)
QRectF geometry() const
void setDrawWallpaper(bool drawWallpaper)
Sets whether wallpaper is painted or not.
Definition: containment.cpp:1796
virtual bool hasFormat(const QString &mimeType) const
void setFormFactor(Plasma::FormFactor formFactor)
Sets the form factor for this Containment.
Definition: containment.cpp:776
QStringList split(const QString &sep, SplitBehavior behavior, Qt::CaseSensitivity cs) const
virtual void restore(KConfigGroup &group)
Restores state information about this applet saved previously in save(KConfigGroup&).
Definition: applet.cpp:310
the item is locked down by the system, the user can't unlock it
Definition: plasma.h:201
void mousePressEvent(QGraphicsSceneMouseEvent *event)
Definition: containment.cpp:546
virtual Location location() const
Returns the location of the scene which is displaying applet.
Definition: applet.cpp:1618
void newStatus(Plasma::ItemStatus status)
Emitted when the applet status changes.
virtual FormFactor formFactor() const
Returns the current form factor the applet is being displayed in.
Definition: applet.cpp:1479
void enableAction(const QString &name, bool enable)
convenience function - enables or disables an action by name
Definition: containment.cpp:1714
QSizeF size() const
void setVisible(bool)
void dropEvent(QGraphicsSceneDragDropEvent *event)
Definition: containment.cpp:1228
void geometryChanged()
Emitted whenever the applet makes a geometry change, so that views can coordinate themselves with the...
static QStringList listContainmentTypes()
Definition: containment.cpp:1133
ContainmentActionsPluginsConfig containmentActionsDefaults(Containment::Type containmentType)
Definition: corona.cpp:777
QStringList containmentActionsTriggers()
Definition: containment.cpp:1927
QPoint screenPos() const
QSizeF expandedTo(const QSizeF &otherSize) const
int msecsTo(const QTime &t) const
Definition: context.h:33
QPointF scenePos() const
the immutability (locked) nature of the applet changed
Definition: plasma.h:50
const_iterator insert(const T &value)
virtual bool event(QEvent *event)
int count(const Key &key) const
QGraphicsScene * scene() const
void adjustSize()
bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *method)
Not drawing a background under the applet, the applet has its own implementation. ...
Definition: applet.h:104
QVariant itemChange(GraphicsItemChange change, const QVariant &value)
Reimplemented from QGraphicsItem.
Definition: applet.cpp:2436
void setAcceptDrops(bool on)
static ContainmentActions * load(Containment *parent, const QString &name, const QVariantList &args=QVariantList())
Attempts to load a containmentactions.
Definition: containmentactions.cpp:81
void update(const QRectF &rect)
The applet is constrained vertically, but can expand horizontally.
Definition: plasma.h:75
Definition: containment.h:77
int x() const
int y() const
QPoint screenPos() const
Corona * corona() const
Returns the Corona (if any) that this Containment is hosted by.
Definition: containment.cpp:525
A containment that is neither a desktop nor a panel but something application specific.
Definition: containment.h:103
virtual void dropEvent(QGraphicsSceneDragDropEvent *event)
virtual void configChanged()
Called when applet configuration values have changed.
Definition: applet.cpp:2198
ImmutabilityType immutability() const
void resize(const QSizeF &size)
width
void removeToolBoxAction(QAction *action)
Remove an action from the toolbox.
Definition: containment.cpp:1731
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
size
bool appletConfigLessThan(const KConfigGroup &c1, const KConfigGroup &c2)
Definition: containment.cpp:277
QPointF pos() const
QGraphicsItemGroup * group() const
QString number(int n, int base)
qreal x() const
qreal y() const
void dragEnterEvent(QGraphicsSceneDragDropEvent *event)
Definition: containment.cpp:1148
void append(const T &value)
bool sceneEventFilter(QGraphicsItem *watched, QEvent *event)
Definition: applet.cpp:1779
void setScreen(int screen, int desktop=-1)
Sets the physical screen this Containment is associated with.
Definition: containment.cpp:955
bool isAccepted() const
bool isSeparator() const
const_iterator constEnd() const
void appletRemoved(Plasma::Applet *applet)
This signal is emitted when an applet is destroyed.
Location
The Location enumeration describes where on screen an element, such as an Applet or its managing cont...
Definition: plasma.h:108
QClipboard * clipboard()
void keyPressEvent(QKeyEvent *event)
Definition: containment.cpp:1644
void showContextMenu(const QPointF &containmentPos, const QPoint &screenPos)
Shows the context menu for the containment directly, bypassing Applets altogether.
Definition: containment.cpp:608
void setActivity(const QString &activity)
Sets the current activity by name.
Definition: containment.cpp:1938
bool sceneEventFilter(QGraphicsItem *watched, QEvent *event)
Definition: containment.cpp:1686
void addSiblingContainment()
Tells the corona to create a new desktop containment.
Definition: containment.cpp:837
void setPos(const QPointF &pos)
static KPluginInfo::List listAppletInfoForMimetype(const QString &mimetype)
Returns a list of all known applets associated with a certain mimetype.
Definition: applet.cpp:2317
void setCurrentActivity(const QString &name)
Definition: context.cpp:55
bool isEmpty() const
QPointF topLeft() const
bool isEmpty() const
virtual void mousePressEvent(QGraphicsSceneMouseEvent *event)
void dragLeaveEvent(QGraphicsSceneDragDropEvent *event)
Definition: containment.cpp:1195
static QStringList supportedProtocols()
Definition: accessmanager.cpp:97
QAction * action(QString name) const
Returns the QAction with the given name from our collection.
Definition: corona.cpp:716
QPoint screenPos() const
Definition: plasma.h:54
Qt::MouseButton button() const
void setImmutability(const ImmutabilityType immutable)
Sets the immutability type for this applet (not immutable, user immutable or system immutable) ...
Definition: applet.cpp:919
This class is used for asynchronously accessing an applet published on a remote system.
Definition: accessappletjob.h:42
FormFactor
The FormFactor enumeration describes how a Plasma::Applet should arrange itself.
Definition: plasma.h:64
void contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
Definition: containment.cpp:620
T & first()
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
Definition: theme.cpp:68
QSizeF boundedTo(const QSizeF &otherSize) const
QString containmentActions(const QString &trigger)
Definition: containment.cpp:1932
QPointF scenePos() const
void setLocation(Plasma::Location location)
Informs the Corona as to what position it is in.
Definition: containment.cpp:800
QSizeF maximumSize() const
virtual void saveContents(KConfigGroup &group) const
Called when the contents of the containment should be saved.
Definition: containment.cpp:447
bool isInitialized() const
Definition: containmentactions.cpp:166
static QString eventToString(QEvent *event)
Turns a mouse or wheel event into a string suitable for a ContainmentActions.
Definition: containmentactions.cpp:225
QPointF pos() const
void focusPreviousApplet()
switch keyboard focus to the previous one of our applets
Definition: containment.cpp:2040
iterator end()
Definition: abstracttoolbox.h:40
const T value(const Key &key) const
int key() const
AccessAppletJob * accessRemoteApplet(const KUrl &location) const
Access a native plasmoid hosted on another machine.
Definition: accessmanager.cpp:71
qreal right() const
static KPluginInfo::List listAppletInfoForUrl(const QUrl &url)
Returns a list of all known applets associated with a certain URL.
Definition: applet.cpp:2327
void setParent(QObject *parent)
bool contains(const T &value) const
bool invokeMethod(QObject *obj, const char *member, Qt::ConnectionType type, QGenericReturnArgument ret, QGenericArgument val0, QGenericArgument val1, QGenericArgument val2, QGenericArgument val3, QGenericArgument val4, QGenericArgument val5, QGenericArgument val6, QGenericArgument val7, QGenericArgument val8, QGenericArgument val9)
void resizeEvent(QGraphicsSceneResizeEvent *event)
Definition: containment.cpp:1627
Containment(QGraphicsItem *parent=0, const QString &serviceId=QString(), uint containmentId=0)
Definition: containment.cpp:110
QVariant itemChange(GraphicsItemChange change, const QVariant &value)
Reimplemented from QGraphicsItem.
Definition: containment.cpp:1691
QTime currentTime()
void resizeEvent(QGraphicsSceneResizeEvent *event)
Reimplemented from QGraphicsItem.
Definition: applet.cpp:1879
void setMaximumSize(const QSizeF &size)
QSizeF minimumSize() const
static KPluginInfo::List listContainmentsForMimetype(const QString &mimetype)
Returns a list of all known applets associated with a certain mimetype.
Definition: containment.cpp:1125
KConfigGroup config() const
Returns the KConfigGroup to access the applets configuration.
Definition: applet.cpp:450
const_iterator constBegin() const
A customized desktop panel.
Definition: containment.h:105
void configChanged()
Called when applet configuration values have changed.
Definition: containment.cpp:2063
QGraphicsView * view() const
Returns the view this widget is visible on, or 0 if none can be found.
Definition: applet.cpp:696
void appletAdded(Plasma::Applet *applet, const QPointF &pos)
This signal is emitted when a new applet is created by the containment.
void restore(const KConfigGroup &config)
This method should be called once the plugin is loaded or settings are changed.
Definition: containmentactions.cpp:171
QPointF mapToScene(const QPointF &point) const
void setContainmentType(Containment::Type type)
Sets the type of this containment.
Definition: containment.cpp:506
void setAcceptsHoverEvents(bool enabled)
void setCacheMode(CacheMode mode, const QSize &logicalCacheSize)
QPoint toPoint() const
virtual void wheelEvent(QGraphicsSceneWheelEvent *event)
static QScriptValue type(QScriptContext *ctx, QScriptEngine *eng)
Definition: easingcurve.cpp:63
void setFocus(Qt::FocusReason focusReason)
bool isEmpty() const
void setWallpaper(const QString &pluginName, const QString &mode=QString())
Sets wallpaper plugin.
Definition: containment.cpp:1815
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 setBackgroundHints(const BackgroundHints hints)
Sets the BackgroundHints for this applet.
Definition: applet.cpp:938
void setToolBoxOpen(bool open)
Sets the open or closed state of the Containment's toolbox.
Definition: containment.cpp:1738
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 setX(qreal x)
void updateConstraints(Plasma::Constraints constraints=Plasma::AllConstraints)
Called when any of the geometry constraints have been updated.
Definition: applet.cpp:750
QString name() const
Returns the user-visible name for the applet, as specified in the .desktop file.
void removeAction(QAction *action)
static Plasma::Animation * create(Animator::Animation type, QObject *parent=0)
Factory to build new animation objects.
Definition: animator.cpp:61
void toolBoxVisibilityChanged(bool)
Emitted when the toolbox is hidden or shown.
void setContainment(Containment *newContainment)
newContainment the containment the plugin should be associated with.
Definition: containmentactions.cpp:389
bool isWidget() const
void setX(int x)
void setY(int y)
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
void showConfigurationInterface()
Definition: containment.cpp:2058
void setContainmentActions(const QString &trigger, const QString &pluginName)
Sets a containmentactions plugin.
Definition: containment.cpp:1882
QList< T > toList() const
virtual QStringList formats() const
Containment * containmentForScreen(int screen, int desktop=-1) const
Returns the Containment, if any, for a given physical screen and desktop.
Definition: corona.cpp:296
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
virtual void addAssociatedWidget(QWidget *widget)
associate actions with this widget, including ones added after this call.
Definition: applet.cpp:1608
void dragMoveEvent(QGraphicsSceneDragDropEvent *event)
Definition: containment.cpp:1215
void wheelEvent(QGraphicsSceneWheelEvent *event)
Definition: containment.cpp:1656
KConfigGroup containmentActionsConfig()
Definition: containment.cpp:2433
QGraphicsItem * parentItem() const
void acceptProposedAction()
iterator insert(const Key &key, const T &value)
bool contains(const Key &key) const
void addAssociatedWidget(QWidget *widget)
associate actions with this widget, including ones added after this call.
Definition: containment.cpp:1768
void appletDestroyed(Plasma::Applet *applet)
Emitted when the applet is deleted.
The base class for plugins that provide backgrounds and applet grouping containers.
Definition: containment.h:72
void start(QAbstractAnimation::DeletionPolicy policy)
void configNeedsSaving()
Emitted when an applet has changed values in its configuration and wishes for them to be saved at the...
virtual void contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
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
QPointF scenePos() const
qreal height() const
void addOffscreenWidget(QGraphicsWidget *widget)
Adds a widget in the topleft quadrant in the scene.
Definition: corona.cpp:377
int size() const
Definition: animator.h:56
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QList< QAction * > actions() const
Q_INVOKABLE QAction * action(QString name) const
Returns the QAction with the given name from our collection.
Definition: applet.cpp:1390
void focusNextApplet()
switch keyboard focus to the next of our applets
Definition: containment.cpp:2027
QObject * parent() const
virtual void init()
This method is called once the applet is loaded and added to a Corona.
Definition: applet.cpp:243
void removeAssociatedWidget(QWidget *widget)
un-associate actions from this widget, including ones added after this call.
Definition: containment.cpp:1782
void addToolBoxAction(QAction *action)
Add an action to the toolbox.
Definition: containment.cpp:1723
virtual bool contains(const QPointF &point) const
void mouseMoveEvent(QGraphicsSceneMouseEvent *event)
Definition: containment.cpp:530
void setDirection(Direction direction)
QChar * data()
QString arg(qlonglong a, int fieldWidth, int base, const QChar &fillChar) const
A class that holds a map of triggers to plugin names.
Definition: containmentactionspluginsconfig.h:41
void mouseMoveEvent(QGraphicsSceneMouseEvent *event)
Definition: applet.cpp:1862
void releaseVisualFocus()
This signal indicates that an application launch, window creation or window focus event was triggered...
iterator begin()
No constraint; never passed in to Applet::constraintsEvent on its own.
Definition: plasma.h:45
qreal width() const
void setEnabled(bool)
height
static Wallpaper * load(const QString &name, const QVariantList &args=QVariantList())
Attempts to load a wallpaper.
Definition: wallpaper.cpp:180
void setTargetWidget(QGraphicsWidget *widget)
Set the widget on which the animation is to be performed.
Definition: animation.cpp:62
static Applet * load(const QString &name, uint appletId=0, const QVariantList &args=QVariantList())
Attempts to load an applet.
Definition: applet.cpp:2422
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:23:11 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:23:11 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.