Merge branch 'devel/master' into tizen
[platform/core/uifw/dali-core.git] / dali / public-api / object / property-types.cpp
1 /*
2  * Copyright (c) 2020 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 // CLASS HEADER
19 #include <dali/public-api/object/property-types.h>
20
21 namespace Dali
22 {
23 namespace
24 {
25 const char* const PROPERTY_TYPE_NAMES[] = {
26   "NONE",
27   "BOOLEAN",
28   "FLOAT",
29   "INTEGER",
30   "VECTOR2",
31   "VECTOR3",
32   "VECTOR4",
33   "MATRIX3",
34   "MATRIX",
35   "RECTANGLE",
36   "ROTATION",
37   "STRING",
38   "ARRAY",
39   "MAP",
40   "EXTENTS",
41 };
42 const uint32_t PROPERTY_TYPE_NAMES_COUNT = static_cast<uint32_t>(sizeof(PROPERTY_TYPE_NAMES) / sizeof(const char*));
43 } // namespace
44
45 namespace PropertyTypes
46 {
47 DALI_CORE_API const char* GetName(Property::Type type)
48 {
49   if(type < PROPERTY_TYPE_NAMES_COUNT)
50   {
51     return PROPERTY_TYPE_NAMES[type];
52   }
53
54   return PROPERTY_TYPE_NAMES[Property::NONE];
55 }
56
57 }; // namespace PropertyTypes
58
59 } // namespace Dali