[3.0] Update doxygen comments
[platform/core/uifw/dali-core.git] / dali / public-api / object / property-conditions.h
1 #ifndef __DALI_PROPERTY_CONDITIONS_H__
2 #define __DALI_PROPERTY_CONDITIONS_H__
3
4 /*
5  * Copyright (c) 2015 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.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://www.apache.org/licenses/LICENSE-2.0
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 // INTERNAL INCLUDES
22 #include <dali/public-api/common/dali-vector.h>
23 #include <dali/public-api/object/base-handle.h>
24 #include <dali/public-api/object/property.h>
25
26 namespace Dali
27 {
28 /**
29  * @addtogroup dali_core_object
30  * @{
31  */
32
33 namespace Internal DALI_INTERNAL
34 {
35 class PropertyCondition;
36 }
37
38 /**
39  * @brief This represents a condition that can be evaluated on a Property::Value.
40  * @SINCE_1_0.0
41  */
42 class DALI_IMPORT_API PropertyCondition : public BaseHandle
43 {
44 public:
45
46   /**
47    * @brief Constructor for condition clause.
48    * @SINCE_1_0.0
49    */
50   PropertyCondition();
51
52   /**
53    * @brief Destructor.
54    * @SINCE_1_0.0
55    */
56   ~PropertyCondition();
57
58   /**
59    * @brief This copy constructor is required for (smart) pointer semantics.
60    *
61    * @SINCE_1_0.0
62    * @param[in] handle A reference to the copied handle
63    */
64   PropertyCondition( const PropertyCondition& handle );
65
66   /**
67    * @brief This assignment operator is required for (smart) pointer semantics.
68    *
69    * @SINCE_1_0.0
70    * @param[in] rhs A reference to the copied handle
71    * @return A reference to this
72    */
73   PropertyCondition& operator=( const PropertyCondition& rhs );
74
75 public:
76
77   /**
78    * @brief Retrieves the arguments that this condition uses.
79    *
80    * @SINCE_1_0.0
81    * @return The arguments used for this condition
82    */
83   std::size_t GetArgumentCount() const;
84
85   /**
86    * @brief Retrieves the arguments that this condition uses.
87    *
88    * @SINCE_1_0.0
89    * @param[in] index The condition index to get the argument
90    * @return The arguments used for this condition
91    * @note The container will only be valid as long PropertyCondition is valid.
92    */
93   float GetArgument( std::size_t index ) const;
94
95 };
96
97 /**
98  * @brief LessThanCondition compares whether property is less than arg.
99  *
100  * property type:
101  * bool (false = 0.0f, true = 1.0f)
102  * float (float)
103  * vector2 (the 2D length)
104  * vector3 (the 3D length)
105  * vector4 (the 4D length)
106  * @SINCE_1_0.0
107  * @param[in] arg The argument for the condition
108  * @return A property condition function object
109  */
110 DALI_IMPORT_API PropertyCondition LessThanCondition( float arg );
111
112 /**
113  * @brief GreaterThanCondition compares whether property is greater than arg.
114  *
115  * property type:
116  * bool (false = 0.0f, true = 1.0f)
117  * float (float)
118  * vector2 (the 2D length)
119  * vector3 (the 3D length)
120  * vector4 (the 4D length)
121  * @SINCE_1_0.0
122  * @param[in] arg The argument for the condition
123  * @return A property condition function object
124  */
125 DALI_IMPORT_API PropertyCondition GreaterThanCondition( float arg );
126
127 /**
128  * @brief InsideCondition compares whether property is greater than arg0 and less than arg1.
129  *
130  * property type:
131  * bool (false = 0.0f, true = 1.0f)
132  * float (float)
133  * vector2 (the 2D length)
134  * vector3 (the 3D length)
135  * vector4 (the 4D length)
136  * @SINCE_1_0.0
137  * @param[in] arg0 The first argument for the condition
138  * @param[in] arg1 The second argument for the condition
139  * @return A property condition function object
140  */
141 DALI_IMPORT_API PropertyCondition InsideCondition( float arg0, float arg1 );
142
143 /**
144  * @brief OutsideCondition compares whether property is less than arg0 or greater than arg1.
145  *
146  * property type:
147  * bool (false = 0.0f, true = 1.0f)
148  * float (float)
149  * vector2 (the 2D length)
150  * vector3 (the 3D length)
151  * vector4 (the 4D length)
152  * @SINCE_1_0.0
153  * @param[in] arg0 The first argument for the condition
154  * @param[in] arg1 The second argument for the condition
155  * @return A property condition function object
156  */
157 DALI_IMPORT_API PropertyCondition OutsideCondition( float arg0, float arg1 );
158
159 /**
160  * @brief Detects when a property changes by stepAmount from initialValue, in both positive and negative directions. This will continue checking for multiples of stepAmount.
161  *
162  * property type:
163  * float (float)
164  * vector2 (the 2D length)
165  * vector3 (the 3D length)
166  * vector4 (the 4D length)
167  * @SINCE_1_0.0
168  * @param[in] stepAmount The step size required to trigger condition
169  * @param[in] initialValue The initial value to step from
170  * @return A property condition function object
171  */
172 DALI_IMPORT_API PropertyCondition StepCondition( float stepAmount, float initialValue = 0.0f );
173
174 /**
175  * @brief Receives notifications as a property goes above/below the inputted values. Values must be ordered and can be either ascending or descending.
176  *
177  * property type:
178  * float (float)
179  * vector2 (the 2D length)
180  * vector3 (the 3D length)
181  * vector4 (the 4D length)
182  * @SINCE_1_0.0
183  * @param[in] steps List of values to receive notifications for as a property crosses them
184  * @return A property condition function object
185  */
186 DALI_IMPORT_API PropertyCondition VariableStepCondition( const Dali::Vector<float>& steps );
187
188 /**
189  * @}
190  */
191 } // namespace Dali
192
193 #endif // __DALI_PROPERTY_CONDITIONS_H__