##// 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 3 ** Copyright (C) 2012 Digia Plc
4 4 ** All rights reserved.
5 5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 6 **
7 7 ** This file is part of the Qt Commercial Charts Add-on.
8 8 **
9 9 ** $QT_BEGIN_LICENSE$
10 10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 11 ** accordance with the Qt Commercial License Agreement provided with the
12 12 ** Software or, alternatively, in accordance with the terms contained in
13 13 ** a written agreement between you and Digia.
14 14 **
15 15 ** If you have questions regarding the use of this file, please use
16 16 ** contact form at http://qt.digia.com
17 17 ** $QT_END_LICENSE$
18 18 **
19 19 ****************************************************************************/
20 20
21 21 #ifndef QABSTRACTAXIS_H
22 22 #define QABSTRACTAXIS_H
23 23
24 24 #include <qchartglobal.h>
25 25 #include <QPen>
26 26 #include <QFont>
27 27 #include <QVariant>
28 28
29 29 QTCOMMERCIALCHART_BEGIN_NAMESPACE
30 30
31 31 class QAbstractAxisPrivate;
32 32
33 33 class QTCOMMERCIALCHART_EXPORT QAbstractAxis : public QObject
34 34 {
35 35 Q_OBJECT
36 36 Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged)
37 37 Q_PROPERTY(bool arrowVisible READ isArrowVisible WRITE setArrowVisible NOTIFY arrowVisibleChanged)
38 38 Q_PROPERTY(QColor color READ axisPenColor WRITE setAxisPenColor NOTIFY colorChanged)
39 39 Q_PROPERTY(bool labelsVisible READ labelsVisible WRITE setLabelsVisible NOTIFY labelsVisibleChanged)
40 40 Q_PROPERTY(int labelsAngle READ labelsAngle WRITE setLabelsAngle)
41 41 Q_PROPERTY(QFont labelsFont READ labelsFont WRITE setLabelsFont)
42 42 Q_PROPERTY(QColor labelsColor READ labelsColor WRITE setLabelsColor NOTIFY labelsColorChanged)
43 43 Q_PROPERTY(bool gridVisible READ isGridLineVisible WRITE setGridLineVisible NOTIFY gridVisibleChanged)
44 44 Q_PROPERTY(bool shadesVisible READ shadesVisible WRITE setShadesVisible NOTIFY shadesVisibleChanged)
45 45 Q_PROPERTY(QColor shadesColor READ shadesColor WRITE setShadesColor NOTIFY shadesColorChanged)
46 46 Q_PROPERTY(QColor shadesBorderColor READ shadesBorderColor WRITE setShadesBorderColor NOTIFY shadesBorderColorChanged)
47 47
48 48 public:
49 49
50 50 enum AxisType {
51 51 AxisTypeNoAxis = 0x0,
52 52 AxisTypeValues = 0x1,
53 53 AxisTypeCategories = 0x2,
54 54 AxisTypeIntervals = 0x3,
55 55 AxisTypeDateTime = 0x4
56 56 };
57 57
58 58 Q_DECLARE_FLAGS(AxisTypes, AxisType)
59 59
60 60 protected:
61 61 explicit QAbstractAxis(QAbstractAxisPrivate &d,QObject *parent = 0);
62 62
63 63 public:
64 64 ~QAbstractAxis();
65 65
66 66 virtual AxisType type() const = 0;
67 67
68 68 //visibilty hadnling
69 69 bool isVisible() const;
70 70 void setVisible(bool visible = true);
71 71
72 72
73 73 //axis handling
74 74 bool isArrowVisible() const;
75 75 void setArrowVisible(bool visible = true);
76 76 void setAxisPen(const QPen &pen);
77 77 QPen axisPen() const;
78 78 void setAxisPenColor(QColor color);
79 79 QColor axisPenColor() const;
80 80
81 81 //grid handling
82 82 bool isGridLineVisible() const;
83 83 void setGridLineVisible(bool visible = true);
84 84 void setGridLinePen(const QPen &pen);
85 85 QPen gridLinePen() const;
86 86
87 87 //labels handling
88 88 bool labelsVisible() const;
89 89 void setLabelsVisible(bool visible = true);
90 90 void setLabelsPen(const QPen &pen);
91 91 QPen labelsPen() const;
92 92 void setLabelsBrush(const QBrush &brush);
93 93 QBrush labelsBrush() const;
94 94 void setLabelsFont(const QFont &font);
95 95 QFont labelsFont() const;
96 96 void setLabelsAngle(int angle);
97 97 int labelsAngle() const;
98 98 void setLabelsColor(QColor color);
99 99 QColor labelsColor() const;
100 100
101 101 //shades handling
102 102 bool shadesVisible() const;
103 103 void setShadesVisible(bool visible = true);
104 104 void setShadesPen(const QPen &pen);
105 105 QPen shadesPen() const;
106 106 void setShadesBrush(const QBrush &brush);
107 107 QBrush shadesBrush() const;
108 108 void setShadesColor(QColor color);
109 109 QColor shadesColor() const;
110 110 void setShadesBorderColor(QColor color);
111 111 QColor shadesBorderColor() const;
112 112
113 113 Qt::Orientation orientation();
114 114
115 115 //range handling
116 116 void setMin(const QVariant &min);
117 117 void setMax(const QVariant &max);
118 118 void setRange(const QVariant &min, const QVariant &max);
119 119
120 120 void show();
121 121 void hide();
122 122
123 123 Q_SIGNALS:
124 124 void visibleChanged(bool visible);
125 125 void arrowVisibleChanged(bool visible);
126 126 void labelsVisibleChanged(bool visible);
127 127 void gridVisibleChanged(bool visible);
128 128 void colorChanged(QColor color);
129 129 void labelsColorChanged(QColor color);
130 130 void shadesVisibleChanged(bool visible);
131 131 void shadesColorChanged(QColor color);
132 132 void shadesBorderColorChanged(QColor color);
133 133
134 134 protected:
135 135 QScopedPointer<QAbstractAxisPrivate> d_ptr;
136 136 Q_DISABLE_COPY(QAbstractAxis);
137 137 friend class ChartDataSet;
138 138 friend class ChartAxis;
139 139 friend class ChartPresenter;
140 friend class ChartCategoriesAxisX;
141 friend class ChartCategoriesAxisY;
142 140 };
143 141
144 142 QTCOMMERCIALCHART_END_NAMESPACE
145 143 #endif
General Comments 0
You need to be logged in to leave comments. Login now