##// END OF EJS Templates
Remove unnessery friend declaration form qabstractaxis
Michal Klocek -
r1721:c93d43dcbcb8
parent child
Show More
@@ -1,145 +1,143
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 Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged)
36 Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged)
37 Q_PROPERTY(bool arrowVisible READ isArrowVisible WRITE setArrowVisible NOTIFY arrowVisibleChanged)
37 Q_PROPERTY(bool arrowVisible READ isArrowVisible WRITE setArrowVisible NOTIFY arrowVisibleChanged)
38 Q_PROPERTY(QColor color READ axisPenColor WRITE setAxisPenColor NOTIFY colorChanged)
38 Q_PROPERTY(QColor color READ axisPenColor WRITE setAxisPenColor NOTIFY colorChanged)
39 Q_PROPERTY(bool labelsVisible READ labelsVisible WRITE setLabelsVisible NOTIFY labelsVisibleChanged)
39 Q_PROPERTY(bool labelsVisible READ labelsVisible WRITE setLabelsVisible NOTIFY labelsVisibleChanged)
40 Q_PROPERTY(int labelsAngle READ labelsAngle WRITE setLabelsAngle)
40 Q_PROPERTY(int labelsAngle READ labelsAngle WRITE setLabelsAngle)
41 Q_PROPERTY(QFont labelsFont READ labelsFont WRITE setLabelsFont)
41 Q_PROPERTY(QFont labelsFont READ labelsFont WRITE setLabelsFont)
42 Q_PROPERTY(QColor labelsColor READ labelsColor WRITE setLabelsColor NOTIFY labelsColorChanged)
42 Q_PROPERTY(QColor labelsColor READ labelsColor WRITE setLabelsColor NOTIFY labelsColorChanged)
43 Q_PROPERTY(bool gridVisible READ isGridLineVisible WRITE setGridLineVisible NOTIFY gridVisibleChanged)
43 Q_PROPERTY(bool gridVisible READ isGridLineVisible WRITE setGridLineVisible NOTIFY gridVisibleChanged)
44 Q_PROPERTY(bool shadesVisible READ shadesVisible WRITE setShadesVisible NOTIFY shadesVisibleChanged)
44 Q_PROPERTY(bool shadesVisible READ shadesVisible WRITE setShadesVisible NOTIFY shadesVisibleChanged)
45 Q_PROPERTY(QColor shadesColor READ shadesColor WRITE setShadesColor NOTIFY shadesColorChanged)
45 Q_PROPERTY(QColor shadesColor READ shadesColor WRITE setShadesColor NOTIFY shadesColorChanged)
46 Q_PROPERTY(QColor shadesBorderColor READ shadesBorderColor WRITE setShadesBorderColor NOTIFY shadesBorderColorChanged)
46 Q_PROPERTY(QColor shadesBorderColor READ shadesBorderColor WRITE setShadesBorderColor NOTIFY shadesBorderColorChanged)
47
47
48 public:
48 public:
49
49
50 enum AxisType {
50 enum AxisType {
51 AxisTypeNoAxis = 0x0,
51 AxisTypeNoAxis = 0x0,
52 AxisTypeValues = 0x1,
52 AxisTypeValues = 0x1,
53 AxisTypeCategories = 0x2,
53 AxisTypeCategories = 0x2,
54 AxisTypeIntervals = 0x3,
54 AxisTypeIntervals = 0x3,
55 AxisTypeDateTime = 0x4
55 AxisTypeDateTime = 0x4
56 };
56 };
57
57
58 Q_DECLARE_FLAGS(AxisTypes, AxisType)
58 Q_DECLARE_FLAGS(AxisTypes, AxisType)
59
59
60 protected:
60 protected:
61 explicit QAbstractAxis(QAbstractAxisPrivate &d,QObject *parent = 0);
61 explicit QAbstractAxis(QAbstractAxisPrivate &d,QObject *parent = 0);
62
62
63 public:
63 public:
64 ~QAbstractAxis();
64 ~QAbstractAxis();
65
65
66 virtual AxisType type() const = 0;
66 virtual AxisType type() const = 0;
67
67
68 //visibilty hadnling
68 //visibilty hadnling
69 bool isVisible() const;
69 bool isVisible() const;
70 void setVisible(bool visible = true);
70 void setVisible(bool visible = true);
71
71
72
72
73 //axis handling
73 //axis handling
74 bool isArrowVisible() const;
74 bool isArrowVisible() const;
75 void setArrowVisible(bool visible = true);
75 void setArrowVisible(bool visible = true);
76 void setAxisPen(const QPen &pen);
76 void setAxisPen(const QPen &pen);
77 QPen axisPen() const;
77 QPen axisPen() const;
78 void setAxisPenColor(QColor color);
78 void setAxisPenColor(QColor color);
79 QColor axisPenColor() const;
79 QColor axisPenColor() const;
80
80
81 //grid handling
81 //grid handling
82 bool isGridLineVisible() const;
82 bool isGridLineVisible() const;
83 void setGridLineVisible(bool visible = true);
83 void setGridLineVisible(bool visible = true);
84 void setGridLinePen(const QPen &pen);
84 void setGridLinePen(const QPen &pen);
85 QPen gridLinePen() const;
85 QPen gridLinePen() const;
86
86
87 //labels handling
87 //labels handling
88 bool labelsVisible() const;
88 bool labelsVisible() const;
89 void setLabelsVisible(bool visible = true);
89 void setLabelsVisible(bool visible = true);
90 void setLabelsPen(const QPen &pen);
90 void setLabelsPen(const QPen &pen);
91 QPen labelsPen() const;
91 QPen labelsPen() const;
92 void setLabelsBrush(const QBrush &brush);
92 void setLabelsBrush(const QBrush &brush);
93 QBrush labelsBrush() const;
93 QBrush labelsBrush() const;
94 void setLabelsFont(const QFont &font);
94 void setLabelsFont(const QFont &font);
95 QFont labelsFont() const;
95 QFont labelsFont() const;
96 void setLabelsAngle(int angle);
96 void setLabelsAngle(int angle);
97 int labelsAngle() const;
97 int labelsAngle() const;
98 void setLabelsColor(QColor color);
98 void setLabelsColor(QColor color);
99 QColor labelsColor() const;
99 QColor labelsColor() const;
100
100
101 //shades handling
101 //shades handling
102 bool shadesVisible() const;
102 bool shadesVisible() const;
103 void setShadesVisible(bool visible = true);
103 void setShadesVisible(bool visible = true);
104 void setShadesPen(const QPen &pen);
104 void setShadesPen(const QPen &pen);
105 QPen shadesPen() const;
105 QPen shadesPen() const;
106 void setShadesBrush(const QBrush &brush);
106 void setShadesBrush(const QBrush &brush);
107 QBrush shadesBrush() const;
107 QBrush shadesBrush() const;
108 void setShadesColor(QColor color);
108 void setShadesColor(QColor color);
109 QColor shadesColor() const;
109 QColor shadesColor() const;
110 void setShadesBorderColor(QColor color);
110 void setShadesBorderColor(QColor color);
111 QColor shadesBorderColor() const;
111 QColor shadesBorderColor() const;
112
112
113 Qt::Orientation orientation();
113 Qt::Orientation orientation();
114
114
115 //range handling
115 //range handling
116 void setMin(const QVariant &min);
116 void setMin(const QVariant &min);
117 void setMax(const QVariant &max);
117 void setMax(const QVariant &max);
118 void setRange(const QVariant &min, const QVariant &max);
118 void setRange(const QVariant &min, const QVariant &max);
119
119
120 void show();
120 void show();
121 void hide();
121 void hide();
122
122
123 Q_SIGNALS:
123 Q_SIGNALS:
124 void visibleChanged(bool visible);
124 void visibleChanged(bool visible);
125 void arrowVisibleChanged(bool visible);
125 void arrowVisibleChanged(bool visible);
126 void labelsVisibleChanged(bool visible);
126 void labelsVisibleChanged(bool visible);
127 void gridVisibleChanged(bool visible);
127 void gridVisibleChanged(bool visible);
128 void colorChanged(QColor color);
128 void colorChanged(QColor color);
129 void labelsColorChanged(QColor color);
129 void labelsColorChanged(QColor color);
130 void shadesVisibleChanged(bool visible);
130 void shadesVisibleChanged(bool visible);
131 void shadesColorChanged(QColor color);
131 void shadesColorChanged(QColor color);
132 void shadesBorderColorChanged(QColor color);
132 void shadesBorderColorChanged(QColor color);
133
133
134 protected:
134 protected:
135 QScopedPointer<QAbstractAxisPrivate> d_ptr;
135 QScopedPointer<QAbstractAxisPrivate> d_ptr;
136 Q_DISABLE_COPY(QAbstractAxis);
136 Q_DISABLE_COPY(QAbstractAxis);
137 friend class ChartDataSet;
137 friend class ChartDataSet;
138 friend class ChartAxis;
138 friend class ChartAxis;
139 friend class ChartPresenter;
139 friend class ChartPresenter;
140 friend class ChartCategoriesAxisX;
141 friend class ChartCategoriesAxisY;
142 };
140 };
143
141
144 QTCOMMERCIALCHART_END_NAMESPACE
142 QTCOMMERCIALCHART_END_NAMESPACE
145 #endif
143 #endif
General Comments 0
You need to be logged in to leave comments. Login now