diff layer/TimeRulerLayer.h @ 287:cd2492c5fe45

* Add SingleColourLayer to manage colours for layers that have a single predominant colour (i.e. most of them).
author Chris Cannam
date Thu, 12 Jul 2007 16:14:59 +0000
parents 1a49bd0d8375
children c0b9eec70639
line wrap: on
line diff
--- a/layer/TimeRulerLayer.h	Wed Jul 11 20:46:37 2007 +0000
+++ b/layer/TimeRulerLayer.h	Thu Jul 12 16:14:59 2007 +0000
@@ -16,7 +16,7 @@
 #ifndef _TIME_RULER_H_
 #define _TIME_RULER_H_
 
-#include "Layer.h"
+#include "SingleColourLayer.h"
 
 #include <QRect>
 #include <QColor>
@@ -25,7 +25,7 @@
 class Model;
 class QPainter;
 
-class TimeRulerLayer : public Layer
+class TimeRulerLayer : public SingleColourLayer
 {
     Q_OBJECT
 
@@ -37,23 +37,15 @@
     void setModel(Model *);
     virtual const Model *getModel() const { return m_model; }
 
-    void setBaseColour(QColor);
-    QColor getBaseColour() const { return m_colour; }
-
     enum LabelHeight { LabelTop, LabelMiddle, LabelBottom };
     void setLabelHeight(LabelHeight h) { m_labelHeight = h; }
     LabelHeight getLabelHeight() const { return m_labelHeight; }
 
     virtual bool snapToFeatureFrame(View *, int &, size_t &, SnapType) const;
 
-    virtual PropertyList getProperties() const;
-    virtual QString getPropertyLabel(const PropertyName &) const;
-    virtual PropertyType getPropertyType(const PropertyName &) const;
-    virtual int getPropertyRangeAndValue(const PropertyName &,
-                                         int *min, int *max, int *deflt) const;
-    virtual QString getPropertyValueLabel(const PropertyName &,
-					  int value) const;
-    virtual void setProperty(const PropertyName &, int value);
+    virtual ColourSignificance getLayerColourSignificance() const {
+        return ColourIrrelevant;
+    }
 
     virtual bool getValueExtents(float &, float &, bool &, QString &) const {
         return false;
@@ -66,9 +58,10 @@
 
 protected:
     Model *m_model;
-    QColor m_colour;
     LabelHeight m_labelHeight;
 
+    virtual int getDefaultColourHint(bool dark, bool &impose);
+
     int getMajorTickSpacing(View *, bool &quarterTicks) const;
 };