1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4// W A R N I N G
5// -------------
6//
7// This file is not part of the Qt Chart API. It exists purely as an
8// implementation detail. This header file may change from version to
9// version without notice, or even be removed.
10//
11// We mean it.
12
13#ifndef QABSTRACTSERIES_P_H
14#define QABSTRACTSERIES_P_H
15
16#include <QtCharts/QAbstractSeries>
17#include <QtCharts/QChart>
18#include <private/abstractdomain_p.h>
19#include <QtCharts/private/qchartglobal_p.h>
20
21#include <memory>
22
23QT_BEGIN_NAMESPACE
24class QGraphicsItem;
25QT_END_NAMESPACE
26
27QT_BEGIN_NAMESPACE
28
29class ChartPresenter;
30class ChartElement;
31class LegendMarker;
32class QLegend;
33class ChartDataSet;
34class QAbstractAxis;
35class QLegendMarker;
36class ChartTheme;
37class ChartAnimation;
38class ChartItem;
39class BoxPlotChartItem;
40
41class Q_CHARTS_PRIVATE_EXPORT QAbstractSeriesPrivate : public QObject
42{
43 Q_OBJECT
44public:
45 QAbstractSeriesPrivate(QAbstractSeries *q);
46 ~QAbstractSeriesPrivate();
47
48 virtual void initializeDomain() = 0;
49 virtual void initializeAxes() = 0;
50 virtual void initializeTheme(int index, ChartTheme* theme, bool forced = false) = 0;
51 virtual void initializeGraphics(QGraphicsItem* parent) = 0;
52 virtual void initializeAnimations(QChart::AnimationOptions options, int duration,
53 QEasingCurve &curve) = 0;
54
55 virtual QList<QLegendMarker*> createLegendMarkers(QLegend* legend) = 0;
56
57 virtual QAbstractAxis::AxisType defaultAxisType(Qt::Orientation) const = 0;
58 virtual QAbstractAxis* createDefaultAxis(Qt::Orientation) const = 0;
59
60 ChartItem* chartItem() { return m_item.get(); }
61
62 virtual void setDomain(AbstractDomain* domain);
63 AbstractDomain* domain() { return m_domain.data(); }
64
65 virtual void setPresenter(ChartPresenter *presenter);
66 ChartPresenter *presenter() const;
67
68 QChart* chart() { return m_chart; }
69
70 void setBlockOpenGL(bool enable);
71
72Q_SIGNALS:
73 void countChanged();
74
75protected:
76 QAbstractSeries *q_ptr;
77 QChart *m_chart;
78 std::unique_ptr<ChartItem> m_item;
79 QList<QAbstractAxis*> m_axes;
80
81private:
82 QScopedPointer<AbstractDomain> m_domain;
83 QString m_name;
84 bool m_visible;
85 qreal m_opacity;
86 ChartPresenter *m_presenter;
87 bool m_useOpenGL;
88 bool m_blockOpenGL;
89
90 friend class QAbstractSeries;
91 friend class ChartDataSet;
92 friend class ChartPresenter;
93 friend class QLegendPrivate;
94 friend class BoxPlotChartItem;
95};
96
97QT_END_NAMESPACE
98
99#endif
100

source code of qtcharts/src/charts/qabstractseries_p.h