chartanimator_p.h
79 lines
| 2.7 KiB
| text/x-c
|
CLexer
|
r794 | /**************************************************************************** | ||
** | ||||
** Copyright (C) 2012 Digia Plc | ||||
** All rights reserved. | ||||
** For any questions to Digia, please use contact form at http://qt.digia.com | ||||
** | ||||
** This file is part of the Qt Commercial Charts Add-on. | ||||
** | ||||
** $QT_BEGIN_LICENSE$ | ||||
** Licensees holding valid Qt Commercial licenses may use this file in | ||||
** accordance with the Qt Commercial License Agreement provided with the | ||||
** Software or, alternatively, in accordance with the terms contained in | ||||
** a written agreement between you and Digia. | ||||
** | ||||
** If you have questions regarding the use of this file, please use | ||||
** contact form at http://qt.digia.com | ||||
** $QT_END_LICENSE$ | ||||
** | ||||
****************************************************************************/ | ||||
|
r969 | #ifndef CHARTANIMATOR_P_H | ||
#define CHARTANIMATOR_P_H | ||||
|
r530 | #include "qchartglobal.h" | ||
#include "chartanimation_p.h" | ||||
|
r618 | #include "piechartitem_p.h" | ||
|
r671 | #include "barchartitem_p.h" | ||
|
r531 | #include <QPointF> | ||
|
r530 | |||
QTCOMMERCIALCHART_BEGIN_NAMESPACE | ||||
class ChartItem; | ||||
|
r1006 | class ChartAxis; | ||
|
r560 | class AreaChartItem; | ||
|
r622 | class SplineChartItem; | ||
class ScatterChartItem; | ||||
class LineChartItem; | ||||
class XYChartItem; | ||||
|
r530 | |||
|
r974 | class ChartAnimator : public QObject | ||
{ | ||||
Q_OBJECT | ||||
|
r530 | public: | ||
|
r738 | enum State{ShowState, ScrollUpState, ScrollDownState, ScrollLeftState, ScrollRightState, ZoomInState, ZoomOutState}; | ||
|
r677 | |||
|
r530 | ChartAnimator(QObject *parent = 0); | ||
virtual ~ChartAnimator(); | ||||
|
r1006 | void addAnimation(ChartAxis *item); | ||
|
r738 | void addAnimation(PieChartItem *item); | ||
void addAnimation(ScatterChartItem *item); | ||||
void addAnimation(LineChartItem *item); | ||||
void addAnimation(SplineChartItem *item); | ||||
void addAnimation(BarChartItem *item); | ||||
void removeAnimation(Chart *item); | ||||
|
r530 | |||
void animationStarted(); | ||||
|
r738 | void updateLayout(XYChartItem *item, QVector<QPointF> &oldLayout, QVector<QPointF> &newLayout, int index); | ||
void updateLayout(SplineChartItem *item, QVector<QPointF> &oldPoints, QVector<QPointF> &newPoints, QVector<QPointF> &oldControlPoints, QVector<QPointF> &newContorlPoints, int index); | ||||
|
r1006 | void updateLayout(ChartAxis *item, QVector<qreal> &layout); | ||
|
r530 | |||
|
r738 | void addAnimation(PieChartItem *item, QPieSlice *slice, const PieSliceData &sliceData, bool isEmpty); | ||
void removeAnimation(PieChartItem *item, QPieSlice *slice); | ||||
void updateLayout(PieChartItem *item, const PieLayout &layout); | ||||
void updateLayout(PieChartItem *item, QPieSlice *slice, const PieSliceData &sliceData); | ||||
|
r618 | |||
|
r738 | void updateLayout(BarChartItem *item, const QVector<QRectF> &oldLayout, const QVector<QRectF> &newLayout); | ||
|
r671 | |||
|
r738 | void setState(State state,const QPointF &point = QPointF()); | ||
|
r531 | |||
|
r530 | private: | ||
|
r738 | QMap<Chart *, ChartAnimation *> m_animations; | ||
|
r531 | State m_state; | ||
QPointF m_point; | ||||
|
r530 | }; | ||
QTCOMMERCIALCHART_END_NAMESPACE | ||||
#endif | ||||