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 FUiAnimVisualElementValueAnimation.h
20 * @brief This is the header file for the %VisualElementValueAnimation class.
22 * This header file contains the declarations of the %VisualElementValueAnimation class.
25 #ifndef _FUI_ANIM_VISUAL_ELEMENT_VALUE_ANIMATION_H_
26 #define _FUI_ANIM_VISUAL_ELEMENT_VALUE_ANIMATION_H_
28 #include <FUiVariant.h>
29 #include <FUiAnimVisualElementAnimation.h>
31 namespace Tizen { namespace Ui { namespace Animations
35 class IVisualElementAnimationTickEventListener;
36 class _VisualElementValueAnimationImpl;
39 * @class VisualElementValueAnimation
40 * @brief This class is for value animation.
44 * The %VisualElementValueAnimation class defines the basic value animation.
46 class _OSP_EXPORT_ VisualElementValueAnimation
47 : public VisualElementAnimation
52 * This is the default constructor for this class.
56 * @exception E_SUCCESS The method is successful.
57 * @exception E_OUT_OF_MEMORY The memory is insufficient.
58 * @remarks The specific error code can be accessed using the GetLastResult() method.
60 VisualElementValueAnimation(void);
64 * This is the destructor for this class.
68 virtual ~VisualElementValueAnimation(void);
72 * This is the copy constructor for the %VisualElementValueAnimation class.
76 * @param[in] animation An instance of %VisualElementValueAnimation
77 * @exception E_SUCCESS The method is successful.
78 * @exception E_OUT_OF_MEMORY The memory is insufficient.
79 * @remarks The specific error code can be accessed using the GetLastResult() method.
81 VisualElementValueAnimation(const VisualElementValueAnimation& animation);
85 * Assigns the value of the specified instance to the current instance of %VisualElementValueAnimation.
89 * @param[in] rhs An instance of %VisualElementValueAnimation
90 * @exception E_SUCCESS The method is successful.
91 * @exception E_OUT_OF_MEMORY The memory is insufficient.
92 * @remarks The specific error code can be accessed using the GetLastResult() method.
94 VisualElementValueAnimation& operator =(const VisualElementValueAnimation& rhs);
98 * Checks whether the specified instance and current instance of %VisualElementValueAnimation have equal animation values.
102 * @return @c true if the animation of the two instances of %VisualElementValueAnimation are equal, @n
104 * @param[in] rhs An instance of %VisualElementValueAnimation
106 bool operator ==(const VisualElementValueAnimation& rhs) const;
110 * Checks whether the specified instance and current instance of %VisualElementValueAnimation have different animation values.
114 * @return @c true if the values of the animations of the two instances of %VisualElementValueAnimation are not equal, @n
116 * @param[in] rhs An instance of %VisualElementValueAnimation
118 bool operator !=(const VisualElementValueAnimation& rhs) const;
122 * Checks whether the value of the current instance of %VisualElementValueAnimation equals the value of the specified instance.
126 * @return @c true if the value of the current instance equals the value of the specified instance, @n
128 * @param[in] obj An instance of %VisualElementValueAnimation
129 * @remarks The %VisualElementValueAnimation class has a semantic value which means that this method checks whether the two instances have the same animation.
131 virtual bool Equals(const Tizen::Base::Object& obj) const;
135 * Gets the hash value of the current instance.
139 * @return The hash value of the current instance
140 * @remarks The two equal instances must return the same hash value.
141 * For better performance, the used hash function must generate a random distribution for all inputs.
143 virtual int GetHashCode(void) const;
147 * Gets the copied instance of the class.
151 * @return An instance of %VisualElementAnimation
152 * @exception E_SUCCESS The method is successful.
153 * @exception E_OUT_OF_MEMORY The memory is insufficient.
154 * @remarks The specific error code can be accessed using the GetLastResult() method.
156 virtual VisualElementAnimation* CloneN(void) const;
160 * Sets an IVisualElementAnimationTickEventListener listener instance to listen to the events of a particular animation. @n
161 * The set listener, %IVisualElementAnimationTickEventListener, can listen to events on the specified event dispatcher's context when they are fired.
165 * @param[in] pListener The listener to set
167 void SetVisualElementAnimationTickEventListener(IVisualElementAnimationTickEventListener* pListener);
171 * Gets the IVisualElementAnimationTickEventListener listener.
175 * @return A pointer to the IVisualElementAnimationTickEventListener instance @n
176 * If listener has not been set, @c null is returned.
177 * @see SetVisualElementAnimationTickEventListener()
179 IVisualElementAnimationTickEventListener* GetVisualElementAnimationTickEventListener(void) const;
183 * Sets the start value of the animation.
187 * @return An error code
188 * @param[in] startValue The start value of the animation to set
189 * @exception E_SUCCESS The method is successful.
190 * @exception E_INVALID_ARG The type of Variant is empty.
191 * @see GetStartValue()
193 result SetStartValue(const Tizen::Ui::Variant& startValue);
197 * Gets the start value of the animation.
201 * @return The start value of animation
202 * @see SetStartValue()
204 Tizen::Ui::Variant GetStartValue(void) const;
208 * Sets the end value of the animation.
212 * @return An error code
213 * @param[in] endValue The end value of the animation to set
214 * @exception E_SUCCESS The method is successful.
215 * @exception E_INVALID_ARG The type of Variant is empty.
218 result SetEndValue(const Tizen::Ui::Variant& endValue);
222 * Gets the end value of the animation.
226 * @return The end value of animation
229 Tizen::Ui::Variant GetEndValue(void) const;
233 * Sets the flag to apply the end value of the animation when the animation is finished.
237 * @param[in] apply Set to @c true to apply the end values of the animation, @n
239 * @remarks There is no difference in behavior with this method in value animation. @n
240 * So you must set the end value by seeing this value.
241 * @see IsEndValueApplied()
243 void SetEndValueApplied(bool apply);
247 * Checks whether the end value of the animation is applied when the animation is finished.
251 * @return @c true if the end value is applied, @n
253 * The default value is @c true.
254 * @see SetEndValueApplied()
256 bool IsEndValueApplied(void) const;
260 * Adds the key frame information for the animation.
264 * @return An error code
265 * @param[in] timeProgress The specified time progress value @n
266 * This must be in the range @c 0.0 to @c 1.0 and cannot be @c 0.0 and @c 1.0.
267 * @param[in] value The value at the specified time
268 * @param[in] pTimingFunction The timing function instance that is used in keyframe segment
269 * @exception E_SUCCESS The method is successful.
270 * @exception E_INVALID_ARG The specified @c value parameter is invalid.
271 * @exception E_OUT_OF_RANGE The specified @c timeProgress is not within the range @c 0 to @c 1 (exclusive).
272 * @remarks If a key-value pair with the current key already exists, the old value is overwritten with the new one.
273 * If timing function is @c null, the default timing function is applied.
274 * The timing function is applied to current pace from previous pace.
275 * @see RemoveKeyFrame()
276 * @see RemoveAllKeyFrames()
278 result AddKeyFrame(float timeProgress, const Tizen::Ui::Variant& value, const IVisualElementAnimationTimingFunction* pTimingFunction = null);
282 * Removes the key frame information for the animation.
286 * @return An error code
287 * @param[in] timeProgress The time progress for the key frame to remove
288 * This must be in the range @c 0.0 to @c 1.0 and cannot be @c 0.0 and @c 1.0.
289 * @exception E_SUCCESS The method is successful.
290 * @exception E_OUT_OF_RANGE The value of the specified parameter is not within the range @c 0 to @c 1 (exclusive).
291 * @exception E_OBJ_NOT_FOUND The key frame with @c timeProgress does not exist.
293 * @see RemoveAllKeyFrames()
295 result RemoveKeyFrame(float timeProgress);
299 * Removes all the key frame information for the animation.
304 * @see RemoveKeyFrame()
306 void RemoveAllKeyFrames(void);
312 // This variable is for internal use only. Using this variable can cause behavioral, security-related,
313 // and consistency-related issues in the application.
315 // This is the constructor for derived classes.
319 VisualElementValueAnimation(_VisualElementValueAnimationImpl* pImpl);
322 friend class _VisualElementValueAnimationImpl;
323 }; // VisualElementValueAnimation
326 }}} // Tizen::Ui::Animations
328 #endif // _FUI_ANIM_VISUAL_ELEMENT_VALUE_ANIMATION_H_