[4.0] Add Property::EXTENTS type
[platform/core/uifw/dali-core.git] / dali / public-api / object / property-types.h
1 #ifndef __DALI_PROPERTY_TYPES_H__
2 #define __DALI_PROPERTY_TYPES_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/common/constants.h>
23 #include <dali/public-api/common/extents.h>
24 #include <dali/public-api/math/angle-axis.h>
25 #include <dali/public-api/math/degree.h>
26 #include <dali/public-api/math/quaternion.h>
27 #include <dali/public-api/math/vector2.h>
28 #include <dali/public-api/math/vector3.h>
29 #include <dali/public-api/math/vector4.h>
30 #include <dali/public-api/math/matrix3.h>
31 #include <dali/public-api/math/matrix.h>
32 #include <dali/public-api/math/rect.h>
33 #include <dali/public-api/object/property.h>
34
35 namespace Dali
36 {
37 /**
38  * @addtogroup dali_core_object
39  * @{
40  */
41
42 /**
43  * @brief Template function instances for property getters.
44  * @SINCE_1_0.0
45  */
46 namespace PropertyTypes
47 {
48
49 /**
50  * @brief Retrieves the name of a property type.
51  *
52  * @SINCE_1_0.0
53  * @param[in] type The property type
54  * @return The name of this type
55  */
56 DALI_IMPORT_API const char* GetName(Property::Type type);
57
58 /**
59  * @brief Retrieves an enumerated property type.
60  *
61  * New versions of this templated function must be defined for future types.
62  * @SINCE_1_0.0
63  * @return The property type
64  */
65 template <typename T>
66 inline Property::Type Get()                   { return Property::NONE;  }
67 template <>
68 inline Property::Type Get<bool>()             { return Property::BOOLEAN;  }
69 template <>
70 inline Property::Type Get<float>()            { return Property::FLOAT;    }
71 template <>
72 inline Property::Type Get<int>()              { return Property::INTEGER;  }
73 template <>
74 inline Property::Type Get<Vector2>()          { return Property::VECTOR2;  }
75 template <>
76 inline Property::Type Get<Vector3>()          { return Property::VECTOR3;  }
77 template <>
78 inline Property::Type Get<Vector4>()          { return Property::VECTOR4;  }
79 template <>
80 inline Property::Type Get<Matrix3>()          { return Property::MATRIX3;  }
81 template <>
82 inline Property::Type Get<Matrix>()           { return Property::MATRIX;  }
83 template <>
84 inline Property::Type Get<AngleAxis>()        { return Property::ROTATION; } // Rotation has two representations
85 template <>
86 inline Property::Type Get<Quaternion>()       { return Property::ROTATION; } // Rotation has two representations
87 template <>
88 inline Property::Type Get<std::string>()      { return Property::STRING; }
89 template <>
90 inline Property::Type Get<Dali::Rect<int> >() { return Property::RECTANGLE; }
91 template <>
92 inline Property::Type Get<Property::Map>()    { return Property::MAP; }
93 template <>
94 inline Property::Type Get<Property::Array>()  { return Property::ARRAY; }
95 template <>
96 inline Property::Type Get<Extents>()          { return Property::EXTENTS; }
97
98
99 }; // namespace PropertyTypes
100
101 /**
102  * @}
103  */
104 } // namespace Dali
105
106 #endif // __DALI_PROPERTY_TYPES_H__