Initial commit
[raptor.git] / launcher / raptorclaw.h
blobde5ea0f0a077c3e371a13fed70288f177f9fd6bb
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
26 public:
27 typedef enum { REGULAR,OVER,PRESSED } MouseState;
28 typedef QHash <MouseState,QString> ThemeNames;
29 RaptorClaw(QGraphicsItem * parent = 0);
30 virtual ~RaptorClaw();
31 QRectF boundingRect() const;
32 void paint( QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0);
35 QSize sizeHint() const;
36 QSize minimumSize() const;
37 QSize maximumSize() const ;
38 Qt::Orientations expandingDirections() const{return Qt::Horizontal;}
39 void setGeometry(const QRect&) {}
40 QRect geometry() const;
41 bool isEmpty() const {return false;}
42 QString name();
43 void setOpacity(float op);
44 void setName(const QString& name);
46 void setIcon(QPixmap icon);
48 public slots:
50 protected:
51 virtual void hoverEnterEvent ( QGraphicsSceneHoverEvent * event );
52 virtual void hoverMoveEvent ( QGraphicsSceneHoverEvent * event );
53 virtual void hoverLeaveEvent ( QGraphicsSceneHoverEvent * event );
55 private:
56 QString loadSvg(MouseState state);
57 class Private;
58 Private * const d ;
62 #endif