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