DALi Version 2.1.5
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / builder / builder-set-property.h
1 #ifndef DALI_TOOLKIT_INTERNAL_BUILDER_SET_PROPERTY_H
2 #define DALI_TOOLKIT_INTERNAL_BUILDER_SET_PROPERTY_H
3
4 /*
5  * Copyright (c) 2021 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 namespace Dali
21 {
22 namespace Toolkit
23 {
24 namespace Internal
25 {
26 /**
27  * Set a property value from a tree node.
28  * This function determines the type of the property from the format of the string in the node.
29  * This is not always possible and if the type cannot be determined then then the type will default to Array.
30  * @param node  The node string to convert from
31  * @param value The property value to set
32  */
33 void DeterminePropertyFromNode(const TreeNode&  node,
34                                Property::Value& value);
35
36 /**
37  * Set a property value from a tree node as DeterminePropertyFromNode() above
38  * This function determines the type of the property from the format of the string in the node.
39  * This is not always possible and if the type cannot be determined then then the type will default to Array.
40  * @param node  The node string to convert from
41  * @param value The property value to set
42  * @param replacement The overriding replacement map (if any)
43  */
44 void DeterminePropertyFromNode(const TreeNode&    node,
45                                Property::Value&   value,
46                                const Replacement& replacement);
47
48 /**
49  * Set a property value as the given type from a tree node.
50  * @param node The node string to convert from
51  * @param type The property type to convert to.
52  * @param value The property value to set
53  * @return true if the string could be converted to the correct type.
54  */
55 bool DeterminePropertyFromNode(const TreeNode&  node,
56                                Property::Type   type,
57                                Property::Value& value);
58
59 /**
60  * Set a property value as the given type from a tree node as DeterminePropertyFromNode() above
61  * @param node The node string to convert from
62  * @param type The property type to convert to.
63  * @param value The property value to set
64  * @param replacement The overriding replacement map (if any)
65  * @return true if the string could be converted to the correct type.
66  */
67 bool DeterminePropertyFromNode(const TreeNode&    node,
68                                Property::Type     type,
69                                Property::Value&   value,
70                                const Replacement& replacement);
71
72 } // namespace Internal
73 } // namespace Toolkit
74 } // namespace Dali
75
76 #endif //DALI_TOOLKIT_INTERNAL_BUILDER_SET_PROPERTY_H