[3.0] Update doxygen comments
[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/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
35 {
36 /**
37  * @addtogroup dali_core_object
38  * @{
39  */
40
41 /**
42  * @brief Template function instances for property getters.
43  * @SINCE_1_0.0
44  */
45 namespace PropertyTypes
46 {
47
48 /**
49  * @brief Retrieves the name of a property type.
50  *
51  * @SINCE_1_0.0
52  * @param[in] type The property type
53  * @return The name of this type
54  */
55 DALI_IMPORT_API const char* GetName(Property::Type type);
56
57 /**
58  * @brief Retrieves an enumerated property type.
59  *
60  * New versions of this templated function must be defined for future types.
61  * @SINCE_1_0.0
62  * @return The property type
63  */
64 template <typename T>
65 inline Property::Type Get()                   { return Property::NONE;  }
66 template <>
67 inline Property::Type Get<bool>()             { return Property::BOOLEAN;  }
68 template <>
69 inline Property::Type Get<float>()            { return Property::FLOAT;    }
70 template <>
71 inline Property::Type Get<int>()              { return Property::INTEGER;  }
72 template <>
73 inline Property::Type Get<Vector2>()          { return Property::VECTOR2;  }
74 template <>
75 inline Property::Type Get<Vector3>()          { return Property::VECTOR3;  }
76 template <>
77 inline Property::Type Get<Vector4>()          { return Property::VECTOR4;  }
78 template <>
79 inline Property::Type Get<Matrix3>()          { return Property::MATRIX3;  }
80 template <>
81 inline Property::Type Get<Matrix>()           { return Property::MATRIX;  }
82 template <>
83 inline Property::Type Get<AngleAxis>()        { return Property::ROTATION; } // Rotation has two representations
84 template <>
85 inline Property::Type Get<Quaternion>()       { return Property::ROTATION; } // Rotation has two representations
86 template <>
87 inline Property::Type Get<std::string>()      { return Property::STRING; }
88 template <>
89 inline Property::Type Get<Dali::Rect<int> >() { return Property::RECTANGLE; }
90 template <>
91 inline Property::Type Get<Property::Map>()    { return Property::MAP; }
92 template <>
93 inline Property::Type Get<Property::Array>()  { return Property::ARRAY; }
94
95
96 }; // namespace PropertyTypes
97
98 /**
99  * @}
100  */
101 } // namespace Dali
102
103 #endif // __DALI_PROPERTY_TYPES_H__