Merge branch 'central-widget'
[krunner.git] / raptorclaw.h
blobb7cf72716be02b5d3319180413f67b10b42a1154
1 //GPL2 siraj@kde.org
4 #ifndef RAPTOR_CLAW_H
5 #define RAPTOR_CLAW_H
7 #include <QGraphicsItem>
8 #include <QtCore/QObject>
9 #include <QtGui/QGraphicsTextItem>
10 #include <QtGui/QLayoutItem>
11 //plasma
12 #include <plasma/svg.h>
13 #include <plasma/theme.h>
14 #include <plasma/datacontainer.h>
15 /**
16 * A raptor claw is a item onthe slider view
17 * it has the most basic properties that defines a
18 * slide
19 **/
21 class RaptorClaw : public QObject,
22 public QGraphicsItem,
23 public QLayoutItem
25 Q_OBJECT
27 public:
28 typedef enum {REGULAR, OVER, PRESSED} MouseState;
29 typedef QHash <MouseState, QString> ThemeNames;
31 RaptorClaw(QGraphicsItem *parent = 0);
32 virtual ~RaptorClaw();
33 QRectF boundingRect() const;
34 void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
36 QSize sizeHint() const;
37 QSize minimumSize() const;
38 QSize maximumSize() const ;
39 Qt::Orientations expandingDirections() const { return Qt::Horizontal; }
40 void setGeometry(const QRect&) {}
41 QRect geometry() const;
42 bool isEmpty() const { return false; }
43 QString name();
44 void setOpacity(float op);
45 void setName(const QString& name);
47 void setIcon(QPixmap icon);
49 public slots:
51 protected:
52 virtual void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
53 virtual void hoverMoveEvent(QGraphicsSceneHoverEvent *event);
54 virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
56 private:
57 QString loadSvg(MouseState state);
58 class Private;
59 Private *d;
62 #endif