1 #ifndef DALI_INTERNAL_SCENE_GRAPH_PROPERTY_CONDITION_VARIABLE_STEP_FUNCTIONS_H
2 #define DALI_INTERNAL_SCENE_GRAPH_PROPERTY_CONDITION_VARIABLE_STEP_FUNCTIONS_H
5 * Copyright (c) 2019 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/object/property-value.h>
23 #include <dali/internal/update/common/scene-graph-property-notification.h>
32 class PropertyNotification;
38 * VariableStep condition class,
39 * Uses a list of values, this condition notifies when the Property crosses between different values
41 * float => value has stepped arg1 amount from arg0.
42 * Vector2 => 2 dimensional length of vector has stepped arg1 amount from arg0.
43 * Vector3 => 3 dimensional length of vector has stepped arg1 amount from arg0.
44 * Vector4 => 4 dimensional length of vector has stepped arg1 amount from arg0.
45 * Default => return false.
53 * @return function pointer to the correct condition function, based on
54 * the type of value being examined.
56 static ConditionFunction GetFunction( Property::Type valueType );
61 * Helper function used to evaluate our property
65 static bool Evaluate( const float propertyValue, PropertyNotification::RawArgumentContainer& arg );
68 * Checks if integer is Outside
69 * @param[in] value The value being examined.
70 * @param[in] arg The supplied arguments for the condition.
71 * @return Condition result (true if condition met, false if not)
73 static bool EvalInteger( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg );
76 * Checks if float is Outside
77 * @param[in] value The value being examined.
78 * @param[in] arg The supplied arguments for the condition.
79 * @return Condition result (true if condition met, false if not)
81 static bool EvalFloat( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg );
84 * Checks if Vector2.Length() is Outside
85 * @param[in] value The value being examined.
86 * @param[in] arg The supplied arguments for the condition.
87 * @return Condition result (true if condition met, false if not)
89 static bool EvalVector2( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg );
92 * Checks if Vector3.Length() is Outside
93 * @param[in] value The value being examined.
94 * @param[in] arg The supplied arguments for the condition.
95 * @return Condition result (true if condition met, false if not)
97 static bool EvalVector3( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg );
100 * Checks if Vector4.Length() is Outside
101 * @param[in] value The value being examined.
102 * @param[in] arg The supplied arguments for the condition.
103 * @return Condition result (true if condition met, false if not)
105 static bool EvalVector4( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg );
108 * Default check for other types.
109 * @param[in] value The value being examined.
110 * @param[in] arg The supplied arguments for the condition.
111 * @return Condition result (true if condition met, false if not)
113 static bool EvalDefault( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg );
117 } // namespace SceneGraph
119 } // namespace Internal
123 #endif // DALI_INTERNAL_SCENE_GRAPH_PROPERTY_CONDITION_VARIABLE_STEP_FUNCTIONS_H