]> git.sesse.net Git - kdenlive/blob - src/graphicsscenerectmove.h
Title widget improvements:
[kdenlive] / src / graphicsscenerectmove.h
1 #ifndef GRAPHICSVIEWRECTMOVE_H
2 #define GRAPHICSVIEWRECTMOVE_H
3
4 #include <QGraphicsScene>
5
6 enum resizeModes {NoResize, TopLeft, BottomLeft, TopRight, BottomRight, Left, Right, Up, Down};
7 enum TITLETOOL { TITLE_SELECT = 0, TITLE_RECTANGLE = 1, TITLE_TEXT = 2, TITLE_IMAGE = 3 };
8
9 class GraphicsSceneRectMove: public QGraphicsScene {
10     Q_OBJECT
11 public:
12     GraphicsSceneRectMove(QObject* parent = 0);
13
14     void setSelectedItem(QGraphicsItem *item);
15     void setScale(double s);
16     void setZoom(double s);
17     void setTool(TITLETOOL tool);
18     TITLETOOL tool();
19
20 protected:
21     virtual void keyPressEvent(QKeyEvent * keyEvent);
22     virtual void mousePressEvent(QGraphicsSceneMouseEvent*);
23     virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent*);
24     virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent* e);
25     virtual void mouseMoveEvent(QGraphicsSceneMouseEvent*);
26     virtual void wheelEvent(QGraphicsSceneWheelEvent * wheelEvent);
27
28 private:
29     void setCursor(QCursor);
30     double zoom;
31     QGraphicsItem* m_selectedItem;
32     resizeModes resizeMode;
33     QPointF m_clickPoint;
34     TITLETOOL m_tool;
35
36 signals:
37     void itemMoved();
38     void sceneZoom(bool);
39     void newRect(QGraphicsRectItem *);
40     void newText(QGraphicsTextItem *);
41     void actionFinished();
42 };
43
44 #endif