1 #ifndef DALI_PROPERTY_TYPES_H
2 #define DALI_PROPERTY_TYPES_H
5 * Copyright (c) 2020 Samsung Electronics Co., Ltd.
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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.
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/matrix.h>
27 #include <dali/public-api/math/matrix3.h>
28 #include <dali/public-api/math/quaternion.h>
29 #include <dali/public-api/math/rect.h>
30 #include <dali/public-api/math/vector2.h>
31 #include <dali/public-api/math/vector3.h>
32 #include <dali/public-api/math/vector4.h>
33 #include <dali/public-api/object/property.h>
38 * @addtogroup dali_core_object
43 * @brief Template function instances for property getters.
46 namespace PropertyTypes
49 * @brief Retrieves the name of a property type.
52 * @param[in] type The property type
53 * @return The name of this type
55 DALI_CORE_API const char* GetName(Property::Type type);
58 * @brief Retrieves an enumerated property type.
60 * New versions of this templated function must be defined for future types.
62 * @return The property type
65 inline Property::Type Get()
67 return Property::NONE;
70 inline Property::Type Get<bool>()
72 return Property::BOOLEAN;
75 inline Property::Type Get<float>()
77 return Property::FLOAT;
80 inline Property::Type Get<int>()
82 return Property::INTEGER;
85 inline Property::Type Get<Vector2>()
87 return Property::VECTOR2;
90 inline Property::Type Get<Vector3>()
92 return Property::VECTOR3;
95 inline Property::Type Get<Vector4>()
97 return Property::VECTOR4;
100 inline Property::Type Get<Matrix3>()
102 return Property::MATRIX3;
105 inline Property::Type Get<Matrix>()
107 return Property::MATRIX;
110 inline Property::Type Get<AngleAxis>()
112 return Property::ROTATION;
113 } // Rotation has two representations
115 inline Property::Type Get<Quaternion>()
117 return Property::ROTATION;
118 } // Rotation has two representations
120 inline Property::Type Get<std::string>()
122 return Property::STRING;
125 inline Property::Type Get<Dali::Rect<int> >()
127 return Property::RECTANGLE;
130 inline Property::Type Get<Property::Map>()
132 return Property::MAP;
135 inline Property::Type Get<Property::Array>()
137 return Property::ARRAY;
140 inline Property::Type Get<Extents>()
142 return Property::EXTENTS;
145 }; // namespace PropertyTypes
152 #endif // DALI_PROPERTY_TYPES_H