mirror of
https://bitbucket.org/smil3y/kde-playground.git
synced 2025-02-24 19:02:51 +00:00
164 lines
7.1 KiB
Text
164 lines
7.1 KiB
Text
// Copyright 2008 Simon Edwards <simon@simonzone.com>
|
|
|
|
// Generated by twine
|
|
|
|
// This program is free software; you can redistribute it and/or modify
|
|
// it under the terms of the GNU Library General Public License as
|
|
// published by the Free Software Foundation; either version 2, or
|
|
// (at your option) any later version.
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
// GNU General Public License for more details
|
|
|
|
// You should have received a copy of the GNU Library General Public
|
|
// License along with this program; if not, write to the
|
|
// Free Software Foundation, Inc.,
|
|
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
|
|
namespace Plasma
|
|
{
|
|
|
|
class Containment : Plasma::Applet
|
|
{
|
|
%TypeHeaderCode
|
|
#include <plasma/containment.h>
|
|
%End
|
|
|
|
|
|
|
|
public:
|
|
class StyleOption : QStyleOptionGraphicsItem
|
|
{
|
|
|
|
public:
|
|
explicit StyleOption ();
|
|
explicit StyleOption (const Plasma::Containment::StyleOption& other);
|
|
explicit StyleOption (const QStyleOptionGraphicsItem& other);
|
|
|
|
enum StyleOptionType
|
|
{
|
|
Type
|
|
};
|
|
|
|
|
|
enum StyleOptionVersion
|
|
{
|
|
Version
|
|
};
|
|
|
|
Plasma::View* view;
|
|
};
|
|
// StyleOption
|
|
|
|
|
|
|
|
enum Type
|
|
{
|
|
NoContainmentType,
|
|
DesktopContainment,
|
|
PanelContainment,
|
|
CustomContainment,
|
|
CustomPanelContainment
|
|
};
|
|
|
|
explicit Containment (QGraphicsItem* parent = 0, const QString& serviceId = QString(), uint containmentId = 0);
|
|
Containment (QObject* parent /TransferThis/, const QVariantList& args);
|
|
void init ();
|
|
Plasma::Containment::Type containmentType () const;
|
|
Plasma::Corona* corona () const;
|
|
static KPluginInfo::List listContainments (const QString& category = QString(), const QString& parentApp = QString());
|
|
static KPluginInfo::List listContainmentsOfType (const QString& type, const QString& category = QString(), const QString& parentApp = QString());
|
|
static QStringList listContainmentTypes ();
|
|
static KPluginInfo::List listContainmentsForMimetype (const QString& mimetype);
|
|
Plasma::Applet* addApplet (const QString& name, const QVariantList& args = QVariantList(), const QRectF& geometry = QRectF(-1,-1,-1,-1));
|
|
void addApplet (Plasma::Applet* applet, const QPointF& pos = QPointF(-1,-1), bool dontInit = 1);
|
|
Plasma::Applet::List applets () const;
|
|
void clearApplets ();
|
|
void setScreen (int screen, int desktop = -1);
|
|
int screen () const;
|
|
int desktop () const;
|
|
void save (KConfigGroup& group) const;
|
|
void restore (KConfigGroup& group);
|
|
void enableAction (const QString& name, bool enable);
|
|
void addToolBoxAction (QAction* action);
|
|
void removeToolBoxAction (QAction* action);
|
|
void setToolBoxOpen (bool open);
|
|
void openToolBox ();
|
|
void closeToolBox ();
|
|
void addAssociatedWidget (QWidget* widget);
|
|
void removeAssociatedWidget (QWidget* widget);
|
|
bool drawWallpaper ();
|
|
void setWallpaper (const QString& pluginName, const QString& mode = QString());
|
|
Plasma::Wallpaper* wallpaper () const;
|
|
void showContextMenu (const QPointF& containmentPos, const QPoint& screenPos);
|
|
virtual void showDropZone (const QPoint pos);
|
|
|
|
signals:
|
|
void appletAdded (Plasma::Applet* applet, const QPointF& pos);
|
|
void appletRemoved (Plasma::Applet* applet);
|
|
void zoomRequested (Plasma::Containment* containment, Plasma::ZoomDirection direction);
|
|
void toolBoxToggled ();
|
|
void toolBoxVisibilityChanged (bool);
|
|
void addSiblingContainment (Plasma::Containment*);
|
|
void showAddWidgetsInterface (const QPointF& pos);
|
|
void screenChanged (int wasScreen, int isScreen, Plasma::Containment* containment);
|
|
void configureRequested (Plasma::Containment* containment);
|
|
|
|
public:
|
|
void setLocation (Plasma::Location location);
|
|
void setFormFactor (Plasma::FormFactor formFactor);
|
|
void addSiblingContainment ();
|
|
void focusNextApplet ();
|
|
void focusPreviousApplet ();
|
|
void destroy ();
|
|
void destroy (bool confirm);
|
|
void showConfigurationInterface ();
|
|
|
|
protected:
|
|
void setContainmentType (Plasma::Containment::Type type);
|
|
void setDrawWallpaper (bool drawWallpaper);
|
|
virtual void saveContents (KConfigGroup& group) const;
|
|
virtual void restoreContents (KConfigGroup& group);
|
|
void mouseMoveEvent (QGraphicsSceneMouseEvent* event);
|
|
void mousePressEvent (QGraphicsSceneMouseEvent* event);
|
|
void mouseReleaseEvent (QGraphicsSceneMouseEvent* event);
|
|
void contextMenuEvent (QGraphicsSceneContextMenuEvent* event);
|
|
void keyPressEvent (QKeyEvent* event);
|
|
void wheelEvent (QGraphicsSceneWheelEvent* event);
|
|
bool sceneEventFilter (QGraphicsItem* watched, QEvent* event);
|
|
void dragEnterEvent (QGraphicsSceneDragDropEvent* event);
|
|
void dragMoveEvent (QGraphicsSceneDragDropEvent* event);
|
|
void dropEvent (QGraphicsSceneDragDropEvent* event);
|
|
void resizeEvent (QGraphicsSceneResizeEvent* event);
|
|
|
|
|
|
public:
|
|
~Containment ();
|
|
protected:
|
|
QVariant itemChange (QGraphicsItem::GraphicsItemChange change, const QVariant& value);
|
|
public:
|
|
void setContainmentActions (const QString& trigger, const QString& pluginName);
|
|
QStringList containmentActionsTriggers ();
|
|
QString containmentActions (const QString& trigger);
|
|
protected:
|
|
void dragLeaveEvent (QGraphicsSceneDragDropEvent* event);
|
|
void setToolBox (Plasma::AbstractToolBox* toolBox);
|
|
Plasma::AbstractToolBox* toolBox () const;
|
|
private:
|
|
Containment (const QString& packagePath, uint appletId, const QVariantList& args);
|
|
public:
|
|
int lastScreen () const;
|
|
int lastDesktop () const;
|
|
bool isToolBoxOpen () const;
|
|
KConfigGroup containmentActionsConfig ();
|
|
void configChanged ();
|
|
};
|
|
// Containment
|
|
|
|
};
|
|
// Plasma
|
|
|
|
|