Engauge Digitizer  2
LineStyle.h
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 LINE_STYLE_H
8 #define LINE_STYLE_H
9 
10 #include "ColorPalette.h"
11 #include "CurveConnectAs.h"
12 #include <QColor>
13 
14 class QTextStream;
15 class QXmlStreamReader;
16 class QXmlStreamWriter;
17 
19 class LineStyle
20 {
21 public:
23  LineStyle ();
24 
26  LineStyle (unsigned int width,
27  ColorPalette paletteColor,
28  CurveConnectAs curveConnectAs);
29 
31  LineStyle (const LineStyle &other);
32 
34  LineStyle &operator= (const LineStyle &other);
35 
37  CurveConnectAs curveConnectAs () const;
38 
40  static LineStyle defaultAxesCurve ();
41 
43  static LineStyle defaultGraphCurve (int index);
44 
46  void loadXml(QXmlStreamReader &reader);
47 
49  ColorPalette paletteColor() const;
50 
52  void printStream (QString indentation,
53  QTextStream &str) const;
54 
56  void saveXml(QXmlStreamWriter &writer) const;
57 
59  void setCurveConnectAs (CurveConnectAs curveConnectAs);
60 
62  void setPaletteColor (ColorPalette paletteColor);
63 
65  void setWidth (int width);
66 
68  unsigned int width () const;
69 
70 private:
71 
72  unsigned int m_width;
73  ColorPalette m_paletteColor;
74  CurveConnectAs m_curveConnectAs;
75 };
76 
77 #endif // LINE_STYLE_H
CurveConnectAs curveConnectAs() const
Get method for connect type.
Definition: LineStyle.cpp:63
void loadXml(QXmlStreamReader &reader)
Load model from serialized xml. Returns the curve name.
Definition: LineStyle.cpp:104
static LineStyle defaultGraphCurve(int index)
Initial default for index&#39;th graph curve.
Definition: LineStyle.cpp:84
unsigned int width() const
Width of line.
Definition: LineStyle.cpp:173
LineStyle & operator=(const LineStyle &other)
Assignment operator.
Definition: LineStyle.cpp:54
static LineStyle defaultAxesCurve()
Initial default for axes curve.
Definition: LineStyle.cpp:68
void saveXml(QXmlStreamWriter &writer) const
Serialize to stream.
Definition: LineStyle.cpp:145
ColorPalette paletteColor() const
Line color.
Definition: LineStyle.cpp:128
Details for a specific Line.
Definition: LineStyle.h:19
void printStream(QString indentation, QTextStream &str) const
Debugging method that supports print method of this class and printStream method of some other class(...
Definition: LineStyle.cpp:133
void setCurveConnectAs(CurveConnectAs curveConnectAs)
Set connect as.
Definition: LineStyle.cpp:158
void setPaletteColor(ColorPalette paletteColor)
Set method for line color.
Definition: LineStyle.cpp:163
void setWidth(int width)
Set width of line.
Definition: LineStyle.cpp:168
LineStyle()
Default constructor only for use when this class is being stored by a container that requires the def...
Definition: LineStyle.cpp:26