22 #ifndef PLASMA_CONTAINMENT_H
23 #define PLASMA_CONTAINMENT_H
25 #include <QtGui/QGraphicsItem>
26 #include <QtGui/QWidget>
27 #include <QtGui/QStyleOptionGraphicsItem>
29 #include <kplugininfo.h>
30 #include <ksharedconfig.h>
31 #include <kgenericfactory.h>
40 class AccessAppletJob;
47 class ContainmentActions;
48 class ContainmentPrivate;
49 class AbstractToolBox;
88 Version = QStyleOptionGraphicsItem::Version + 1
100 NoContainmentType = -1,
101 DesktopContainment = 0,
103 CustomContainment = 127,
105 CustomPanelContainment = 128
116 const QString &serviceId = QString(),
117 uint containmentId = 0);
141 Type containmentType()
const;
164 static KPluginInfo::List listContainments(
const QString &category = QString(),
165 const QString &parentApp = QString());
186 static KPluginInfo::List listContainmentsOfType(
const QString &
type,
187 const QString &category = QString(),
188 const QString &parentApp = QString());
193 static QStringList listContainmentTypes();
200 static KPluginInfo::List listContainmentsForMimetype(
const QString &mimetype);
213 Applet *addApplet(
const QString &name,
const QVariantList &args = QVariantList(),
214 const QRectF &geometry = QRectF(-1, -1, -1, -1));
227 void addApplet(
Applet *applet,
const QPointF &pos = QPointF(-1, -1),
bool dontInit =
true);
246 void setScreen(
int screen,
int desktop = -1);
259 int lastScreen()
const;
271 int lastDesktop()
const;
277 void save(KConfigGroup &group)
const;
283 void restore(KConfigGroup &group);
291 void enableAction(
const QString &name,
bool enable);
296 void addToolBoxAction(QAction *action);
301 void removeToolBoxAction(QAction *action);
308 void setToolBoxOpen(
bool open);
314 bool isToolBoxOpen()
const;
330 void addAssociatedWidget(
QWidget *widget);
336 void removeAssociatedWidget(
QWidget *widget);
341 bool drawWallpaper();
351 void setWallpaper(
const QString &pluginName,
const QString &mode = QString());
363 void setActivity(
const QString &activity);
368 QString activity()
const;
380 void showContextMenu(
const QPointF &containmentPos,
const QPoint &screenPos);
390 virtual void showDropZone(
const QPoint pos);
399 void setContainmentActions(
const QString &trigger,
const QString &pluginName);
405 QStringList containmentActionsTriggers();
411 QString containmentActions(
const QString &trigger);
417 KConfigGroup containmentActionsConfig();
439 void toolBoxToggled();
445 void toolBoxVisibilityChanged(
bool);
460 void showAddWidgetsInterface(
const QPointF &pos);
502 void addSiblingContainment();
507 void focusNextApplet();
512 void focusPreviousApplet();
528 void destroy(
bool confirm);
534 void showConfigurationInterface();
541 void configChanged();
553 void setDrawWallpaper(
bool drawWallpaper);
561 virtual void saveContents(KConfigGroup &group)
const;
569 virtual void restoreContents(KConfigGroup &group);
571 void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
572 void mousePressEvent(QGraphicsSceneMouseEvent *event);
573 void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
574 void contextMenuEvent(QGraphicsSceneContextMenuEvent *event);
575 void keyPressEvent(QKeyEvent *event);
576 void wheelEvent(QGraphicsSceneWheelEvent *event);
577 bool sceneEventFilter(QGraphicsItem *watched, QEvent *event);
578 QVariant itemChange(GraphicsItemChange change,
const QVariant &value);
584 void dragEnterEvent(QGraphicsSceneDragDropEvent *event);
590 void dragLeaveEvent(QGraphicsSceneDragDropEvent *event);
596 void dragMoveEvent(QGraphicsSceneDragDropEvent *event);
602 void dropEvent(QGraphicsSceneDragDropEvent *event);
608 void resizeEvent(QGraphicsSceneResizeEvent *event);
613 #ifndef KDE_NO_DEPRECATED
614 KDE_DEPRECATED
const QGraphicsItem *toolBoxItem()
const;
642 Containment(
const QString &packagePath, uint appletId,
const QVariantList &args);
645 Q_PRIVATE_SLOT(d,
void appletAppearAnimationComplete())
646 Q_PRIVATE_SLOT(d,
void triggerShowAddWidgets())
647 Q_PRIVATE_SLOT(d,
void positionToolBox())
648 Q_PRIVATE_SLOT(d,
void requestConfiguration())
649 Q_PRIVATE_SLOT(d,
void updateToolBoxVisibility())
650 Q_PRIVATE_SLOT(d,
void showDropZoneDelayed())
651 Q_PRIVATE_SLOT(d,
void checkStatus(Plasma::
ItemStatus))
653 Q_PRIVATE_SLOT(d,
void onContextChanged(Plasma::
Context *con))
657 Q_PRIVATE_SLOT(d,
void mimeTypeRetrieved(KIO::Job *, const QString &))
658 Q_PRIVATE_SLOT(d,
void dropJobResult(
KJob *))
661 friend class AppletPrivate;
663 friend class CoronaPrivate;
664 friend class ContainmentPrivate;
668 ContainmentPrivate *const d;
673 #endif // multiple inclusion guard
The base ContainmentActions class.
Plasma::View * view
The View, if any, that this containment is currently being rendered into.
ZoomDirection
The direction of a zoom action.
A QGraphicsView for a single Containment.
Location
The Location enumeration describes where on screen an element, such as an Applet or its managing cont...
This class is used for asynchronously accessing an applet published on a remote system.
FormFactor
The FormFactor enumeration describes how a Plasma::Applet should arrange itself.
Provides a restricted interface for scripted applets.
static QScriptValue type(QScriptContext *ctx, QScriptEngine *eng)
The base class for plugins that provide backgrounds and applet grouping containers.
ItemStatus
Status of an applet.
The base Wallpaper class.
A QGraphicsScene for Plasma::Applets.