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