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 FUiAnimFrameAnimator.h
20 * @brief This is the header file for the %FrameAnimator class.
22 * This header file contains the declarations of the %FrameAnimator class.
25 #ifndef _FUI_ANIM_FRAME_ANIMATOR_H_
26 #define _FUI_ANIM_FRAME_ANIMATOR_H_
28 #include <FUiAnimIFrameAnimatorEventListener.h>
31 namespace Tizen { namespace Ui { namespace Controls
37 namespace Tizen { namespace Ui { namespace Animations
42 * @class FrameAnimator
43 * @brief This class defines the animation methods for Frame.
47 * @final This class is not intended for extension.
49 * The %FrameAnimator class is used to control the animations operated on a Frame.
51 * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/ui/animating_formstransition.htm">Animating a Form Transition</a>.
54 class _OSP_EXPORT_ FrameAnimator
55 : public Tizen::Base::Object
60 * This is the destructor for this class.
64 virtual ~FrameAnimator(void);
68 * Adds an IFrameAnimatorEventListener instance to the current instance of the frame. @n
69 * The added listener can listen to events on the given event dispatcher's context when they are fired.
73 * @return An error code
74 * @param[in] listener The listener to add
75 * @exception E_SUCCESS The method is successful.
76 * @exception E_UNSUPPORTED_OPERATION The animation support is unavailable.
77 * @exception E_OBJ_ALREADY_EXIST The specified @c listener is already added.
78 * @exception E_SYSTEM A system error has occurred.
80 result AddFrameAnimatorEventListener(IFrameAnimatorEventListener& listener);
84 * Removes an IFrameAnimatorEventListener instance from the current instance of the frame. @n
85 * The removed listener cannot listen to events when they are fired.
89 * @return An error code
90 * @param[in] listener The listener to remove
91 * @exception E_SUCCESS The method is successful.
92 * @exception E_UNSUPPORTED_OPERATION The animation support is unavailable.
93 * @exception E_OBJ_NOT_FOUND The specified @c listener is not found.
94 * @exception E_SYSTEM A system error has occurred.
96 result RemoveFrameAnimatorEventListener(IFrameAnimatorEventListener& listener);
100 * Gets the animation status of the frame animator.
104 * @return The animation state of the frame animator
106 AnimatorStatus GetStatus(void) const;
110 * Sets the specified form as the current form of the frame with an animation.
114 * @return An error code
115 * @param[in] form The form object to set
116 * @exception E_SUCCESS The method is successful.
117 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation.
118 * @exception E_SYSTEM A system error has occurred.
119 * @remarks Control::Invalidate() need not be called to display the form. @n
120 * To select the animation to be used during this method, use SetFormTransitionAnimation() before calling this method.
122 result SetCurrentForm(const Tizen::Ui::Controls::Form& form);
125 * Sets the specified form as the current form of the frame with an animation.
129 * @return An error code
130 * @param[in] pForm A pointer to form object to set.
131 * @exception E_SUCCESS The method is successful.
132 * @exception E_INVALID_ARG The specified @c pForm is @c null.
133 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation.
134 * @exception E_SYSTEM A system error has occurred.
135 * @remarks Control::Invalidate() need not be called to display the form. @n
136 * To select the animation to be used during this method, use SetFormTransitionAnimation() before calling this method.
138 result SetCurrentForm(Tizen::Ui::Controls::Form* pForm);
142 * Sets the type of the form transition animation.
146 * @param[in] animation The type of form transition animation to set
147 * @param[in] duration The duration of animation in milliseconds @n
148 * The maximum duration is one second.
149 * @param[in] interpolator The type of interpolator used for the intermediate value calculation of the animation
151 void SetFormTransitionAnimation(FrameAnimatorFormTransitionAnimation animation, long duration, AnimationInterpolatorType interpolator);
155 * Gets the type of the form transition animation.
159 * @param[out] animation The type of form transition animation used
160 * @param[out] duration The duration of animation in milliseconds
161 * @param[out] interpolator The type of interpolator used for the intermediate value calculation of the animation
163 void GetFormTransitionAnimation(FrameAnimatorFormTransitionAnimation& animation, long& duration, AnimationInterpolatorType& interpolator) const;
167 * Sets the control points for the Bezier interpolator. @n
168 * The %SetFormTransitionBezierControlPoints() method is supported only if the interpolator is @c ANIMATION_INTERPOLATOR_BEZIER.
172 * @return An error code
173 * @param[in] time1 The control point 1 - Time @n
174 * The time must be within the range @c 0.0 to @c 1.0.
175 * @param[in] value1 The control point 1 - Value @n
176 * The value must be within the range @c 0.0 to @c 1.0.
177 * @param[in] time2 The control point 2 - Time @n
178 * The time must be within the range @c 0.0 to @c 1.0.
179 * @param[in] value2 The control point 2 - Value @n
180 * The value must be within the range @c 0.0 to @c 1.0.
181 * @exception E_SUCCESS The method is successful.
182 * @exception E_INVALID_OPERATION The interpolator of this instance is not ANIMATION_INTERPOLATOR_BEZIER.
183 * @exception E_INVALID_ARG A specified input parameter is invalid.
185 result SetFormTransitionBezierControlPoints(float time1, float value1, float time2, float value2);
189 * Gets the control points of the Bezier interpolator. @n
190 * The %GetFormTransitionBezierControlPoints() method is supported only if the interpolator is @c ANIMATION_INTERPOLATOR_BEZIER. @n
191 * Therefore, @c 0 will be returned for other interpolators.
195 * @return An error code
196 * @param[out] time1 The control point 1 - Time
197 * @param[out] value1 The control point 1 - Value
198 * @param[out] time2 The control point 2 - Time
199 * @param[out] value2 The control point 2 - Value
200 * @exception E_SUCCESS The method is successful.
201 * @exception E_INVALID_OPERATION The interpolator of this instance is not ANIMATION_INTERPOLATOR_BEZIER.
203 result GetFormTransitionBezierControlPoints(float& time1, float& value1, float& time2, float& value2) const;
207 * Stops all the animations that are being played and jumps to the final frame of the animation.
211 * @return An error code
212 * @exception E_SUCCESS The method is successful.
213 * @exception E_SYSTEM A system error has occurred.
215 result StopAllAnimations(void);
220 friend class _FrameAnimatorImpl;
224 // This variable is for internal use only. Using this variable can cause behavioral, security-related,
225 // and consistency-related issues in the application.
227 // The variable for internal usage.
231 class _FrameAnimatorImpl* _pFrameAnimatorImpl;
237 // This method is for internal use only. Using this method can cause behavioral, security-related,
238 // and consistency-related issues in the application.
240 // This is the constructor for this class.
248 // This method is for internal use only. Using this method can cause behavioral, security-related,
249 // and consistency-related issues in the application.
251 // Initializes this class.
254 // @return An error code
255 // @param[in] source An instance of the Frame class
256 // @exception E_SUCCESS The method is successful.
257 // @exception E_SYSTEM A system error has occurred.
259 result Construct(const Tizen::Ui::Controls::Frame& source);
263 // This method is for internal use only. Using this method can cause behavioral, security-related,
264 // and consistency-related issues in the application.
266 // This is the copy constructor for the %FrameAnimator class.
270 FrameAnimator(const FrameAnimator& rhs);
274 // This method is for internal use only. Using this method can cause behavioral, security-related,
275 // and consistency-related issues in the application.
277 // Assigns the value of the specified instance to the current instance of %FrameAnimator.
281 FrameAnimator& operator =(const FrameAnimator& rhs);
284 friend class Tizen::Ui::Controls::_FrameImpl;
288 }}} // Tizen::Ui::Animations
290 #endif //_FUI_ANIM_FRAME_ANIMATOR_H_