comparison layer/FlexiNoteLayer.h @ 646:ba76130ed7e5 tonioni

added context sensitive mouse pointers in note edit tool mode
author gyorgyf
date Sat, 15 Jun 2013 17:04:03 +0100
parents 5c9dcec5f3e9
children 2ad082c5a090 12d570c27d85
comparison
equal deleted inserted replaced
645:c8f45afb83d5 646:ba76130ed7e5
13 COPYING included with this distribution for more information. 13 COPYING included with this distribution for more information.
14 */ 14 */
15 15
16 #ifndef _FLEXINOTE_LAYER_H_ 16 #ifndef _FLEXINOTE_LAYER_H_
17 #define _FLEXINOTE_LAYER_H_ 17 #define _FLEXINOTE_LAYER_H_
18
19 #define NOTE_HEIGHT 8
18 20
19 #include "SingleColourLayer.h" 21 #include "SingleColourLayer.h"
20 #include "data/model/FlexiNoteModel.h" 22 #include "data/model/FlexiNoteModel.h"
21 23
22 #include <QObject> 24 #include <QObject>
35 virtual void paint(View *v, QPainter &paint, QRect rect) const; 37 virtual void paint(View *v, QPainter &paint, QRect rect) const;
36 38
37 virtual QString getFeatureDescription(View *v, QPoint &) const; 39 virtual QString getFeatureDescription(View *v, QPoint &) const;
38 40
39 virtual bool snapToFeatureFrame(View *v, int &frame, 41 virtual bool snapToFeatureFrame(View *v, int &frame,
40 size_t &resolution, 42 size_t &resolution,
41 SnapType snap) const; 43 SnapType snap) const;
42 44
43 virtual void drawStart(View *v, QMouseEvent *); 45 virtual void drawStart(View *v, QMouseEvent *);
44 virtual void drawDrag(View *v, QMouseEvent *); 46 virtual void drawDrag(View *v, QMouseEvent *);
45 virtual void drawEnd(View *v, QMouseEvent *); 47 virtual void drawEnd(View *v, QMouseEvent *);
46 48
52 virtual void editDrag(View *v, QMouseEvent *); 54 virtual void editDrag(View *v, QMouseEvent *);
53 virtual void editEnd(View *v, QMouseEvent *); 55 virtual void editEnd(View *v, QMouseEvent *);
54 56
55 virtual void splitStart(View *v, QMouseEvent *); 57 virtual void splitStart(View *v, QMouseEvent *);
56 virtual void splitEnd(View *v, QMouseEvent *); 58 virtual void splitEnd(View *v, QMouseEvent *);
59
60 virtual void mouseMoveEvent(View *v, QMouseEvent *);
57 61
58 virtual bool editOpen(View *v, QMouseEvent *); 62 virtual bool editOpen(View *v, QMouseEvent *);
59 63
60 virtual void moveSelection(Selection s, size_t newStartFrame); 64 virtual void moveSelection(Selection s, size_t newStartFrame);
61 virtual void resizeSelection(Selection s, Selection newSize); 65 virtual void resizeSelection(Selection s, Selection newSize);
73 virtual PropertyType getPropertyType(const PropertyName &) const; 77 virtual PropertyType getPropertyType(const PropertyName &) const;
74 virtual QString getPropertyGroupName(const PropertyName &) const; 78 virtual QString getPropertyGroupName(const PropertyName &) const;
75 virtual int getPropertyRangeAndValue(const PropertyName &, 79 virtual int getPropertyRangeAndValue(const PropertyName &,
76 int *min, int *max, int *deflt) const; 80 int *min, int *max, int *deflt) const;
77 virtual QString getPropertyValueLabel(const PropertyName &, 81 virtual QString getPropertyValueLabel(const PropertyName &,
78 int value) const; 82 int value) const;
79 virtual void setProperty(const PropertyName &, int value); 83 virtual void setProperty(const PropertyName &, int value);
80 84
81 enum VerticalScale { 85 enum VerticalScale {
82 AutoAlignScale, 86 AutoAlignScale,
83 LinearScale, 87 LinearScale,
139 virtual int getDefaultColourHint(bool dark, bool &impose); 143 virtual int getDefaultColourHint(bool dark, bool &impose);
140 144
141 FlexiNoteModel::PointList getLocalPoints(View *v, int) const; 145 FlexiNoteModel::PointList getLocalPoints(View *v, int) const;
142 146
143 bool getPointToDrag(View *v, int x, int y, FlexiNoteModel::Point &) const; 147 bool getPointToDrag(View *v, int x, int y, FlexiNoteModel::Point &) const;
148 bool getNoteToEdit(View *v, int x, int y, FlexiNoteModel::Point &) const;
149 void getRelativeMousePosition(View *v, FlexiNoteModel::Point &note, int x, int y, bool &closeToLeft, bool &closeToRight, bool &closeToTop, bool &closeToBottom) const;
144 150
145 FlexiNoteModel *m_model; 151 FlexiNoteModel *m_model;
146 bool m_editing; 152 bool m_editing;
147 int m_dragPointX; 153 int m_dragPointX;
148 int m_dragPointY; 154 int m_dragPointY;