@@ -1,94 +1,95 | |||||
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 QLEGENDMARKER_H |
|
21 | #ifndef QLEGENDMARKER_H | |
22 | #define QLEGENDMARKER_H |
|
22 | #define QLEGENDMARKER_H | |
23 |
|
23 | |||
24 | #include <QChartGlobal> |
|
24 | #include <QChartGlobal> | |
25 | #include <QObject> |
|
25 | #include <QObject> | |
26 | #include <QPen> |
|
26 | #include <QPen> | |
27 | #include <QBrush> |
|
27 | #include <QBrush> | |
28 | #include <QFont> |
|
28 | #include <QFont> | |
29 |
|
29 | |||
30 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
30 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |
31 |
|
31 | |||
32 | class QLegendMarkerPrivate; |
|
32 | class QLegendMarkerPrivate; | |
33 | class QAbstractSeries; |
|
33 | class QAbstractSeries; | |
34 | class QLegend; |
|
34 | class QLegend; | |
35 |
|
35 | |||
36 | class QTCOMMERCIALCHART_EXPORT QLegendMarker : public QObject |
|
36 | class QTCOMMERCIALCHART_EXPORT QLegendMarker : public QObject | |
37 | { |
|
37 | { | |
38 | Q_OBJECT |
|
38 | Q_OBJECT | |
39 |
|
39 | |||
40 | public: |
|
40 | public: | |
41 | enum LegendMarkerType { |
|
41 | enum LegendMarkerType { | |
42 | LegendMarkerTypeArea, |
|
42 | LegendMarkerTypeArea, | |
43 | LegendMarkerTypeBar, |
|
43 | LegendMarkerTypeBar, | |
44 | LegendMarkerTypePie, |
|
44 | LegendMarkerTypePie, | |
45 | LegendMarkerTypeXY |
|
45 | LegendMarkerTypeXY | |
46 | }; |
|
46 | }; | |
47 |
|
47 | |||
48 | // TODO: |
|
48 | // TODO: | |
49 | // Q_PROPERTY(QString label READ label WRITE setlabel NOTIFY labelChanged); |
|
49 | // Q_PROPERTY(QString label READ label WRITE setlabel NOTIFY labelChanged); | |
50 | // Q_PROPERTY(QPen pen READ pen WRITE setPen NOTIFY penChanged); |
|
50 | // Q_PROPERTY(QPen pen READ pen WRITE setPen NOTIFY penChanged); | |
51 | // Q_PROPERTY(QBrush brush READ brush WRITE setBrush NOTIFY brushChanged); |
|
51 | // Q_PROPERTY(QBrush brush READ brush WRITE setBrush NOTIFY brushChanged); | |
52 |
|
52 | |||
53 | public: |
|
53 | public: | |
54 | virtual ~QLegendMarker(); |
|
54 | virtual ~QLegendMarker(); | |
55 | virtual LegendMarkerType type() = 0; |
|
55 | virtual LegendMarkerType type() = 0; | |
56 |
|
56 | |||
57 | QString label() const; |
|
57 | QString label() const; | |
58 | void setLabel(const QString &label); |
|
58 | void setLabel(const QString &label); | |
59 |
|
59 | |||
60 | QBrush labelBrush() const; |
|
60 | QBrush labelBrush() const; | |
61 | void setLabelBrush(const QBrush &brush); |
|
61 | void setLabelBrush(const QBrush &brush); | |
62 |
|
62 | |||
63 | QFont font() const; |
|
63 | QFont font() const; | |
64 | void setFont(const QFont &font); |
|
64 | void setFont(const QFont &font); | |
65 |
|
65 | |||
66 | QPen pen() const; |
|
66 | QPen pen() const; | |
67 | void setPen(const QPen &pen); |
|
67 | void setPen(const QPen &pen); | |
68 |
|
68 | |||
69 | QBrush brush() const; |
|
69 | QBrush brush() const; | |
70 | void setBrush(const QBrush &brush); |
|
70 | void setBrush(const QBrush &brush); | |
71 |
|
71 | |||
72 | bool isVisible() const; |
|
72 | bool isVisible() const; | |
73 | void setVisible(bool visible); |
|
73 | void setVisible(bool visible); | |
74 |
|
74 | |||
75 | virtual QAbstractSeries* series() = 0; |
|
75 | virtual QAbstractSeries* series() = 0; | |
76 |
|
76 | |||
77 | Q_SIGNALS: |
|
77 | Q_SIGNALS: | |
78 | void clicked(); |
|
78 | void clicked(); | |
79 | void hovered(bool status); |
|
79 | void hovered(bool status); | |
80 |
|
80 | |||
81 | protected: |
|
81 | protected: | |
82 | explicit QLegendMarker(QLegendMarkerPrivate &d, QObject *parent = 0); |
|
82 | explicit QLegendMarker(QLegendMarkerPrivate &d, QObject *parent = 0); | |
83 |
|
83 | |||
84 | QScopedPointer<QLegendMarkerPrivate> d_ptr; |
|
84 | QScopedPointer<QLegendMarkerPrivate> d_ptr; | |
85 | Q_DISABLE_COPY(QLegendMarker) |
|
85 | Q_DISABLE_COPY(QLegendMarker) | |
86 | friend class QLegendPrivate; |
|
86 | friend class QLegendPrivate; | |
87 | friend class QLegendMarkerPrivate; |
|
87 | friend class QLegendMarkerPrivate; | |
88 | friend class LegendMarkerItem; |
|
88 | friend class LegendMarkerItem; | |
89 | friend class LegendLayout; |
|
89 | friend class LegendLayout; | |
|
90 | friend class LegendScroller; | |||
90 | }; |
|
91 | }; | |
91 |
|
92 | |||
92 | QTCOMMERCIALCHART_END_NAMESPACE |
|
93 | QTCOMMERCIALCHART_END_NAMESPACE | |
93 |
|
94 | |||
94 | #endif // QLEGENDMARKER_H |
|
95 | #endif // QLEGENDMARKER_H |
General Comments 0
You need to be logged in to leave comments.
Login now