[Tizen] Add InterceptKeyEvent
[platform/core/uifw/dali-core.git] / dali / internal / event / common / property-conditions-impl.h
1 #ifndef DALI_INTERNAL_PROPERTY_CONDITIONS_H
2 #define DALI_INTERNAL_PROPERTY_CONDITIONS_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/public-api/common/dali-common.h>
23 #include <dali/public-api/object/base-object.h>
24 #include <dali/public-api/object/property-conditions.h>
25 #include <dali/public-api/object/property-value.h>
26
27 namespace Dali
28 {
29 namespace Internal
30 {
31 /**
32  * Structure to contain PropertyCondition internal data
33  */
34
35 class PropertyCondition : public Dali::BaseObject
36 {
37 public:
38   /**
39    * Condition types.
40    */
41   enum Type
42   {
43     False,       ///< Result Always False
44     LessThan,    ///< Magnitude of type is less than float value (arg0).
45     GreaterThan, ///< Magnitude of type is greater than float value (arg0).
46     Inside,      ///< Magnitude of type is within float values (arg0 & arg1).
47     Outside,     ///< Magnitude of type is outside float values (arg0 & arg1).
48     Step,        ///< Value of type has crossed a step amount
49     VariableStep ///< Similar to step, except user can define a list of steps from reference value
50   };
51
52   /**
53    * Constructor
54    */
55   PropertyCondition();
56
57   /**
58    * Virtual destructor
59    */
60   ~PropertyCondition() override;
61
62 private:
63   // Not implemented
64   PropertyCondition(const PropertyCondition& rhs);
65
66   // Not implemented
67   PropertyCondition& operator=(const PropertyCondition& rhs);
68
69 public:
70   Type                type;      ///< The condition Type.
71   Dali::Vector<float> arguments; ///< The condition Arguments.
72 };
73
74 } // namespace Internal
75
76 // Helpers for public-api forwarding methods
77
78 inline Internal::PropertyCondition& GetImplementation(Dali::PropertyCondition& pub)
79 {
80   DALI_ASSERT_ALWAYS(pub && "PropertyCondition handle is empty");
81
82   BaseObject& handle = pub.GetBaseObject();
83
84   return static_cast<Internal::PropertyCondition&>(handle);
85 }
86
87 inline const Internal::PropertyCondition& GetImplementation(const Dali::PropertyCondition& pub)
88 {
89   DALI_ASSERT_ALWAYS(pub && "PropertyCondition handle is empty");
90
91   const BaseObject& handle = pub.GetBaseObject();
92
93   return static_cast<const Internal::PropertyCondition&>(handle);
94 }
95
96 } // namespace Dali
97
98 #endif // DALI_INTERNAL_PROPERTY_CONDITIONS_H