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 FUiAnimBezierTimingFunction.h
20 * @brief This is the header file for the %BezierTimingFunction class.
22 * This header file contains the declarations of the %BezierTimingFunction class.
25 #ifndef _FUI_ANIM_BEZIER_TIMING_FUNCTION_H_
26 #define _FUI_ANIM_BEZIER_TIMING_FUNCTION_H_
28 #include <FUiAnimIVisualElementAnimationTimingFunction.h>
30 namespace Tizen { namespace Ui { namespace Animations
34 * @class BezierTimingFunction
35 * @brief This class stores the information of a bezier curve timing function.
39 * @remarks This class needs 2 control points of cubic bezier curve.
41 * The %BezierTimingFunction class provides bezier curve timing function related information.
43 * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/ui/timing_function.htm">Timing Function</a>.
46 class _OSP_EXPORT_ BezierTimingFunction
47 : public Tizen::Base::Object
48 , public IVisualElementAnimationTimingFunction
53 * This is the constructor for this class.
57 BezierTimingFunction(void);
61 * This is the destructor for this class.
65 virtual ~BezierTimingFunction(void);
69 * Calculates the progress(pace) of an animation regarding the time elapsed.
73 * @return The progress(pace) value calculated by bezier equation with control points @n
74 * @c 0 and @c 1 are the start and end values of an animation, respectively.
75 * @param[in] timeProgress The time progress value @n
76 * This must be in the range @c 0.0 to @c 1.0.
78 virtual float CalculateProgress(float timeProgress) const;
82 * Sets the control points.
86 * @return An error code
87 * @param[in] timeProgress1 The time progress of control point 1 @n
88 * This must be in the range @c 0.0 to @c 1.0.
89 * @param[in] progress1 The progress of control point 1 @n
90 * This must be in the range @c 0.0 to @c 1.0.
91 * @param[in] timeProgress2 The time progress of control point 2 @n
92 * This must be in the range @c 0.0 to @c 1.0.
93 * @param[in] progress2 The progress of control point 2 @n
94 * This must be in the range @c 0.0 to @c 1.0.
95 * @exception E_SUCCESS The method is successful.
96 * @exception E_INVALID_ARG The value of the specified parameter is less than @c 0 or greater than @c 1.
97 * @see GetControlPoints()
99 result SetControlPoints(float timeProgress1, float progress1, float timeProgress2, float progress2);
103 * Gets the control points.
107 * @return An error code
108 * @param[out] timeProgress1 The time progress of control point 1 @n
109 * The default value is @c 0.33f.
110 * @param[out] progress1 The progress of control point 1 @n
111 * The default value is @c 0.8f.
112 * @param[out] timeProgress2 The time progress of control point 2 @n
113 * The default value is @c 0.66f.
114 * @param[out] progress2 The progress of control point 2 @n
115 * The default value is @c 0.2f.
116 * @exception E_SUCCESS The method is successful.
117 * @see SetControlPoints()
119 result GetControlPoints(float& timeProgress1, float& progress1, float& timeProgress2, float& progress2) const;
125 // This method is for internal use only. Using this method can cause behavioral, security-related,
126 // and consistency-related issues in the application.
128 // This is the assignment operator for this class.
132 BezierTimingFunction(const BezierTimingFunction& rhs);
136 // This method is for internal use only. Using this method can cause behavioral, security-related,
137 // and consistency-related issues in the application.
139 // Assigns the value of the specified instance to the current instance of %BezierTimingFunction.
143 BezierTimingFunction& operator =(const BezierTimingFunction& rhs);
149 * The time progress of control point 1.
153 float __timeProgress1;
157 * The progress of control point 1.
165 * The time progress of control point 2.
169 float __timeProgress2;
173 * The progress of control point 2.
181 * The coefficient A for calculating bezier curve.
185 float __coefficientA;
189 * The coefficient B for calculating bezier curve.
193 float __coefficientB;
197 * The coefficient C for calculating bezier curve.
201 float __coefficientC;
202 }; // BezierTimingFunction
205 }}} // Tizen::Ui::Animations
207 #endif //_FUI_ANIM_BEZIER_TIMING_FUNCTION_H_