]> git.sesse.net Git - kdenlive/blobdiff - src/graphicsscenerectmove.h
Many improvements to title clips (recreate when missing, fix text selection visible...
[kdenlive] / src / graphicsscenerectmove.h
index 82560371049c925afd25c9d0eff0027c1812f9f3..45bd5f7dd1d15a8c1d35c6a1f7e89c3369613754 100644 (file)
@@ -3,14 +3,44 @@
 
 #include <QGraphicsScene>
 
+enum resizeModes {NoResize, TopLeft, BottomLeft, TopRight, BottomRight, Left, Right, Up, Down};
+enum TITLETOOL { TITLE_SELECT = 0, TITLE_RECTANGLE = 1, TITLE_TEXT = 2, TITLE_IMAGE = 3 };
+
 class GraphicsSceneRectMove: public QGraphicsScene {
+    Q_OBJECT
 public:
     GraphicsSceneRectMove(QObject* parent = 0);
-    void mouseMoveEvent(QGraphicsSceneMouseEvent*);
-    void wheelEvent(QGraphicsSceneWheelEvent * wheelEvent);
+
+    void setSelectedItem(QGraphicsItem *item);
+    void setScale(double s);
+    void setZoom(double s);
+    void setTool(TITLETOOL tool);
+    TITLETOOL tool();
+    void clearTextSelection();
+
+protected:
+    virtual void keyPressEvent(QKeyEvent * keyEvent);
+    virtual void mousePressEvent(QGraphicsSceneMouseEvent*);
+    virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent*);
+    virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent* e);
+    virtual void mouseMoveEvent(QGraphicsSceneMouseEvent*);
+    virtual void wheelEvent(QGraphicsSceneWheelEvent * wheelEvent);
+
 private:
     void setCursor(QCursor);
     double zoom;
+    QGraphicsItem* m_selectedItem;
+    resizeModes resizeMode;
+    QPointF m_sceneClickPoint;
+    TITLETOOL m_tool;
+    QPoint m_clickPoint;
+
+signals:
+    void itemMoved();
+    void sceneZoom(bool);
+    void newRect(QGraphicsRectItem *);
+    void newText(QGraphicsTextItem *);
+    void actionFinished();
 };
 
 #endif