34 |
34 |
35 class HB_AUTOTEST_EXPORT HbEffectAnimation : public QVariantAnimation |
35 class HB_AUTOTEST_EXPORT HbEffectAnimation : public QVariantAnimation |
36 { |
36 { |
37 Q_OBJECT |
37 Q_OBJECT |
38 public: |
38 public: |
39 HbEffectAnimation(); |
39 HbEffectAnimation(HbEffectGroup *group); |
40 virtual ~HbEffectAnimation(); |
40 virtual ~HbEffectAnimation(); |
41 |
41 |
42 void addLooping(const HbEffectFxmlParamData *param, HbEffectGroup *group); |
42 void addLooping(const HbEffectFxmlParamData *param); |
43 |
43 |
44 virtual void handleAnimationUpdate(const QVariant &value) = 0; |
44 virtual void handleAnimationUpdate(const QVariant &value) = 0; |
45 virtual void handleAnimationFinish() = 0; |
45 virtual void handleAnimationFinish() = 0; |
46 |
46 |
47 protected: |
47 protected: |
48 virtual QVariant interpolated(const QVariant &from, const QVariant &to, qreal progress) const; |
48 virtual QVariant interpolated(const QVariant &from, const QVariant &to, qreal progress) const; |
49 |
49 |
50 private: |
50 private: |
51 void updateCurrentValue(const QVariant &value); |
51 void updateCurrentValue(const QVariant &value); |
52 inline bool looping() const {return mLoopEnd > 0;} |
52 inline bool looping() const { return mLoopEnd > 0; } |
53 |
53 |
54 private slots: |
54 private slots: |
55 void handleFinished(); |
55 void handleFinished(); |
56 |
56 |
57 public: |
57 public: |
|
58 HbEffectGroup *mGroup; |
58 // The curve is stored here instead of setting it to QVariantAnimation so that it uses linear curve always |
59 // The curve is stored here instead of setting it to QVariantAnimation so that it uses linear curve always |
59 // and does not mess up with applying the curve to each keyframe separately. |
60 // and does not mess up with applying the curve to each keyframe separately. |
60 QEasingCurve mCurve; |
61 QEasingCurve mCurve; |
61 int mLoopStart; |
62 int mLoopStart; |
62 int mLoopEnd; |
63 int mLoopEnd; |
63 bool mInactive; // This is used to temporarily prevent the animation from reacting to false update requests |
64 bool mInactive; // This is used to temporarily prevent the animation from reacting to false update requests |
64 bool mFinished; |
65 bool mFinished; |
65 }; |
66 }; |
66 |
67 |
67 #endif // HB_EFFECT_ANIMATION_P_H |
68 #endif // HB_EFFECT_ANIMATION_P_H |
68 |
|