soui 5.0.0.1
Soui5 Doc
 
Loading...
Searching...
No Matches
STranslateAnimation.h
1#ifndef __STRANSLATEANIMATION__H__
2#define __STRANSLATEANIMATION__H__
3
4#include <animation/SAnimation.h>
5
6SNSBEGIN
7
8/**
9 * @class STranslateAnimation
10 * @brief An animation that controls the position of an object.
11 *
12 * See the {@link android.view.animation full package} description for details and sample code.
13 */
14class SOUI_EXP STranslateAnimation : public SAnimation {
15 DEF_SOBJECT(SAnimation, L"translate")
16
17 protected:
18 SValueDescription mFromXValue; ///< Description of the starting X value.
19 SValueDescription mToXValue; ///< Description of the ending X value.
20 SValueDescription mFromYValue; ///< Description of the starting Y value.
21 SValueDescription mToYValue; ///< Description of the ending Y value.
22
23 float mFromXDelta; ///< The starting X delta value.
24 float mToXDelta; ///< The ending X delta value.
25 float mFromYDelta; ///< The starting Y delta value.
26 float mToYDelta; ///< The ending Y delta value.
27
28 public:
29 /**
30 * @brief Default constructor for STranslateAnimation.
31 */
33
34 /**
35 * @brief Constructor to use when building a TranslateAnimation from code.
36 *
37 * @param fromX Description of the starting X value. This value can either be an absolute number
38 * if fromXType is ABSOLUTE, or a percentage (where 1.0 is 100%) otherwise.
39 * @param toX Description of the ending X value. This value can either be an absolute number
40 * if toXType is ABSOLUTE, or a percentage (where 1.0 is 100%) otherwise.
41 * @param fromY Description of the starting Y value. This value can either be an absolute number
42 * if fromYType is ABSOLUTE, or a percentage (where 1.0 is 100%) otherwise.
43 * @param toY Description of the ending Y value. This value can either be an absolute number
44 * if toYType is ABSOLUTE, or a percentage (where 1.0 is 100%) otherwise.
45 */
46 void init(const SValueDescription &fromX, const SValueDescription &toX, const SValueDescription &fromY, const SValueDescription &toY);
47
48 protected:
49 /**
50 * @brief Applies the transformation at a specific interpolated time.
51 * @param interpolatedTime Interpolated time between 0 and 1.
52 * @param t Pointer to the transformation to apply.
53 */
54 STDMETHOD_(void, applyTransformation)
55 (THIS_ float interpolatedTime, ITransformation *t) OVERRIDE;
56
57 public:
58 /**
59 * @brief Initializes the animation with the dimensions of the object and its parent.
60 * @param width Width of the object being animated.
61 * @param height Height of the object being animated.
62 * @param parentWidth Width of the parent of the object being animated.
63 * @param parentHeight Height of the parent of the object being animated.
64 * @param nScale Scale factor.
65 */
66 STDMETHOD_(void, initialize)
67 (THIS_ int width, int height, int parentWidth, int parentHeight, int nScale) OVERRIDE;
68
69 /**
70 * @brief Attributes for STranslateAnimation
71 */
72 SOUI_ATTRS_BEGIN()
73 ATTR_VALUE_DESC(L"fromXDelta", mFromXValue) ///< Description of the starting X value.
74 ATTR_VALUE_DESC(L"toXDelta", mToXValue) ///< Description of the ending X value.
75 ATTR_VALUE_DESC(L"fromYDelta", mFromYValue) ///< Description of the starting Y value.
76 ATTR_VALUE_DESC(L"toYDelta", mToYValue) ///< Description of the ending Y value.
77 SOUI_ATTRS_END()
78};
79
80SNSEND
81
82#endif // __STRANSLATEANIMATION__H__
SAnimation()
Default constructor for SAnimation.
float mToXDelta
The ending X delta value.
SValueDescription mToYValue
Description of the ending Y value.
SValueDescription mToXValue
Description of the ending X value.
SValueDescription mFromXValue
Description of the starting X value.
float mToYDelta
The ending Y delta value.
STranslateAnimation()
Default constructor for STranslateAnimation.
void init(const SValueDescription &fromX, const SValueDescription &toX, const SValueDescription &fromY, const SValueDescription &toY)
Constructor to use when building a TranslateAnimation from code.
float mFromYDelta
The starting Y delta value.
SValueDescription mFromYValue
Description of the starting Y value.
void initialize(int width, int height, int parentWidth, int parentHeight, int nScale) OVERRIDE
Initializes the animation with the dimensions of the object and its parent.
float mFromXDelta
The starting X delta value.
void applyTransformation(float interpolatedTime, ITransformation *t) OVERRIDE
Applies the transformation at a specific interpolated time.
Utility class to parse a string description of a size.
Definition SAnimation.h:24