1 #ifndef DALI_TOOLKIT_INTERNAL_BUILDER_SET_PROPERTY_H
2 #define DALI_TOOLKIT_INTERNAL_BUILDER_SET_PROPERTY_H
5 * Copyright (c) 2021 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.
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
33 void DeterminePropertyFromNode(const TreeNode& node,
34 Property::Value& value);
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)
44 void DeterminePropertyFromNode(const TreeNode& node,
45 Property::Value& value,
46 const Replacement& replacement);
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.
55 bool DeterminePropertyFromNode(const TreeNode& node,
57 Property::Value& value);
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.
67 bool DeterminePropertyFromNode(const TreeNode& node,
69 Property::Value& value,
70 const Replacement& replacement);
72 } // namespace Internal
73 } // namespace Toolkit
76 #endif //DALI_TOOLKIT_INTERNAL_BUILDER_SET_PROPERTY_H