Engauge Digitizer  2
LineStyle.h
1 #ifndef LINE_STYLE_H
2 #define LINE_STYLE_H
3 
4 #include "ColorPalette.h"
5 #include "CurveConnectAs.h"
6 #include <QColor>
7 
8 class QTextStream;
9 class QXmlStreamReader;
10 class QXmlStreamWriter;
11 
13 class LineStyle
14 {
15 public:
17  LineStyle ();
18 
20  LineStyle (unsigned int width,
21  ColorPalette paletteColor,
22  CurveConnectAs curveConnectAs);
23 
25  LineStyle (const LineStyle &other);
26 
28  LineStyle &operator= (const LineStyle &other);
29 
31  CurveConnectAs curveConnectAs () const;
32 
34  static LineStyle defaultAxesCurve ();
35 
37  static LineStyle defaultGraphCurve (int index);
38 
40  void loadXml(QXmlStreamReader &reader);
41 
43  ColorPalette paletteColor() const;
44 
46  void printStream (QString indentation,
47  QTextStream &str) const;
48 
50  void saveXml(QXmlStreamWriter &writer) const;
51 
53  void setCurveConnectAs (CurveConnectAs curveConnectAs);
54 
56  void setPaletteColor (ColorPalette paletteColor);
57 
59  void setWidth (int width);
60 
62  unsigned int width () const;
63 
64 private:
65 
66  unsigned int m_width;
67  ColorPalette m_paletteColor;
68  CurveConnectAs m_curveConnectAs;
69 };
70 
71 #endif // LINE_STYLE_H
void loadXml(QXmlStreamReader &reader)
Load model from serialized xml. Returns the curve name.
Definition: LineStyle.cpp:97
static LineStyle defaultGraphCurve(int index)
Initial default for index'th graph curve.
Definition: LineStyle.cpp:77
unsigned int width() const
Width of line.
Definition: LineStyle.cpp:166
LineStyle & operator=(const LineStyle &other)
Assignment operator.
Definition: LineStyle.cpp:47
static LineStyle defaultAxesCurve()
Initial default for axes curve.
Definition: LineStyle.cpp:61
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:126
Details for a specific Line.
Definition: LineStyle.h:13
ColorPalette paletteColor() const
Line color.
Definition: LineStyle.cpp:121
void setCurveConnectAs(CurveConnectAs curveConnectAs)
Set connect as.
Definition: LineStyle.cpp:151
CurveConnectAs curveConnectAs() const
Get method for connect type.
Definition: LineStyle.cpp:56
void setPaletteColor(ColorPalette paletteColor)
Set method for line color.
Definition: LineStyle.cpp:156
void saveXml(QXmlStreamWriter &writer) const
Serialize to stream.
Definition: LineStyle.cpp:138
void setWidth(int width)
Set width of line.
Definition: LineStyle.cpp:161
LineStyle()
Default constructor only for use when this class is being stored by a container that requires the def...
Definition: LineStyle.cpp:19