Merge "Unchecked GetCharacter func when index is over string length" into tizen_2.2
[platform/framework/native/uifw.git] / inc / FUiAnimBezierTimingFunction.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Apache License, Version 2.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://www.apache.org/licenses/LICENSE-2.0/
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        FUiAnimBezierTimingFunction.h
20  * @brief       This is the header file for the %BezierTimingFunction class.
21  *
22  * This header file contains the declarations of the %BezierTimingFunction class.
23  */
24
25 #ifndef _FUI_ANIM_BEZIER_TIMING_FUNCTION_H_
26 #define _FUI_ANIM_BEZIER_TIMING_FUNCTION_H_
27
28 #include <FUiAnimIVisualElementAnimationTimingFunction.h>
29
30 namespace Tizen { namespace Ui { namespace Animations
31 {
32
33 /**
34  * @class       BezierTimingFunction
35  * @brief       This class stores the information of a bezier curve timing function.
36  *
37  * @since       2.0
38  *
39  * @remarks     This class needs 2 control points of cubic bezier curve.
40  *
41  * The %BezierTimingFunction class provides bezier curve timing function related information.
42  *
43  * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/ui/timing_function.htm">Timing Function</a>.
44  *
45  */
46 class _OSP_EXPORT_ BezierTimingFunction
47         : public Tizen::Base::Object
48         , public IVisualElementAnimationTimingFunction
49 {
50 public:
51
52         /**
53          * This is the constructor for this class.
54          *
55          * @since       2.0
56          */
57         BezierTimingFunction(void);
58
59
60         /**
61          * This is the destructor for this class.
62          *
63          * @since       2.0
64          */
65         virtual ~BezierTimingFunction(void);
66
67
68         /**
69          * Calculates the progress(pace) of an animation regarding the time elapsed.
70          *
71          * @since       2.0
72          *
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.
77          */
78         virtual float CalculateProgress(float timeProgress) const;
79
80
81         /**
82          * Sets the control points.
83          *
84          * @since       2.0
85          *
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()
98          */
99         result SetControlPoints(float timeProgress1, float progress1, float timeProgress2, float progress2);
100
101
102         /**
103          * Gets the control points.
104          *
105          * @since               2.0
106          *
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()
118          */
119         result GetControlPoints(float& timeProgress1, float& progress1, float& timeProgress2, float& progress2) const;
120
121
122 private:
123
124         //
125         // This method is for internal use only. Using this method can cause behavioral, security-related,
126         // and consistency-related issues in the application.
127         //
128         // This is the assignment operator for this class.
129         //
130         // @since  2.0
131         //
132         BezierTimingFunction(const BezierTimingFunction& rhs);
133
134
135         //
136         // This method is for internal use only. Using this method can cause behavioral, security-related,
137         // and consistency-related issues in the application.
138         //
139         // Assigns the value of the specified instance to the current instance of %BezierTimingFunction.
140         //
141         // @since  2.0
142         //
143         BezierTimingFunction& operator =(const BezierTimingFunction& rhs);
144
145
146 private:
147
148         /**
149          * The time progress of control point 1.
150          *
151          * @since       2.0
152          */
153         float __timeProgress1;
154
155
156         /**
157          * The progress of control point 1.
158          *
159          * @since       2.0
160          */
161         float __progress1;
162
163
164         /**
165          * The time progress of control point 2.
166          *
167          * @since       2.0
168          */
169         float __timeProgress2;
170
171
172         /**
173          * The progress of control point 2.
174          *
175          * @since       2.0
176          */
177         float __progress2;
178
179
180         /**
181          * The coefficient A for calculating bezier curve.
182          *
183          * @since       2.0
184          */
185         float __coefficientA;
186
187
188         /**
189          * The coefficient B for calculating bezier curve.
190          *
191          * @since       2.0
192          */
193         float __coefficientB;
194
195
196         /**
197          * The coefficient C for calculating bezier curve.
198          *
199          * @since       2.0
200          */
201         float __coefficientC;
202 };              // BezierTimingFunction
203
204
205 }}}             // Tizen::Ui::Animations
206
207 #endif //_FUI_ANIM_BEZIER_TIMING_FUNCTION_H_