(Partial Update) Change damaged rect calcutation
[platform/core/uifw/dali-core.git] / dali / internal / update / common / property-condition-variable-step-functions.h
1 #ifndef DALI_INTERNAL_SCENE_GRAPH_PROPERTY_CONDITION_VARIABLE_STEP_FUNCTIONS_H
2 #define DALI_INTERNAL_SCENE_GRAPH_PROPERTY_CONDITION_VARIABLE_STEP_FUNCTIONS_H
3
4 /*
5  * Copyright (c) 2021 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/internal/update/common/scene-graph-property-notification.h>
23 #include <dali/public-api/object/property-value.h>
24
25 namespace Dali
26 {
27 namespace Internal
28 {
29 class Object;
30 class PropertyNotification;
31
32 namespace SceneGraph
33 {
34 /**
35  * VariableStep condition class,
36  * Uses a list of values, this condition notifies when the Property crosses between different values
37  *
38  * float      => value has stepped arg1 amount from arg0.
39  * Vector2    => 2 dimensional length of vector has stepped arg1 amount from arg0.
40  * Vector3    => 3 dimensional length of vector has stepped arg1 amount from arg0.
41  * Vector4    => 4 dimensional length of vector has stepped arg1 amount from arg0.
42  * Default    => return false.
43  */
44 class VariableStep
45 {
46 public:
47   /**
48    * @return function pointer to the correct condition function, based on
49    * the type of value being examined.
50    */
51   static ConditionFunction GetFunction(Property::Type valueType);
52
53 private:
54   /**
55    * Helper function used to evaluate our property
56    *
57    *
58    */
59   static bool Evaluate(const float propertyValue, PropertyNotification::RawArgumentContainer& arg);
60
61   /**
62    * Checks if integer is Outside
63    * @param[in] value The value being examined.
64    * @param[in] arg The supplied arguments for the condition.
65    * @return Condition result (true if condition met, false if not)
66    */
67   static bool EvalInteger(const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg);
68
69   /**
70    * Checks if float is Outside
71    * @param[in] value The value being examined.
72    * @param[in] arg The supplied arguments for the condition.
73    * @return Condition result (true if condition met, false if not)
74    */
75   static bool EvalFloat(const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg);
76
77   /**
78    * Checks if Vector2.Length() is Outside
79    * @param[in] value The value being examined.
80    * @param[in] arg The supplied arguments for the condition.
81    * @return Condition result (true if condition met, false if not)
82    */
83   static bool EvalVector2(const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg);
84
85   /**
86    * Checks if Vector3.Length() is Outside
87    * @param[in] value The value being examined.
88    * @param[in] arg The supplied arguments for the condition.
89    * @return Condition result (true if condition met, false if not)
90    */
91   static bool EvalVector3(const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg);
92
93   /**
94    * Checks if Vector4.Length() is Outside
95    * @param[in] value The value being examined.
96    * @param[in] arg The supplied arguments for the condition.
97    * @return Condition result (true if condition met, false if not)
98    */
99   static bool EvalVector4(const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg);
100
101   /**
102    * Default check for other types.
103    * @param[in] value The value being examined.
104    * @param[in] arg The supplied arguments for the condition.
105    * @return Condition result (true if condition met, false if not)
106    */
107   static bool EvalDefault(const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg);
108 };
109
110 } // namespace SceneGraph
111
112 } // namespace Internal
113
114 } // namespace Dali
115
116 #endif // DALI_INTERNAL_SCENE_GRAPH_PROPERTY_CONDITION_VARIABLE_STEP_FUNCTIONS_H