2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Flora License, Version 1.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://floralicense.org/license/
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an AS IS BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 * @file FUiAnimRotateAnimation.h
20 * @brief This is the header file for the %RotateAnimation class.
22 * This header file contains the declarations of the %RotateAnimation class.
25 #ifndef _FUI_ANIM_ROTATE_ANIMATION_H_
26 #define _FUI_ANIM_ROTATE_ANIMATION_H_
28 #include <FUiAnimFloatAnimation.h>
31 namespace Tizen { namespace Ui { namespace Animations
36 * @class RotateAnimation
37 * @brief This class animates between two angle values.
41 * @final This class is not intended for extension.
43 * The %RotateAnimation class animates an object from an angle value (float) to another angle value (float)
44 * based on the specified interpolator type. When associated with a Control, the animation is applied on the z-axis of the %Control.
46 * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/ui/animating_uicontrols.htm">Animating UI Controls</a>.
48 class _OSP_EXPORT_ RotateAnimation
49 : public FloatAnimation
54 * Initializes this instance of %RotateAnimation with the specified parameters.
58 * @param[in] startValue The start value for the rotate animation @n
59 * If the value is positive, the control is rotated in the clockwise direction and if the value is negative, the control
60 * is rotated in the anti-clockwise direction.
61 * @param[in] endValue The end value for the rotate animation @n
62 * The value must be @c 0 or @c 360, else ControlAnimator::ControlAnimator() returns an @c E_INVALID_ARG exception.
63 * @param[in] duration The duration of animation in milliseconds
64 * @param[in] interpolator The type of interpolator @n
65 * This is used for the intermediate value calculation of the animation.
66 * @exception E_SUCCESS The method is successful.
67 * @exception E_INVALID_ARG The value of the specified parameter is negative or the interpolator is of an invalid type.
68 * @remarks The specific error code can be accessed using the GetLastResult() method.
70 RotateAnimation(float startValue, float endValue, long duration, AnimationInterpolatorType interpolator);
74 * This is the destructor for this class.
78 virtual ~RotateAnimation(void);
82 * This is the copy constructor for the %RotateAnimation class.
86 * @param[in] rotateAnimation An instance of %RotateAnimation
87 * @exception E_SUCCESS The method is successful.
88 * @exception E_OUT_OF_MEMORY The memory is insufficient.
89 * @remarks The specific error code can be accessed using the GetLastResult() method.
91 RotateAnimation(const RotateAnimation& rotateAnimation);
95 * Assigns the value of the specified instance to the current instance of %RotateAnimation.
99 * @param[in] rhs An instance of %RotateAnimation
100 * @exception E_SUCCESS The method is successful.
101 * @exception E_OUT_OF_MEMORY The memory is insufficient.
102 * @remarks The specific error code can be accessed using the GetLastResult() method.
104 RotateAnimation& operator =(const RotateAnimation& rhs);
108 * Checks whether the specified instance and the current instance of %RotateAnimation have equal animation values.
112 * @return @c true if the animation of the two instances of %RotateAnimation have equal values, @n
114 * @param[in] rhs An instance of %RotateAnimation
116 bool operator ==(const RotateAnimation& rhs) const;
120 * Checks whether the specified instance and the current instance of %RotateAnimation have different animation values.
124 * @return @c true if the values of the animations of the two instances of %RotateAnimation are not equal, @n
126 * @param[in] rhs An instance of %RotateAnimation
128 bool operator !=(const RotateAnimation& rhs) const;
132 * Checks whether the value of the current instance of %RotateAnimation is equal to the value of the specified instance.
136 * @return @c true if the value of the current instance is equal to the value of the specified instance, @n
138 * @param[in] obj An instance of %RotateAnimation
139 * @remarks The %RotateAnimation class has a semantic value. This means that this method checks whether the two instances have the same animation.
141 virtual bool Equals(const Tizen::Base::Object& obj) const;
145 * Gets the hash value of the current instance.
149 * @return The hash value of the current instance
150 * @remarks The two equal instances must return the same hash value. For better performance, the used hash function must generate a random
151 * distribution for all inputs.
153 virtual int GetHashCode(void) const;
157 * Sets the anchor points for the animation.
161 * @param[in] anchorX The x value of the anchor @n
162 * The control's animation is performed at this point. The range of the anchor point is @c 0.0 to @c 1.0.
163 * @param[in] anchorY The y value of the anchor @n
164 * The control's animation is performed at this point. The range of the anchor point is @c 0.0 to @c 1.0.
165 * @exception E_SUCCESS The method is successful.
166 * @exception E_INVALID_ARG A specified input parameter is invalid.
167 * @remarks The default anchor point value is (0.5, 0.5). The range of an anchor point is @c 0.0 to @c 1.0. @n
168 * If the anchor point value is (0.5, 0.5), the object is rotated and the center of the object remains fixed. @n
169 * If the anchor point value is (0.0, 0.0), the object is rotated and the top-left corner of the object remains fixed. @n
170 * If the anchor point value is (1.0, 1.0), the object is rotated and the right-bottom corner of the object remains fixed.
172 result SetAnchor(float anchorX, float anchorY);
176 * Gets the anchor point associated with the animation. @n
177 * The default anchor point is (0.5, 0.5).
181 * @param[out] anchorX The x value of the anchor @n
182 * The control's animation is performed at this point.
183 * @param[out] anchorY The y value of the anchor @n
184 * The control's animation is performed at this point.
186 void GetAnchor(float& anchorX, float& anchorY) const;
190 * Gets the type information of this instance.
194 * @return The type information of this instance
196 virtual AnimationType GetType(void) const;
201 friend class _RotateAnimationImpl;
205 // This variable is for internal use only. Using this variable can cause behavioral, security-related,
206 // and consistency-related issues in the application.
208 // This variable is for internal usage.
212 class _RotateAnimationImpl* _pRotateAnimationImpl;
218 // This method is for internal use only. Using this method can cause behavioral, security-related,
219 // and consistency-related issues in the application.
221 // This is the default constructor for this class.
225 RotateAnimation(void);
226 }; // RotateAnimation
229 }}} // Tizen::Ui::Animations
231 #endif // _FUI_ANIM_ROTATE_ANIMATION_H_