[dali_1.0.1] Merge branch 'tizen'
[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) 2014 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/math/angle-axis.h>
24 #include <dali/public-api/math/degree.h>
25 #include <dali/public-api/math/quaternion.h>
26 #include <dali/public-api/math/vector2.h>
27 #include <dali/public-api/math/vector3.h>
28 #include <dali/public-api/math/vector4.h>
29 #include <dali/public-api/math/matrix3.h>
30 #include <dali/public-api/math/matrix.h>
31 #include <dali/public-api/math/rect.h>
32 #include <dali/public-api/object/property.h>
33
34 namespace Dali DALI_IMPORT_API
35 {
36
37 /**
38  * @brief Template function instances for property getters.
39  */
40 namespace PropertyTypes
41 {
42
43 /**
44  * @brief Retrieve the name of a property type.
45  *
46  * @param [in] type The property type.
47  * @return The name of this type.
48  */
49 const char* GetName(Property::Type type);
50
51 /**
52  * @brief Retrieve an enumerated property type.
53  *
54  * New versions of this templated function must be defined for future types.
55  * @return The property type.
56  */
57 template <typename T> Property::Type Get();
58 template <>           Property::Type Get<bool>();
59 template <>           Property::Type Get<float>();
60 template <>           Property::Type Get<int>();
61 template <>           Property::Type Get<unsigned int>();
62 template <>           Property::Type Get<Vector2>();
63 template <>           Property::Type Get<Vector3>();
64 template <>           Property::Type Get<Vector4>();
65 template <>           Property::Type Get<Matrix3>();
66 template <>           Property::Type Get<Matrix>();
67 template <>           Property::Type Get<AngleAxis>();
68 template <>           Property::Type Get<Quaternion>();
69 template <>           Property::Type Get<std::string>();
70 template <>           Property::Type Get<Rect<int> >();
71 template <>           Property::Type Get<Property::Map >();
72 template <>           Property::Type Get<Property::Array >();
73
74 }; // namespace PropertyTypes
75
76 } // namespace Dali
77
78 #endif // __DALI_PROPERTY_TYPES_H__