chartpresenter_p.h
90 lines
| 2.1 KiB
| text/x-c
|
CLexer
/ src / chartpresenter_p.h
Michal Klocek
|
r131 | #ifndef CHARTPRESENTER_H_ | ||
#define CHARTPRESENTER_H_ | ||||
#include "qchartglobal.h" | ||||
Michal Klocek
|
r143 | #include "qchart.h" //becouse of QChart::ChartThemeId //TODO | ||
Michal Klocek
|
r176 | #include "qchartaxis.h" | ||
Michal Klocek
|
r131 | #include <QRectF> | ||
QTCOMMERCIALCHART_BEGIN_NAMESPACE | ||||
class ChartItem; | ||||
Michal Klocek
|
r360 | class QSeries; | ||
Michal Klocek
|
r131 | class ChartDataSet; | ||
class Domain; | ||||
Michal Klocek
|
r140 | class AxisItem; | ||
Michal Klocek
|
r143 | class ChartTheme; | ||
Michal Klocek
|
r530 | class ChartAnimator; | ||
Michal Klocek
|
r131 | |||
class ChartPresenter: public QObject | ||||
{ | ||||
Q_OBJECT | ||||
public: | ||||
Tero Ahola
|
r375 | enum ZValues { | ||
BackgroundZValue = -1, | ||||
ShadesZValue, | ||||
GridZValue, | ||||
AxisZValue, | ||||
LineChartZValue, | ||||
sauimone
|
r594 | BarSeriesZValue, | ||
Tero Ahola
|
r490 | ScatterSeriesZValue, | ||
sauimone
|
r540 | PieSeriesZValue, | ||
LegendZValue | ||||
Tero Ahola
|
r375 | }; | ||
Michal Klocek
|
r262 | |||
Michal Klocek
|
r131 | ChartPresenter(QChart* chart,ChartDataSet *dataset); | ||
virtual ~ChartPresenter(); | ||||
Michal Klocek
|
r139 | |||
void setMargin(int margin); | ||||
int margin() const; | ||||
Michal Klocek
|
r223 | QRectF geometry() const; | ||
Jani Honkonen
|
r659 | |||
ChartAnimator* animator() const {return m_animator;} | ||||
ChartTheme *theme() { return m_chartTheme; } | ||||
ChartDataSet *dataSet() { return m_dataset; } | ||||
Michal Klocek
|
r131 | |||
Michal Klocek
|
r645 | void setChartTheme(QChart::ChartTheme theme,bool force = true); | ||
Michal Klocek
|
r153 | QChart::ChartTheme chartTheme(); | ||
Michal Klocek
|
r143 | |||
Michal Klocek
|
r298 | void setAnimationOptions(QChart::AnimationOptions options); | ||
QChart::AnimationOptions animationOptions() const; | ||||
Michal Klocek
|
r439 | void zoomIn(); | ||
void zoomIn(const QRectF& rect); | ||||
void zoomOut(); | ||||
void zoomReset(); | ||||
Michal Klocek
|
r531 | void scroll(int dx,int dy); | ||
Jani Honkonen
|
r659 | |||
Michal Klocek
|
r131 | private: | ||
Michal Klocek
|
r140 | void createConnections(); | ||
Michal Klocek
|
r531 | void resetAllElements(); | ||
Michal Klocek
|
r131 | |||
public slots: | ||||
Michal Klocek
|
r439 | void handleSeriesAdded(QSeries* series,Domain* domain); | ||
Michal Klocek
|
r360 | void handleSeriesRemoved(QSeries* series); | ||
Michal Klocek
|
r439 | void handleAxisAdded(QChartAxis* axis,Domain* domain); | ||
Michal Klocek
|
r223 | void handleAxisRemoved(QChartAxis* axis); | ||
Michal Klocek
|
r131 | void handleGeometryChanged(); | ||
Michal Klocek
|
r439 | |||
Michal Klocek
|
r139 | signals: | ||
void geometryChanged(const QRectF& rect); | ||||
Michal Klocek
|
r439 | |||
Michal Klocek
|
r131 | private: | ||
QChart* m_chart; | ||||
Michal Klocek
|
r530 | ChartAnimator* m_animator; | ||
Michal Klocek
|
r131 | ChartDataSet* m_dataset; | ||
Michal Klocek
|
r143 | ChartTheme *m_chartTheme; | ||
Michal Klocek
|
r439 | int m_zoomIndex; | ||
QMap<QSeries*,ChartItem*> m_chartItems; | ||||
QMap<QChartAxis*,AxisItem*> m_axisItems; | ||||
QVector<QRectF> m_zoomStack; | ||||
Michal Klocek
|
r131 | QRectF m_rect; | ||
Michal Klocek
|
r298 | QChart::AnimationOptions m_options; | ||
Michal Klocek
|
r645 | bool m_themeForce; | ||
Michal Klocek
|
r143 | |||
Michal Klocek
|
r131 | }; | ||
QTCOMMERCIALCHART_END_NAMESPACE | ||||
#endif /* CHARTPRESENTER_H_ */ | ||||