Merge branch 'central-widget'
[krunner.git] / raptorscrollhandler.h
blobae0f69e12bd2be45dc0bf36e58c33fc1f0b57a12
1 //GPL2 siraj@kde.org
4 #ifndef RAPTOR_SCROLL_HANDLER_H
5 #define RAPTOR_SCROLL_HANDLER_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>
17 class RaptorScrollHandler : public QObject,
18 public QGraphicsItem,
19 public QLayoutItem
21 Q_OBJECT
23 public:
24 typedef enum OwnState {REGULAR, Hovered, PRESSED};
25 typedef QHash <OwnState, QString> ElementHash;
26 typedef enum ArrowState {UP=0, DOWN, LEFT, RIGHT};
28 RaptorScrollHandler(QGraphicsItem * parent = 0);
30 virtual ~RaptorScrollHandler();
32 QRectF boundingRect() const;
33 void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
34 QSize sizeHint() const;
35 QSize minimumSize() const {} //TODO Implement me
36 QSize maximumSize() const {} //TODO Implement me
37 void setArrowState(RaptorScrollHandler::ArrowState state);
38 Qt::Orientations expandingDirections() const{} //TODO Implement me
39 void setExpandingDirections(Qt::Orientations ori);
40 void setGeometry(const QRect &geometry);
41 QRect geometry() const;
42 bool isEmpty() const { return false; }
44 public slots:
46 signals:
47 void activated();
48 void deactivated();
50 protected:
51 virtual void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
52 virtual void hoverMoveEvent(QGraphicsSceneHoverEvent *event);
53 virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
54 virtual void mousePressEvent(QGraphicsSceneMouseEvent *event);
56 private:
57 QString getElementNameForState(OwnState state);
58 class Private;
59 Private *d;
62 #endif