Merge branch 'devel/master' into tizen
[platform/core/uifw/dali-core.git] / dali / public-api / object / property-input.h
1 #ifndef DALI_PROPERTY_INPUT_H
2 #define DALI_PROPERTY_INPUT_H
3
4 /*
5  * Copyright (c) 2020 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/object/property.h>
23
24 namespace Dali
25 {
26 /**
27  * @addtogroup dali_core_object
28  * @{
29  */
30
31 struct Vector2;
32 struct Vector3;
33 struct Vector4;
34 class Matrix3;
35 class Matrix;
36 class Quaternion;
37
38 /**
39  * @brief An abstract interface for receiving property values.
40  * @SINCE_1_0.0
41  */
42 class DALI_CORE_API PropertyInput
43 {
44 public:
45   class Extension; ///< Forward declare future extension interface
46
47   /**
48    * @brief Virtual destructor.
49    * @SINCE_1_0.0
50    */
51   virtual ~PropertyInput() = 0;
52
53   /**
54    * @brief Queries the type of property input.
55    *
56    * @SINCE_1_0.0
57    * @return The property type
58    */
59   virtual Property::Type GetType() const = 0;
60
61   /**
62    * @brief Retrieves a boolean value.
63    *
64    * @SINCE_1_0.0
65    * @return The boolean value
66    * @pre GetType() returns Property::BOOLEAN.
67    */
68   virtual const bool& GetBoolean() const = 0;
69
70   /**
71    * @brief Retrieves a float value.
72    *
73    * @SINCE_1_0.0
74    * @return The float value
75    * @pre GetType() returns Property::FLOAT.
76    */
77   virtual const float& GetFloat() const = 0;
78
79   /**
80    * @brief Retrieves an integer value.
81    *
82    * @SINCE_1_0.0
83    * @return The integer value
84    * @pre GetType() returns Property::INTEGER.
85    */
86   virtual const int& GetInteger() const = 0;
87
88   /**
89    * @brief Retrieves a Vector2 value.
90    *
91    * @SINCE_1_0.0
92    * @return The Vector2 value
93    * @pre GetType() returns Property::VECTOR2.
94    */
95   virtual const Vector2& GetVector2() const = 0;
96
97   /**
98    * @brief Retrieves a Vector3 value.
99    *
100    * @SINCE_1_0.0
101    * @return The Vector3 value
102    * @pre GetType() returns Property::VECTOR3.
103    */
104   virtual const Vector3& GetVector3() const = 0;
105
106   /**
107    * @brief Retrieves a Vector4 value.
108    *
109    * @SINCE_1_0.0
110    * @return The Vector4 value
111    * @pre GetType() returns Property::VECTOR4.
112    */
113   virtual const Vector4& GetVector4() const = 0;
114
115   /**
116    * @brief Retrieves a Matrix (3x3) value.
117    *
118    * @SINCE_1_0.0
119    * @return The Matrix value
120    * @pre GetType() returns Property::Matrix3.
121    */
122   virtual const Matrix3& GetMatrix3() const = 0;
123
124   /**
125    * @brief Retrieves a Matrix (4x4) value.
126    *
127    * @SINCE_1_0.0
128    * @return The Matrix value
129    * @pre GetType() returns Property::Matrix4.
130    */
131   virtual const Matrix& GetMatrix() const = 0;
132
133   /**
134    * @brief Retrieves a Quaternion value.
135    *
136    * @SINCE_1_0.0
137    * @return The Quaternion value
138    * @pre GetType() returns Property::Quaternion.
139    */
140   virtual const Quaternion& GetQuaternion() const = 0;
141
142   /**
143    * @brief Retrieves the extension for the PropertyInput
144    *
145    * @SINCE_1_0.0
146    * @return The extension if available, NULL otherwise
147    */
148   virtual Extension* GetExtension()
149   {
150     return nullptr;
151   }
152 };
153
154 /**
155  * @}
156  */
157 } // namespace Dali
158
159 #endif // DALI_PROPERTY_INPUT_H