Fix to adjust the position of the partial Frame
[platform/framework/native/uifw.git] / inc / FUiAnimRotateAnimation.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
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
8 //
9 //     http://floralicense.org/license/
10 //
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.
16 //
17
18 /**
19  * @file        FUiAnimRotateAnimation.h
20  * @brief       This is the header file for the %RotateAnimation class.
21  *
22  * This header file contains the declarations of the %RotateAnimation class.
23  */
24
25 #ifndef _FUI_ANIM_ROTATE_ANIMATION_H_
26 #define _FUI_ANIM_ROTATE_ANIMATION_H_
27
28 #include <FUiAnimFloatAnimation.h>
29
30
31 namespace Tizen { namespace Ui { namespace Animations
32 {
33
34
35 /**
36  * @class       RotateAnimation
37  * @brief       This class animates between two angle values.
38  *
39  * @since       2.0
40  *
41  * @final   This class is not intended for extension.
42  *
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.
45  *
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>.
47  */
48 class _OSP_EXPORT_ RotateAnimation
49         : public FloatAnimation
50 {
51 public:
52
53         /**
54          * Initializes this instance of %RotateAnimation with the specified parameters.
55          *
56          * @since               2.0
57          *
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.
69          */
70         RotateAnimation(float startValue, float endValue, long duration, AnimationInterpolatorType interpolator);
71
72
73         /**
74          * This is the destructor for this class.
75          *
76          * @since       2.0
77          */
78         virtual ~RotateAnimation(void);
79
80
81         /**
82          * This is the copy constructor for the %RotateAnimation class.
83          *
84          * @since               2.0
85          *
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.
90          */
91         RotateAnimation(const RotateAnimation& rotateAnimation);
92
93
94         /**
95          * Assigns the value of the specified instance to the current instance of %RotateAnimation.
96          *
97          * @since               2.0
98          *
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.
103          */
104         RotateAnimation& operator =(const RotateAnimation& rhs);
105
106
107         /**
108          * Checks whether the specified instance and the current instance of %RotateAnimation have equal animation values.
109          *
110          * @since               2.0
111          *
112          * @return              @c true if the animation of the two instances of %RotateAnimation have equal values, @n
113          *                              else @c false
114          * @param[in]   rhs             An instance of %RotateAnimation
115          */
116         bool operator ==(const RotateAnimation& rhs) const;
117
118
119         /**
120          * Checks whether the specified instance and the current instance of %RotateAnimation have different animation values.
121          *
122          * @since       2.0
123          *
124          * @return              @c true if the values of the animations of the two instances of %RotateAnimation are not equal, @n
125          *                              else @c false
126          * @param[in]   rhs             An instance of %RotateAnimation
127          */
128         bool operator !=(const RotateAnimation& rhs) const;
129
130
131         /**
132          * Checks whether the value of the current instance of %RotateAnimation is equal to the value of the specified instance.
133          *
134          * @since       2.0
135          *
136          * @return              @c true if the value of the current instance is equal to the value of the specified instance, @n
137          *                              else @c false
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.
140          */
141         virtual bool Equals(const Tizen::Base::Object& obj) const;
142
143
144         /**
145          * Gets the hash value of the current instance.
146          *
147          * @since       2.0
148          *
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.
152          */
153         virtual int GetHashCode(void) const;
154
155
156         /**
157          * Sets the anchor points for the animation.
158          *
159          * @since       2.0
160          *
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.
171          */
172         result SetAnchor(float anchorX, float anchorY);
173
174
175         /**
176          * Gets the anchor point associated with the animation. @n
177          * The default anchor point is (0.5, 0.5).
178          *
179          * @since       2.0
180          *
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.
185          */
186         void GetAnchor(float& anchorX, float& anchorY) const;
187
188
189         /**
190          * Gets the type information of this instance.
191          *
192          * @since       2.0
193          *
194          * @return  The type information of this instance
195          */
196         virtual AnimationType GetType(void) const;
197
198
199 protected:
200
201         friend class _RotateAnimationImpl;
202
203
204         //
205         // This variable is for internal use only. Using this variable can cause behavioral, security-related,
206         // and consistency-related issues in the application.
207         //
208         // This variable is for internal usage.
209         //
210         // @since        2.0
211         //
212         class _RotateAnimationImpl* _pRotateAnimationImpl;
213
214
215 private:
216
217         //
218         // This method is for internal use only. Using this method can cause behavioral, security-related,
219         // and consistency-related issues in the application.
220         //
221         // This is the default constructor for this class.
222         //
223         // @since        2.0
224         //
225         RotateAnimation(void);
226 };              // RotateAnimation
227
228
229 }}}             // Tizen::Ui::Animations
230
231 #endif  // _FUI_ANIM_ROTATE_ANIMATION_H_