comparison layer/FlexiNoteLayer.h @ 650:12d570c27d85 tonioni

split drag delete
author matthiasm
date Sun, 16 Jun 2013 00:16:37 +0100
parents ba76130ed7e5
children
comparison
equal deleted inserted replaced
648:f61a54364d1d 650:12d570c27d85
25 #include <QColor> 25 #include <QColor>
26 26
27 class View; 27 class View;
28 class QPainter; 28 class QPainter;
29 29
30 enum MultiEditMode
31 {
32 MoveLeftBoundary,
33 MoveRightBoundary,
34 Delete,
35 Split
36 };
37
30 class FlexiNoteLayer : public SingleColourLayer 38 class FlexiNoteLayer : public SingleColourLayer
31 { 39 {
32 Q_OBJECT 40 Q_OBJECT
33 41
34 public: 42 public:
52 60
53 virtual void editStart(View *v, QMouseEvent *); 61 virtual void editStart(View *v, QMouseEvent *);
54 virtual void editDrag(View *v, QMouseEvent *); 62 virtual void editDrag(View *v, QMouseEvent *);
55 virtual void editEnd(View *v, QMouseEvent *); 63 virtual void editEnd(View *v, QMouseEvent *);
56 64
57 virtual void splitStart(View *v, QMouseEvent *); 65 virtual void multiStart(View *v, QMouseEvent *);
58 virtual void splitEnd(View *v, QMouseEvent *); 66 virtual void multiDrag(View *v, QMouseEvent *);
67 virtual void multiEnd(View *v, QMouseEvent *);
59 68
60 virtual void mouseMoveEvent(View *v, QMouseEvent *); 69 virtual void mouseMoveEvent(View *v, QMouseEvent *);
61 70
62 virtual bool editOpen(View *v, QMouseEvent *); 71 virtual bool editOpen(View *v, QMouseEvent *);
63 72
144 153
145 FlexiNoteModel::PointList getLocalPoints(View *v, int) const; 154 FlexiNoteModel::PointList getLocalPoints(View *v, int) const;
146 155
147 bool getPointToDrag(View *v, int x, int y, FlexiNoteModel::Point &) const; 156 bool getPointToDrag(View *v, int x, int y, FlexiNoteModel::Point &) const;
148 bool getNoteToEdit(View *v, int x, int y, FlexiNoteModel::Point &) const; 157 bool getNoteToEdit(View *v, int x, int y, FlexiNoteModel::Point &) const;
158 bool getLeftNeighbour(View *v, FlexiNote note, FlexiNote &leftNeighbour) const;
159 bool getRightNeighbour(View *v, FlexiNote note, FlexiNote &rightNeighbour) const;
149 void getRelativeMousePosition(View *v, FlexiNoteModel::Point &note, int x, int y, bool &closeToLeft, bool &closeToRight, bool &closeToTop, bool &closeToBottom) const; 160 void getRelativeMousePosition(View *v, FlexiNoteModel::Point &note, int x, int y, bool &closeToLeft, bool &closeToRight, bool &closeToTop, bool &closeToBottom) const;
150 161
151 FlexiNoteModel *m_model; 162 FlexiNoteModel *m_model;
152 bool m_editing; 163 bool m_editing;
164 MultiEditMode m_multiEditMode;
153 int m_dragPointX; 165 int m_dragPointX;
154 int m_dragPointY; 166 int m_dragPointY;
155 int m_dragStartX; 167 int m_dragStartX;
156 int m_dragStartY; 168 int m_dragStartY;
157 FlexiNoteModel::Point m_originalPoint; 169 FlexiNoteModel::Point m_originalPoint;