1 #ifndef __DALI_PROPERTY_H__
2 #define __DALI_PROPERTY_H__
5 * Copyright (c) 2016 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.
26 #include <dali/public-api/common/dali-common.h>
27 #include <dali/public-api/common/dali-vector.h>
32 * @addtogroup dali_core_object
39 * @brief An object + property pair.
42 struct DALI_IMPORT_API Property
45 * @brief A valid property index is zero or greater.
50 static const int INVALID_INDEX; ///< -1 is not a valid property index
51 static const int INVALID_COMPONENT_INDEX; ///< -1 is not a valid property index
53 typedef Dali::Vector< Index > IndexContainer; ///< A vector of property indices @SINCE_1_0.0
56 * @brief A value-type representing a property value.
61 * @brief A Map of property values.
66 * @brief An Array of property values.
71 * @brief Enumeration for the property types supported.
76 NONE, ///< No type @SINCE_1_0.0
78 BOOLEAN, ///< A boolean type @SINCE_1_0.0
79 FLOAT, ///< A float type @SINCE_1_0.0
80 INTEGER, ///< An integer type @SINCE_1_0.0
81 VECTOR2, ///< a vector array of size=2 with float precision @SINCE_1_0.0
82 VECTOR3, ///< a vector array of size=3 with float precision @SINCE_1_0.0
83 VECTOR4, ///< a vector array of size=4 with float precision @SINCE_1_0.0
84 MATRIX3, ///< a 3x3 matrix @SINCE_1_0.0
85 MATRIX, ///< a 4x4 matrix @SINCE_1_0.0
86 RECTANGLE, ///< an integer array of size=4 @SINCE_1_0.0
87 ROTATION, ///< either a quaternion or an axis angle rotation @SINCE_1_0.0
88 STRING, ///< A string type @SINCE_1_0.0
89 ARRAY, ///< an array of Property::Value @SINCE_1_0.0
90 MAP ///< a string key to Property:value mapping @SINCE_1_0.0
94 * @brief Enumeration for the access mode for custom properties.
99 READ_ONLY, ///< if the property is read-only @SINCE_1_0.0
100 READ_WRITE, ///< If the property is read/writeable @SINCE_1_0.0
101 ANIMATABLE, ///< If the property can be animated or constrained @SINCE_1_0.0
102 ACCESS_MODE_COUNT ///< The number of access modes @SINCE_1_0.0
107 * @brief Creates a Property instance.
110 * @param[in] object A valid handle to the target object
111 * @param[in] propertyIndex The index of a property
113 Property( Handle& object, Property::Index propertyIndex );
117 * @brief Creates a Property instance.
120 * @param[in] object A valid handle to the target object.
121 * @param[in] propertyIndex The index of a property.
122 * @param[in] componentIndex Index to a sub component of a property, for use with Vector2, Vector3 and Vector4. -1 for main property (default is -1)
124 Property( Handle& object, Property::Index propertyIndex, int componentIndex );
127 * @brief Creates a Property instance.
130 * @param[in] object A valid handle to the target object
131 * @param[in] propertyName The property name
132 * @note This performs a property index query and is therefore slower than
133 * constructing a Property directly with the index.
135 Property( Handle& object, const std::string& propertyName );
138 * @brief Creates a Property instance.
141 * @param[in] object A valid handle to the target object
142 * @param[in] propertyName The property name
143 * @param[in] componentIndex Index to a sub component of a property, for use with Vector2, Vector3 and Vector4. -1 for main property (default is -1)
144 * @note This performs a property index query and is therefore slower than
145 * constructing a Property directly with the index.
147 Property( Handle& object, const std::string& propertyName, int componentIndex );
150 * @brief Non-virtual destructor; Property is not intended as a base class.
155 Handle& object; ///< A valid handle to the target object.
157 Index propertyIndex; ///< The index of a property provided by object.
159 int componentIndex; ///< Index of a property sub component, for use with Vector2, Vector3 and Vector4, -1 if using main property
167 #endif // __DALI_PROPERTY_H__