X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fgraphicsscenerectmove.h;h=45bd5f7dd1d15a8c1d35c6a1f7e89c3369613754;hb=c2af27d22047cee1b74816908bbe0e1cfa68e665;hp=82560371049c925afd25c9d0eff0027c1812f9f3;hpb=2a223cff6e45c560c28857b72c0cb7e584f9a4ef;p=kdenlive diff --git a/src/graphicsscenerectmove.h b/src/graphicsscenerectmove.h index 82560371..45bd5f7d 100644 --- a/src/graphicsscenerectmove.h +++ b/src/graphicsscenerectmove.h @@ -3,14 +3,44 @@ #include +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