[dali_1.1.4] Merge branch 'devel/master'
[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) 2015 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  */
41 class DALI_IMPORT_API PropertyInput
42 {
43 public:
44
45   class Extension; ///< Forward declare future extension interface
46
47   /**
48    * @brief Virtual destructor.
49    */
50   virtual ~PropertyInput() = 0;
51
52   /**
53    * @brief Query the type of property input.
54    *
55    * @return The property type.
56    */
57   virtual Property::Type GetType() const = 0;
58
59   /**
60    * @brief Retrieve a boolean value.
61    *
62    * @pre GetType() returns Property::BOOLEAN.
63    * @return The boolean value.
64    */
65   virtual const bool& GetBoolean() const = 0;
66
67   /**
68    * @brief Retrieve a float value.
69    *
70    * @pre GetType() returns Property::FLOAT.
71    * @return The float value.
72    */
73   virtual const float& GetFloat() const = 0;
74
75   /**
76    * @brief Retrieve an integer value.
77    *
78    * @pre GetType() returns Property::INTEGER.
79    * @return The integer value.
80    */
81   virtual const int& GetInteger() const = 0;
82
83   /**
84    * @brief Retrieve a Vector2 value.
85    *
86    * @pre GetType() returns Property::VECTOR2.
87    * @return The Vector2 value.
88    */
89   virtual const Vector2& GetVector2() const = 0;
90
91   /**
92    * @brief Retrieve a Vector3 value.
93    *
94    * @pre GetType() returns Property::VECTOR3.
95    * @return The Vector3 value.
96    */
97   virtual const Vector3& GetVector3() const = 0;
98
99   /**
100    * @brief Retrieve a Vector4 value.
101    *
102    * @pre GetType() returns Property::VECTOR4.
103    * @return The Vector4 value.
104    */
105   virtual const Vector4& GetVector4() const = 0;
106
107   /**
108    * @brief Retrieve a Matrix (3x3) value.
109    *
110    * @pre GetType() returns Property::Matrix3.
111    * @return The Matrix value.
112    */
113   virtual const Matrix3& GetMatrix3() const = 0;
114
115   /**
116    * @brief Retrieve a Matrix (4x4) value.
117    *
118    * @pre GetType() returns Property::Matrix4.
119    * @return The Matrix value.
120    */
121   virtual const Matrix& GetMatrix() const = 0;
122
123   /**
124    * @brief Retrieve a Quaternion value.
125    *
126    * @pre GetType() returns Property::Quaternion.
127    * @return The Quaternion value.
128    */
129   virtual const Quaternion& GetQuaternion() const = 0;
130
131   /**
132    * Retrieve the extension for the PropertyInput
133    *
134    * @return The extension if available, NULL otherwise
135    */
136   virtual Extension* GetExtension()
137   {
138     return NULL;
139   }
140 };
141
142 /**
143  * @}
144  */
145 } // namespace Dali
146
147 #endif // __DALI_PROPERTY_INPUT_H__