1 /******************************************************************************************************
2  * (C) 2014 markummitchell@github.com. This file is part of Engauge Digitizer, which is released      *
3  * under GNU General Public License version 2 (GPLv2) or (at your option) any later version. See file *
4  * LICENSE or go to gnu.org/licenses for details. Distribution requires prior written permission.     *
5  ******************************************************************************************************/
6 
7 #ifndef CURVE_STYLE_H
8 #define CURVE_STYLE_H
9 
10 #include "LineStyle.h"
11 #include "PointStyle.h"
12 
13 class QTextStream;
14 class QXmlStreamReader;
15 class QXmlStreamWriter;
16 
17 /// Container for LineStyle and PointStyle for one Curve
18 class CurveStyle
19 {
20 public:
21   /// Default constructor
22   CurveStyle();
23 
24   /// Constructor with styles
25   CurveStyle (const LineStyle &lineStyle,
26               const PointStyle &pointStyle);
27 
28   /// Get method for LineStyle
29   LineStyle lineStyle() const;
30 
31   /// Load from serialized xml. Returns the curve name
32   QString loadXml (QXmlStreamReader &reader);
33 
34   /// Get method for PointStyle
35   PointStyle pointStyle() const;
36 
37   /// Debugging method that supports print method of this class and printStream method of some other class(es)
38   void printStream (QString indentation,
39                     QTextStream &str) const;
40 
41   /// Serialize to xml
42   void saveXml(QXmlStreamWriter &writer,
43                const QString &curveName) const;
44 
45   /// Set method for line color in specified curve.
46   void setLineColor (ColorPalette lineColor);
47 
48   /// Set method for connect as method for lines in specified curve.
49   void setLineConnectAs (CurveConnectAs curveConnectAs);
50 
51   /// Set method for LineStyle
52   void setLineStyle (const LineStyle &lineStyle);
53 
54   /// Set method for line width in specified curve.
55   void setLineWidth (int width);
56 
57   /// Set method curve point color in specified curve.
58   void setPointColor (ColorPalette curveColor);
59 
60   /// Set method for curve point perimeter line width.
61   void setPointLineWidth (int width);
62 
63   /// Set method for curve point radius.
64   void setPointRadius (int radius);
65 
66   /// Set method for curve point shape in specified curve.
67   void setPointShape (PointShape shape);
68 
69   /// Set method for PointStyle
70   void setPointStyle (const PointStyle &pointStyle);
71 
72 private:
73 
74   PointStyle m_pointStyle;
75   LineStyle m_lineStyle;
76 };
77 
78 #endif // CURVE_STYLE_H
79