]> git.sesse.net Git - kdenlive/blob - src/graphicsscenerectmove.h
Many improvements to title clips (recreate when missing, fix text selection visible...
[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     void clearTextSelection();
20
21 protected:
22     virtual void keyPressEvent(QKeyEvent * keyEvent);
23     virtual void mousePressEvent(QGraphicsSceneMouseEvent*);
24     virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent*);
25     virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent* e);
26     virtual void mouseMoveEvent(QGraphicsSceneMouseEvent*);
27     virtual void wheelEvent(QGraphicsSceneWheelEvent * wheelEvent);
28
29 private:
30     void setCursor(QCursor);
31     double zoom;
32     QGraphicsItem* m_selectedItem;
33     resizeModes resizeMode;
34     QPointF m_sceneClickPoint;
35     TITLETOOL m_tool;
36     QPoint m_clickPoint;
37
38 signals:
39     void itemMoved();
40     void sceneZoom(bool);
41     void newRect(QGraphicsRectItem *);
42     void newText(QGraphicsTextItem *);
43     void actionFinished();
44 };
45
46 #endif