comparison layer/TimeRulerLayer.h @ 997:296ccd36f626 tony-2.0-integration

Merge through to branch for Tony 2.0
author Chris Cannam
date Thu, 20 Aug 2015 14:54:21 +0100
parents e3c7da3d896e
children ab2cafd3a7cb
comparison
equal deleted inserted replaced
943:788b7623bfca 997:296ccd36f626
30 Q_OBJECT 30 Q_OBJECT
31 31
32 public: 32 public:
33 TimeRulerLayer(); 33 TimeRulerLayer();
34 34
35 virtual void paint(View *v, QPainter &paint, QRect rect) const; 35 virtual void paint(LayerGeometryProvider *v, QPainter &paint, QRect rect) const;
36 36
37 void setModel(Model *); 37 void setModel(Model *);
38 virtual const Model *getModel() const { return m_model; } 38 virtual const Model *getModel() const { return m_model; }
39 39
40 enum LabelHeight { LabelTop, LabelMiddle, LabelBottom }; 40 enum LabelHeight { LabelTop, LabelMiddle, LabelBottom };
41 void setLabelHeight(LabelHeight h) { m_labelHeight = h; } 41 void setLabelHeight(LabelHeight h) { m_labelHeight = h; }
42 LabelHeight getLabelHeight() const { return m_labelHeight; } 42 LabelHeight getLabelHeight() const { return m_labelHeight; }
43 43
44 virtual bool snapToFeatureFrame(View *, sv_frame_t &, int &, SnapType) const; 44 virtual bool snapToFeatureFrame(LayerGeometryProvider *, sv_frame_t &, int &, SnapType) const;
45 45
46 virtual ColourSignificance getLayerColourSignificance() const { 46 virtual ColourSignificance getLayerColourSignificance() const {
47 return ColourIrrelevant; 47 return ColourIrrelevant;
48 } 48 }
49 49
51 return false; 51 return false;
52 } 52 }
53 53
54 virtual QString getLayerPresentationName() const; 54 virtual QString getLayerPresentationName() const;
55 55
56 virtual int getVerticalScaleWidth(View *, bool, QPainter &) const { return 0; } 56 virtual int getVerticalScaleWidth(LayerGeometryProvider *, bool, QPainter &) const { return 0; }
57 57
58 virtual void toXml(QTextStream &stream, QString indent = "", 58 virtual void toXml(QTextStream &stream, QString indent = "",
59 QString extraAttributes = "") const; 59 QString extraAttributes = "") const;
60 60
61 void setProperties(const QXmlAttributes &attributes); 61 void setProperties(const QXmlAttributes &attributes);
62
63 virtual bool canExistWithoutModel() const { return true; }
62 64
63 protected: 65 protected:
64 Model *m_model; 66 Model *m_model;
65 LabelHeight m_labelHeight; 67 LabelHeight m_labelHeight;
66 68
67 virtual int getDefaultColourHint(bool dark, bool &impose); 69 virtual int getDefaultColourHint(bool dark, bool &impose);
68 70
69 int getMajorTickSpacing(View *, bool &quarterTicks) const; 71 int getMajorTickSpacing(LayerGeometryProvider *, bool &quarterTicks) const;
70 }; 72 };
71 73
72 #endif 74 #endif