chartanimator_p.h
48 lines
| 1.3 KiB
| text/x-c
|
CLexer
|
r530 | #ifndef CHARTANIMATOR_P_H_ | ||
#define CHARTANIMATOR_P_H_ | ||||
#include "qchartglobal.h" | ||||
#include "chartanimation_p.h" | ||||
|
r618 | #include "piechartitem_p.h" | ||
|
r531 | #include <QPointF> | ||
|
r530 | |||
QTCOMMERCIALCHART_BEGIN_NAMESPACE | ||||
class ChartItem; | ||||
class XYChartItem; | ||||
class AxisItem; | ||||
|
r560 | class AreaChartItem; | ||
|
r530 | |||
class ChartAnimator : public QObject { | ||||
public: | ||||
|
r531 | //TODO: this should be flags in case of two state at the time | ||
enum State{ShowState, ScrollUpState, ScrollDownState, ScrollLeftState,ScrollRightState,ZoomInState,ZoomOutState}; | ||||
|
r530 | ChartAnimator(QObject *parent = 0); | ||
virtual ~ChartAnimator(); | ||||
void addAnimation(AxisItem* item); | ||||
void addAnimation(XYChartItem* item); | ||||
|
r618 | void addAnimation(PieChartItem* item); | ||
|
r530 | |||
void removeAnimation(ChartItem* item); | ||||
void animationStarted(); | ||||
void applyLayout(XYChartItem* item, QVector<QPointF>& layout); | ||||
void updateLayout(XYChartItem* item, QVector<QPointF>& layout); | ||||
void applyLayout(AxisItem* item, QVector<qreal>& layout); | ||||
|
r618 | void applyLayout(PieChartItem* item, QVector<PieSliceLayout> &layout); | ||
void updateLayout(PieChartItem* item, PieSliceLayout &layout); | ||||
|
r531 | void setState(State state,const QPointF& point = QPointF()); | ||
|
r530 | private: | ||
QMap<ChartItem*,ChartAnimation*> m_animations; | ||||
|
r531 | State m_state; | ||
QPointF m_point; | ||||
|
r530 | }; | ||
QTCOMMERCIALCHART_END_NAMESPACE | ||||
#endif | ||||