@@ -1,197 +1,197 | |||||
1 | /**************************************************************************** |
|
1 | /**************************************************************************** | |
2 | ** |
|
2 | ** | |
3 | ** Copyright (C) 2012 Digia Plc |
|
3 | ** Copyright (C) 2012 Digia Plc | |
4 | ** All rights reserved. |
|
4 | ** All rights reserved. | |
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com |
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |
6 | ** |
|
6 | ** | |
7 | ** This file is part of the Qt Commercial Charts Add-on. |
|
7 | ** This file is part of the Qt Commercial Charts Add-on. | |
8 | ** |
|
8 | ** | |
9 | ** $QT_BEGIN_LICENSE$ |
|
9 | ** $QT_BEGIN_LICENSE$ | |
10 | ** Licensees holding valid Qt Commercial licenses may use this file in |
|
10 | ** Licensees holding valid Qt Commercial licenses may use this file in | |
11 | ** accordance with the Qt Commercial License Agreement provided with the |
|
11 | ** accordance with the Qt Commercial License Agreement provided with the | |
12 | ** Software or, alternatively, in accordance with the terms contained in |
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |
13 | ** a written agreement between you and Digia. |
|
13 | ** a written agreement between you and Digia. | |
14 | ** |
|
14 | ** | |
15 | ** If you have questions regarding the use of this file, please use |
|
15 | ** If you have questions regarding the use of this file, please use | |
16 | ** contact form at http://qt.digia.com |
|
16 | ** contact form at http://qt.digia.com | |
17 | ** $QT_END_LICENSE$ |
|
17 | ** $QT_END_LICENSE$ | |
18 | ** |
|
18 | ** | |
19 | ****************************************************************************/ |
|
19 | ****************************************************************************/ | |
20 |
|
20 | |||
21 | #ifndef QABSTRACTAXIS_H |
|
21 | #ifndef QABSTRACTAXIS_H | |
22 | #define QABSTRACTAXIS_H |
|
22 | #define QABSTRACTAXIS_H | |
23 |
|
23 | |||
24 | #include <qchartglobal.h> |
|
24 | #include <qchartglobal.h> | |
25 | #include <QPen> |
|
25 | #include <QPen> | |
26 | #include <QFont> |
|
26 | #include <QFont> | |
27 | #include <QVariant> |
|
27 | #include <QVariant> | |
28 |
|
28 | |||
29 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
29 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |
30 |
|
30 | |||
31 | class QAbstractAxisPrivate; |
|
31 | class QAbstractAxisPrivate; | |
32 |
|
32 | |||
33 | class QTCOMMERCIALCHART_EXPORT QAbstractAxis : public QObject |
|
33 | class QTCOMMERCIALCHART_EXPORT QAbstractAxis : public QObject | |
34 | { |
|
34 | { | |
35 | Q_OBJECT |
|
35 | Q_OBJECT | |
36 | //visibility |
|
36 | //visibility | |
37 | Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged) |
|
37 | Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged) | |
38 | //arrow |
|
38 | //arrow | |
39 | Q_PROPERTY(bool lineVisible READ isLineVisible WRITE setLineVisible NOTIFY lineVisibleChanged) |
|
39 | Q_PROPERTY(bool lineVisible READ isLineVisible WRITE setLineVisible NOTIFY lineVisibleChanged) | |
40 | Q_PROPERTY(QPen linePen READ linePen WRITE setLinePen NOTIFY linePenChanged) |
|
40 | Q_PROPERTY(QPen linePen READ linePen WRITE setLinePen NOTIFY linePenChanged) | |
41 | //TODO: make wrapping of color for qml |
|
41 | //TODO: make wrapping of color for qml | |
42 | Q_PROPERTY(QColor color READ linePenColor WRITE setLinePenColor NOTIFY colorChanged) |
|
42 | Q_PROPERTY(QColor color READ linePenColor WRITE setLinePenColor NOTIFY colorChanged) | |
43 | //labels |
|
43 | //labels | |
44 | Q_PROPERTY(bool labelsVisible READ labelsVisible WRITE setLabelsVisible NOTIFY labelsVisibleChanged) |
|
44 | Q_PROPERTY(bool labelsVisible READ labelsVisible WRITE setLabelsVisible NOTIFY labelsVisibleChanged) | |
45 | Q_PROPERTY(QPen lablesPen READ labelsPen WRITE setLabelsPen NOTIFY labelsPenChanged) |
|
45 | Q_PROPERTY(QPen lablesPen READ labelsPen WRITE setLabelsPen NOTIFY labelsPenChanged) | |
46 | Q_PROPERTY(QBrush lablesBrush READ labelsBrush WRITE setLabelsBrush NOTIFY labelsBrushChanged) |
|
46 | Q_PROPERTY(QBrush lablesBrush READ labelsBrush WRITE setLabelsBrush NOTIFY labelsBrushChanged) | |
47 | //TODO: fix labels angles to work with layout |
|
47 | //TODO: fix labels angles to work with layout | |
48 | Q_PROPERTY(int labelsAngle READ labelsAngle WRITE setLabelsAngle NOTIFY labelsAngleChanged) |
|
48 | Q_PROPERTY(int labelsAngle READ labelsAngle WRITE setLabelsAngle NOTIFY labelsAngleChanged) | |
49 | Q_PROPERTY(QFont labelsFont READ labelsFont WRITE setLabelsFont NOTIFY labelsFontChanged) |
|
49 | Q_PROPERTY(QFont labelsFont READ labelsFont WRITE setLabelsFont NOTIFY labelsFontChanged) | |
50 | //TODO: make wrapping of color for qml |
|
50 | //TODO: make wrapping of color for qml | |
51 | Q_PROPERTY(QColor labelsColor READ labelsColor WRITE setLabelsColor NOTIFY labelsColorChanged) |
|
51 | Q_PROPERTY(QColor labelsColor READ labelsColor WRITE setLabelsColor NOTIFY labelsColorChanged) | |
52 | //grid |
|
52 | //grid | |
53 | Q_PROPERTY(bool gridVisible READ isGridLineVisible WRITE setGridLineVisible NOTIFY gridVisibleChanged) |
|
53 | Q_PROPERTY(bool gridVisible READ isGridLineVisible WRITE setGridLineVisible NOTIFY gridVisibleChanged) | |
54 | Q_PROPERTY(QPen girdLinePen READ gridLinePen WRITE setGridLinePen NOTIFY gridLinePenChanged) |
|
54 | Q_PROPERTY(QPen girdLinePen READ gridLinePen WRITE setGridLinePen NOTIFY gridLinePenChanged) | |
55 | //shades |
|
55 | //shades | |
56 | Q_PROPERTY(bool shadesVisible READ shadesVisible WRITE setShadesVisible NOTIFY shadesVisibleChanged) |
|
56 | Q_PROPERTY(bool shadesVisible READ shadesVisible WRITE setShadesVisible NOTIFY shadesVisibleChanged) | |
57 | //TODO: make wrapping of color for qml |
|
57 | //TODO: make wrapping of color for qml | |
58 | Q_PROPERTY(QColor shadesColor READ shadesColor WRITE setShadesColor NOTIFY shadesColorChanged) |
|
58 | Q_PROPERTY(QColor shadesColor READ shadesColor WRITE setShadesColor NOTIFY shadesColorChanged) | |
59 | //TODO: make wrapping of border for qml |
|
59 | //TODO: make wrapping of border for qml | |
60 | Q_PROPERTY(QColor shadesBorderColor READ shadesBorderColor WRITE setShadesBorderColor NOTIFY shadesBorderColorChanged) |
|
60 | Q_PROPERTY(QColor shadesBorderColor READ shadesBorderColor WRITE setShadesBorderColor NOTIFY shadesBorderColorChanged) | |
61 | Q_PROPERTY(QPen shadesPen READ shadesPen WRITE setShadesPen NOTIFY shadesPenChanged) |
|
61 | Q_PROPERTY(QPen shadesPen READ shadesPen WRITE setShadesPen NOTIFY shadesPenChanged) | |
62 | Q_PROPERTY(QBrush shadesBrush READ shadesBrush WRITE setShadesBrush NOTIFY shadesBrushChanged) |
|
62 | Q_PROPERTY(QBrush shadesBrush READ shadesBrush WRITE setShadesBrush NOTIFY shadesBrushChanged) | |
63 | //title |
|
63 | //title | |
64 | Q_PROPERTY(QString titleText READ titleText WRITE setTitleText NOTIFY titleTextChanged) |
|
64 | Q_PROPERTY(QString titleText READ titleText WRITE setTitleText NOTIFY titleTextChanged) | |
65 | Q_PROPERTY(QPen titlePen READ titlePen WRITE setTitlePen NOTIFY titlePenChanged) |
|
65 | Q_PROPERTY(QPen titlePen READ titlePen WRITE setTitlePen NOTIFY titlePenChanged) | |
66 | Q_PROPERTY(QBrush titleBrush READ titleBrush WRITE setTitleBrush NOTIFY titleBrushChanged) |
|
66 | Q_PROPERTY(QBrush titleBrush READ titleBrush WRITE setTitleBrush NOTIFY titleBrushChanged) | |
67 | Q_PROPERTY(bool titleVisible READ isTitleVisible WRITE setTitleVisible NOTIFY titleVisibleChanged) |
|
67 | Q_PROPERTY(bool titleVisible READ isTitleVisible WRITE setTitleVisible NOTIFY titleVisibleChanged) | |
68 | Q_PROPERTY(QFont titleFont READ titleFont WRITE setTitleFont NOTIFY titleFontChanged) |
|
68 | Q_PROPERTY(QFont titleFont READ titleFont WRITE setTitleFont NOTIFY titleFontChanged) | |
69 | //orientation |
|
69 | //orientation | |
70 |
Q_PROPERTY(Qt::Orientation ori |
|
70 | Q_PROPERTY(Qt::Orientation orientation READ orientation) | |
71 | //aligment |
|
71 | //aligment | |
72 | Q_PROPERTY(Qt::Alignment alignment READ alignment) |
|
72 | Q_PROPERTY(Qt::Alignment alignment READ alignment) | |
73 |
|
73 | |||
74 | public: |
|
74 | public: | |
75 |
|
75 | |||
76 | enum AxisType { |
|
76 | enum AxisType { | |
77 | AxisTypeNoAxis = 0x0, |
|
77 | AxisTypeNoAxis = 0x0, | |
78 | AxisTypeValue = 0x1, |
|
78 | AxisTypeValue = 0x1, | |
79 | AxisTypeBarCategory = 0x2, |
|
79 | AxisTypeBarCategory = 0x2, | |
80 | AxisTypeCategory = 0x3, |
|
80 | AxisTypeCategory = 0x3, | |
81 | AxisTypeDateTime = 0x4, |
|
81 | AxisTypeDateTime = 0x4, | |
82 | AxisTypeLogValue = 0x5 |
|
82 | AxisTypeLogValue = 0x5 | |
83 | }; |
|
83 | }; | |
84 |
|
84 | |||
85 | Q_DECLARE_FLAGS(AxisTypes, AxisType) |
|
85 | Q_DECLARE_FLAGS(AxisTypes, AxisType) | |
86 |
|
86 | |||
87 | protected: |
|
87 | protected: | |
88 | explicit QAbstractAxis(QAbstractAxisPrivate &d, QObject *parent = 0); |
|
88 | explicit QAbstractAxis(QAbstractAxisPrivate &d, QObject *parent = 0); | |
89 |
|
89 | |||
90 | public: |
|
90 | public: | |
91 | ~QAbstractAxis(); |
|
91 | ~QAbstractAxis(); | |
92 |
|
92 | |||
93 | virtual AxisType type() const = 0; |
|
93 | virtual AxisType type() const = 0; | |
94 |
|
94 | |||
95 | //visibility handling |
|
95 | //visibility handling | |
96 | bool isVisible() const; |
|
96 | bool isVisible() const; | |
97 | void setVisible(bool visible = true); |
|
97 | void setVisible(bool visible = true); | |
98 | void show(); |
|
98 | void show(); | |
99 | void hide(); |
|
99 | void hide(); | |
100 |
|
100 | |||
101 | //arrow handling |
|
101 | //arrow handling | |
102 | bool isLineVisible() const; |
|
102 | bool isLineVisible() const; | |
103 | void setLineVisible(bool visible = true); |
|
103 | void setLineVisible(bool visible = true); | |
104 | void setLinePen(const QPen &pen); |
|
104 | void setLinePen(const QPen &pen); | |
105 | QPen linePen() const; |
|
105 | QPen linePen() const; | |
106 | void setLinePenColor(QColor color); |
|
106 | void setLinePenColor(QColor color); | |
107 | QColor linePenColor() const; |
|
107 | QColor linePenColor() const; | |
108 |
|
108 | |||
109 | //grid handling |
|
109 | //grid handling | |
110 | bool isGridLineVisible() const; |
|
110 | bool isGridLineVisible() const; | |
111 | void setGridLineVisible(bool visible = true); |
|
111 | void setGridLineVisible(bool visible = true); | |
112 | void setGridLinePen(const QPen &pen); |
|
112 | void setGridLinePen(const QPen &pen); | |
113 | QPen gridLinePen() const; |
|
113 | QPen gridLinePen() const; | |
114 |
|
114 | |||
115 | //labels handling |
|
115 | //labels handling | |
116 | bool labelsVisible() const; |
|
116 | bool labelsVisible() const; | |
117 | void setLabelsVisible(bool visible = true); |
|
117 | void setLabelsVisible(bool visible = true); | |
118 | void setLabelsPen(const QPen &pen); |
|
118 | void setLabelsPen(const QPen &pen); | |
119 | QPen labelsPen() const; |
|
119 | QPen labelsPen() const; | |
120 | void setLabelsBrush(const QBrush &brush); |
|
120 | void setLabelsBrush(const QBrush &brush); | |
121 | QBrush labelsBrush() const; |
|
121 | QBrush labelsBrush() const; | |
122 | void setLabelsFont(const QFont &font); |
|
122 | void setLabelsFont(const QFont &font); | |
123 | QFont labelsFont() const; |
|
123 | QFont labelsFont() const; | |
124 | void setLabelsAngle(int angle); |
|
124 | void setLabelsAngle(int angle); | |
125 | int labelsAngle() const; |
|
125 | int labelsAngle() const; | |
126 | void setLabelsColor(QColor color); |
|
126 | void setLabelsColor(QColor color); | |
127 | QColor labelsColor() const; |
|
127 | QColor labelsColor() const; | |
128 |
|
128 | |||
129 | //title handling |
|
129 | //title handling | |
130 | bool isTitleVisible() const; |
|
130 | bool isTitleVisible() const; | |
131 | void setTitleVisible(bool visible = true); |
|
131 | void setTitleVisible(bool visible = true); | |
132 | void setTitlePen(const QPen &pen); |
|
132 | void setTitlePen(const QPen &pen); | |
133 | QPen titlePen() const; |
|
133 | QPen titlePen() const; | |
134 | void setTitleBrush(const QBrush &brush); |
|
134 | void setTitleBrush(const QBrush &brush); | |
135 | QBrush titleBrush() const; |
|
135 | QBrush titleBrush() const; | |
136 | void setTitleFont(const QFont &font); |
|
136 | void setTitleFont(const QFont &font); | |
137 | QFont titleFont() const; |
|
137 | QFont titleFont() const; | |
138 | void setTitleText(const QString &title); |
|
138 | void setTitleText(const QString &title); | |
139 | QString titleText() const; |
|
139 | QString titleText() const; | |
140 |
|
140 | |||
141 | //shades handling |
|
141 | //shades handling | |
142 | bool shadesVisible() const; |
|
142 | bool shadesVisible() const; | |
143 | void setShadesVisible(bool visible = true); |
|
143 | void setShadesVisible(bool visible = true); | |
144 | void setShadesPen(const QPen &pen); |
|
144 | void setShadesPen(const QPen &pen); | |
145 | QPen shadesPen() const; |
|
145 | QPen shadesPen() const; | |
146 | void setShadesBrush(const QBrush &brush); |
|
146 | void setShadesBrush(const QBrush &brush); | |
147 | QBrush shadesBrush() const; |
|
147 | QBrush shadesBrush() const; | |
148 | void setShadesColor(QColor color); |
|
148 | void setShadesColor(QColor color); | |
149 | QColor shadesColor() const; |
|
149 | QColor shadesColor() const; | |
150 | void setShadesBorderColor(QColor color); |
|
150 | void setShadesBorderColor(QColor color); | |
151 | QColor shadesBorderColor() const; |
|
151 | QColor shadesBorderColor() const; | |
152 |
|
152 | |||
153 | Qt::Orientation orientation(); //TODO: missing const <- BC |
|
153 | Qt::Orientation orientation(); //TODO: missing const <- BC | |
154 | Qt::Alignment alignment() const; |
|
154 | Qt::Alignment alignment() const; | |
155 |
|
155 | |||
156 | //range handling |
|
156 | //range handling | |
157 | void setMin(const QVariant &min); |
|
157 | void setMin(const QVariant &min); | |
158 | void setMax(const QVariant &max); |
|
158 | void setMax(const QVariant &max); | |
159 | void setRange(const QVariant &min, const QVariant &max); |
|
159 | void setRange(const QVariant &min, const QVariant &max); | |
160 |
|
160 | |||
161 | Q_SIGNALS: |
|
161 | Q_SIGNALS: | |
162 | void visibleChanged(bool visible); |
|
162 | void visibleChanged(bool visible); | |
163 | void linePenChanged(const QPen& pen); |
|
163 | void linePenChanged(const QPen& pen); | |
164 | void lineVisibleChanged(bool visible); |
|
164 | void lineVisibleChanged(bool visible); | |
165 | void labelsVisibleChanged(bool visible); |
|
165 | void labelsVisibleChanged(bool visible); | |
166 | void labelsPenChanged(const QPen& pen); |
|
166 | void labelsPenChanged(const QPen& pen); | |
167 | void labelsBrushChanged(const QBrush& brush); |
|
167 | void labelsBrushChanged(const QBrush& brush); | |
168 | void labelsFontChanged(const QFont& pen); |
|
168 | void labelsFontChanged(const QFont& pen); | |
169 | void labelsAngleChanged(int angle); |
|
169 | void labelsAngleChanged(int angle); | |
170 | void gridLinePenChanged(const QPen& pen); |
|
170 | void gridLinePenChanged(const QPen& pen); | |
171 | void gridVisibleChanged(bool visible); |
|
171 | void gridVisibleChanged(bool visible); | |
172 | void colorChanged(QColor color); |
|
172 | void colorChanged(QColor color); | |
173 | void labelsColorChanged(QColor color); |
|
173 | void labelsColorChanged(QColor color); | |
174 | void titleTextChanged(const QString& title); |
|
174 | void titleTextChanged(const QString& title); | |
175 | void titlePenChanged(const QPen& pen); |
|
175 | void titlePenChanged(const QPen& pen); | |
176 | void titleBrushChanged(const QBrush brush); |
|
176 | void titleBrushChanged(const QBrush brush); | |
177 | void titleVisibleChanged(bool visible); |
|
177 | void titleVisibleChanged(bool visible); | |
178 | void titleFontChanged(const QFont& font); |
|
178 | void titleFontChanged(const QFont& font); | |
179 | void shadesVisibleChanged(bool visible); |
|
179 | void shadesVisibleChanged(bool visible); | |
180 | void shadesColorChanged(QColor color); |
|
180 | void shadesColorChanged(QColor color); | |
181 | void shadesBorderColorChanged(QColor color); |
|
181 | void shadesBorderColorChanged(QColor color); | |
182 | void shadesPenChanged(const QPen& pen); |
|
182 | void shadesPenChanged(const QPen& pen); | |
183 | void shadesBrushChanged(const QBrush brush); |
|
183 | void shadesBrushChanged(const QBrush brush); | |
184 |
|
184 | |||
185 | protected: |
|
185 | protected: | |
186 | QScopedPointer<QAbstractAxisPrivate> d_ptr; |
|
186 | QScopedPointer<QAbstractAxisPrivate> d_ptr; | |
187 | Q_DISABLE_COPY(QAbstractAxis) |
|
187 | Q_DISABLE_COPY(QAbstractAxis) | |
188 | friend class ChartDataSet; |
|
188 | friend class ChartDataSet; | |
189 | friend class ChartAxis; |
|
189 | friend class ChartAxis; | |
190 | friend class ChartPresenter; |
|
190 | friend class ChartPresenter; | |
191 | friend class ChartThemeManager; |
|
191 | friend class ChartThemeManager; | |
192 | friend class AbstractDomain; |
|
192 | friend class AbstractDomain; | |
193 | }; |
|
193 | }; | |
194 |
|
194 | |||
195 | QTCOMMERCIALCHART_END_NAMESPACE |
|
195 | QTCOMMERCIALCHART_END_NAMESPACE | |
196 |
|
196 | |||
197 | #endif // QABSTRACTAXIS_H |
|
197 | #endif // QABSTRACTAXIS_H |
General Comments 0
You need to be logged in to leave comments.
Login now