canvasgesture_rulermove.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef CANVAS_GESTURE_RULERMOVE_H
00019 #define CANVAS_GESTURE_RULERMOVE_H
00020
00021 #include <QPoint>
00022
00023 #include "scribusapi.h"
00024 #include "canvas.h"
00025 #include "canvasgesture.h"
00026 #include "canvasmode.h"
00027
00028 class QCursor;
00029 class QDragEnterEvent;
00030 class QDragMoveEvent;
00031 class QDragLeaveEvent;
00032 class QDropEvent;
00033 class QEvent;
00034 class QInputMethodEvent;
00035 class QMouseEvent;
00036 class QKeyEvent;
00037 class QPainter;
00038
00042 class SCRIBUS_API RulerGesture : public CanvasGesture
00043 {
00044 public:
00045 enum Mode { HORIZONTAL, VERTICAL, ORIGIN };
00046 RulerGesture (ScribusView* view, Mode mode) :
00047 CanvasGesture(view), m_mode(mode), m_haveGuide(false), m_haveCursor(false), m_xy(0,0) {};
00048
00053 void prepare(Mode mode);
00054 void clear();
00055
00056 virtual void drawControls(QPainter* p);
00057 virtual void activate(bool);
00058 virtual void deactivate(bool);
00059 virtual void mouseReleaseEvent(QMouseEvent *m);
00060 virtual void mouseMoveEvent(QMouseEvent *m);
00065 virtual void mousePressEvent(QMouseEvent *m);
00066
00067 Mode getMode() { return m_mode; }
00072 bool mouseHitsGuide(FPoint mousePointDoc);
00073 private:
00074 Mode m_mode;
00075 bool m_haveGuide;
00076 int m_page;
00077 double m_guide;
00078 bool m_haveCursor;
00079 QCursor m_cursor;
00080 QPoint m_xy;
00081 void movePoint(QMouseEvent *m);
00082 };
00083
00084
00085 #endif