1 #ifndef __DALI_PROPERTY_CONDITIONS_H__
2 #define __DALI_PROPERTY_CONDITIONS_H__
5 * Copyright (c) 2015 Samsung Electronics Co., Ltd.
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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.
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>
29 * @addtogroup dali_core_object
33 namespace Internal DALI_INTERNAL
35 class PropertyCondition;
39 * @brief This represents a condition that can be evaluated on a Property::Value.
42 class DALI_IMPORT_API PropertyCondition : public BaseHandle
47 * @brief Constructor for condition clause.
59 * @brief This copy constructor is required for (smart) pointer semantics.
62 * @param [in] handle A reference to the copied handle
64 PropertyCondition( const PropertyCondition& handle );
67 * @brief This assignment operator is required for (smart) pointer semantics.
70 * @param [in] rhs A reference to the copied handle
71 * @return A reference to this
73 PropertyCondition& operator=( const PropertyCondition& rhs );
78 * @brief Retrieve the arguments that this condition uses.
81 * @return The arguments used for this condition
83 std::size_t GetArgumentCount() const;
86 * @brief Retrieve the arguments that this condition uses.
89 * @return The arguments used for this condition
90 * @note The container will only be valid as long PropertyCondition is valid.
92 float GetArgument( std::size_t index ) const;
97 * @brief LessThanCondition compares whether property is less than arg.
100 * bool (false = 0.0f, true = 1.0f)
102 * vector2 (the 2D length)
103 * vector3 (the 3D length)
104 * vector4 (the 4D length)
106 * @param[in] arg The argument for the condition
107 * @return A property condition function object
109 DALI_IMPORT_API PropertyCondition LessThanCondition( float arg );
112 * @brief GreaterThanCondition compares whether property is greater than arg.
115 * bool (false = 0.0f, true = 1.0f)
117 * vector2 (the 2D length)
118 * vector3 (the 3D length)
119 * vector4 (the 4D length)
121 * @param[in] arg The argument for the condition
122 * @return A property condition function object
124 DALI_IMPORT_API PropertyCondition GreaterThanCondition( float arg );
127 * @brief InsideCondition compares whether property is greater than arg0 and less than arg1.
130 * bool (false = 0.0f, true = 1.0f)
132 * vector2 (the 2D length)
133 * vector3 (the 3D length)
134 * vector4 (the 4D length)
136 * @param[in] arg0 The first argument for the condition
137 * @param[in] arg1 The second argument for the condition
138 * @return A property condition function object
140 DALI_IMPORT_API PropertyCondition InsideCondition( float arg0, float arg1 );
143 * @brief OutsideCondition compares whether property is less than arg0 or greater than arg1.
146 * bool (false = 0.0f, true = 1.0f)
148 * vector2 (the 2D length)
149 * vector3 (the 3D length)
150 * vector4 (the 4D length)
152 * @param[in] arg0 The first argument for the condition
153 * @param[in] arg1 The second argument for the condition
154 * @return A property condition function object
156 DALI_IMPORT_API PropertyCondition OutsideCondition( float arg0, float arg1 );
159 * @brief Detects when a property changes by stepAmount from initialValue, in both positive and negative directions. This will continue checking for multiples of stepAmount
163 * vector2 (the 2D length)
164 * vector3 (the 3D length)
165 * vector4 (the 4D length)
167 * @param[in] stepAmount The step size required to trigger condition
168 * @param[in] initialValue The initial value to step from
169 * @return A property condition function object
171 DALI_IMPORT_API PropertyCondition StepCondition( float stepAmount, float initialValue = 0.0f );
174 * @brief Receive notifications as a property goes above/below the inputted values. Values must be ordered and can be either ascending or descending
178 * vector2 (the 2D length)
179 * vector3 (the 3D length)
180 * vector4 (the 4D length)
182 * @param[in] steps List of values to receive notifications for as a property crosses them
183 * @return A property condition function object
185 DALI_IMPORT_API PropertyCondition VariableStepCondition( const Dali::Vector<float>& steps );
192 #endif // __DALI_PROPERTY_CONDITIONS_H__