X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fgraphicsscenerectmove.h;h=091702434c0b52ac97e96a67e90f92c1fa861420;hb=e44ebbaee1314e4088b03169273f66848c7795d7;hp=3f92250ccb227ed781ce0231435a961d276ccccb;hpb=51207926d52e50229027f7d92318b835240e1b2a;p=kdenlive diff --git a/src/graphicsscenerectmove.h b/src/graphicsscenerectmove.h index 3f92250c..09170243 100644 --- a/src/graphicsscenerectmove.h +++ b/src/graphicsscenerectmove.h @@ -3,14 +3,42 @@ #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 ); + GraphicsSceneRectMove(QObject* parent = 0); + + void setSelectedItem(QGraphicsItem *item); + void setScale(double s); + void setZoom(double s); + void setTool(TITLETOOL tool); + TITLETOOL tool(); + +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; + void setCursor(QCursor); + double zoom; + QGraphicsItem* m_selectedItem; + resizeModes resizeMode; + QPointF m_clickPoint; + TITLETOOL m_tool; + +signals: + void itemMoved(); + void sceneZoom(bool); + void newRect(QGraphicsRectItem *); + void newText(QGraphicsTextItem *); + void actionFinished(); }; #endif