Updated CAPI documentation style.
[platform/core/uifw/dali-core.git] / capi / dali / public-api / animation / constraint-functions.h
1 #ifndef __DALI_CONSTRAINT_FUNCTIONS_H__
2 #define __DALI_CONSTRAINT_FUNCTIONS_H__
3
4 //
5 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
6 //
7 // Licensed under the Flora License, Version 1.0 (the License);
8 // you may not use this file except in compliance with the License.
9 // You may obtain a copy of the License at
10 //
11 //     http://floralicense.org/license/
12 //
13 // Unless required by applicable law or agreed to in writing, software
14 // distributed under the License is distributed on an AS IS BASIS,
15 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 // See the License for the specific language governing permissions and
17 // limitations under the License.
18 //
19
20 /**
21  * @addtogroup CAPI_DALI_ANIMATION_MODULE
22  * @{
23  */
24
25 // EXTERNAL INCLUDES
26 #include <boost/function.hpp>
27
28 namespace Dali
29 {
30
31 struct Vector3;
32 struct Vector4;
33 class Quaternion;
34
35 /**
36  * @brief Constraints can be used to adjust an Actor property, after animations have been applied.
37  *
38  * A local-constraint function is based on local properties of the Actor.
39  */
40 namespace LocalConstraint DALI_IMPORT_API
41 {
42
43 /**
44  * @brief A function which constrains a Vector3 property, based on the local properties of an Actor.
45  *
46  * @param[in] size     The actor's current size.
47  * @param[in] position The actor's current position.
48  * @param[in] scale    The actor's current rotation.
49  * @param[in] rotation The actor's current scale.
50  * @param[in] color    The actor's current color.
51  * @return The constrained property value.
52  */
53 typedef boost::function<Vector3 (const Vector3&    size,
54                                  const Vector3&    position,
55                                  const Quaternion& rotation,
56                                  const Vector3&    scale,
57                                  const Vector4&    color)> Vector3Function;
58
59 /**
60  * @brief A function which constrains a Vector4 property, based on the local properties of an Actor.
61  *
62  * @param[in] size     The actor's current size.
63  * @param[in] position The actor's current position.
64  * @param[in] scale    The actor's current rotation.
65  * @param[in] rotation The actor's current scale.
66  * @param[in] color    The actor's current color.
67  * @return The constrained property value.
68  */
69 typedef boost::function<Vector4 (const Vector3&    size,
70                                  const Vector3&    position,
71                                  const Quaternion& rotation,
72                                  const Vector3&    scale,
73                                  const Vector4&    color)> Vector4Function;
74
75 /**
76  * @brief A function which constrains a Quaternion property, based on the local properties of an Actor.
77  *
78  * @param[in] size     The actor's current size.
79  * @param[in] position The actor's current position.
80  * @param[in] scale    The actor's current rotation.
81  * @param[in] rotation The actor's current scale.
82  * @param[in] color    The actor's current color.
83  * @return The constrained property value.
84  */
85 typedef boost::function<Quaternion (const Vector3&    size,
86                                     const Vector3&    position,
87                                     const Quaternion& rotation,
88                                     const Vector3&    scale,
89                                     const Vector4&    color)> QuaternionFunction;
90
91 /**
92  * @brief A function which constrains a boolean property, based on the local properties of an Actor.
93  *
94  * @param[in] size     The actor's current size.
95  * @param[in] position The actor's current position.
96  * @param[in] scale    The actor's current rotation.
97  * @param[in] rotation The actor's current scale.
98  * @param[in] color    The actor's current color.
99  * @return The constrained property value.
100  */
101 typedef boost::function<bool (const Vector3&    size,
102                               const Vector3&    position,
103                               const Quaternion& rotation,
104                               const Vector3&    scale,
105                               const Vector4&    color)> BoolFunction;
106
107 } // LocalConstraint
108
109 /**
110  * @brief A parent-constraint function is based on properties related to the Actor's parent.
111  */
112 namespace ParentConstraint DALI_IMPORT_API
113 {
114
115 /**
116  * @brief A function which constrains a Vector3 property, based on properties related to the Actor's parent.
117  *
118  * @param[in] current The current value of the property to be constrained.
119  * @param[in] parentOrigin The actor's current parent-origin.
120  * @param[in] anchorPoint The actor's current anchor-point.
121  * @param[in] parentSize The parent's current size.
122  * @param[in] parentPosition The parent's current position.
123  * @param[in] parentRotation The parent's current rotation.
124  * @param[in] parentScale The parent's current scale.
125  * @return The constrained property value.
126  */
127 typedef boost::function<Vector3 (const Vector3&    current,
128                                  const Vector3&    parentOrigin,
129                                  const Vector3&    anchorPoint,
130                                  const Vector3&    parentSize,
131                                  const Vector3&    parentPosition,
132                                  const Quaternion& parentRotation,
133                                  const Vector3&    parentScale)> Vector3Function;
134
135 /**
136  * @brief A function which constrains a Vector4 property, based on properties related to the Actor's parent.
137  *
138  * @param[in] current The current value of the property to be constrained.
139  * @param[in] parentOrigin The actor's current parent-origin.
140  * @param[in] anchorPoint The actor's current anchor-point.
141  * @param[in] parentSize The parent's current size.
142  * @param[in] parentPosition The parent's current position.
143  * @param[in] parentRotation The parent's current rotation.
144  * @param[in] parentScale The parent's current scale.
145  * @return The constrained property value.
146  */
147 typedef boost::function<Vector4 (const Vector4&    current,
148                                  const Vector3&    parentOrigin,
149                                  const Vector3&    anchorPoint,
150                                  const Vector3&    parentSize,
151                                  const Vector3&    parentPosition,
152                                  const Quaternion& parentRotation,
153                                  const Vector3&    parentScale)> Vector4Function;
154
155 /**
156  * @brief A function which constrains a Quaternion property, based on properties related to the Actor's parent.
157  *
158  * @param[in] parentOrigin The actor's current parent-origin.
159  * @param[in] anchorPoint The actor's current anchor-point.
160  * @param[in] parentSize The parent's current size.
161  * @param[in] parentPosition The parent's current position.
162  * @param[in] parentRotation The parent's current rotation.
163  * @param[in] parentScale The parent's current scale.
164  * @return The constrained property value.
165  */
166 typedef boost::function<Quaternion (const Quaternion& current,
167                                     const Vector3&    parentOrigin,
168                                     const Vector3&    anchorPoint,
169                                     const Vector3&    parentSize,
170                                     const Vector3&    parentPosition,
171                                     const Quaternion& parentRotation,
172                                     const Vector3&    parentScale)> QuaternionFunction;
173
174 /**
175  * @brief A function which constrains a boolean property, based on properties related to the Actor's parent.
176  *
177  * @param[in] progress A progress value in the range 0->1, where 1 means that the constraint is fully applied.
178  * @param[in] parentOrigin The actor's current parent-origin.
179  * @param[in] anchorPoint The actor's current anchor-point.
180  * @param[in] parentSize The parent's current size.
181  * @param[in] parentPosition The parent's current position.
182  * @param[in] parentRotation The parent's current rotation.
183  * @param[in] parentScale The parent's current scale.
184  * @return The constrained property value.
185  */
186 typedef boost::function<bool (const bool&       current,
187                               const Vector3&    parentOrigin,
188                               const Vector3&    anchorPoint,
189                               const Vector3&    parentSize,
190                               const Vector3&    parentPosition,
191                               const Quaternion& parentRotation,
192                               const Vector3&    parentScale)> BoolFunction;
193
194 } // ParentConstraint
195
196 } // namespace Dali
197
198 /**
199  * @}
200  */
201 #endif // __DALI_CONSTRAINT_FUNCTIONS_H__