1 #ifndef DALI_HANDLE_DEVEL_H
2 #define DALI_HANDLE_DEVEL_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.
22 #include <dali/public-api/object/handle.h>
31 * @brief Query the index of a custom property matching the given key.
33 * Returns the first custom property that matches the given integer key. This is
34 * useful for other classes that know the key but not the name. Requires the property
35 * to have been registered with the associated key.
37 * @note This key is not the same as the Property enum found in
38 * objects such as Actor (which is a preset index).
40 * @param[in] handle The handle from where to retrieve the property index.
41 * @param[in] key The integer key of the property
43 * @return The index of the property, or Property::INVALID_INDEX if no property exists with the given key.
45 * @note The key is not the same as the returned index, though it has the same type.
47 DALI_IMPORT_API Property::Index GetPropertyIndex( const Handle& handle, Property::Index key );
50 * @brief Query the index of a property using the given key from a Property::Map
52 * @param[in] handle The handle from where to retrieve the property index.
53 * @param[in] key The key of the property to search for.
55 * @return the matching property index of either the string key or the matching
56 * custom property index of the index key, or Property::INVALID_INDEX if no
57 * property matches the given key.
59 * @note See also, GetPropertyIndex(Property::Index) and GetPropertyIndex(const std::string&)
61 DALI_IMPORT_API Property::Index GetPropertyIndex( const Handle& handle, Property::Key key );
64 * @brief Register a new animatable property with an integer key.
66 * @param[in] handle The handle where to register the property.
67 * @param[in] key The integer key of the property.
68 * @param[in] name The text key of the property.
69 * @param[in] propertyValue The new value of the property.
71 * @return The index of the property or Property::INVALID_INDEX if registration failed
73 * @pre The object supports dynamic properties i.e. Supports(Handle::DYNAMIC_PROPERTIES) returns true.
74 * Property names and keys are expected to be unique, but this is not enforced.
75 * Property indices are unique to each registered custom property in a given object.
77 * @note Returns Property::INVALID_INDEX if registration failed. This can happen if you try to register
78 * animatable property on an object that does not have scene graph object.
80 * @note The returned property index is not the same as the integer key (though it shares a type)
82 * This version of RegisterProperty associates both an integer key
83 * and the text key with the property, allowing for lookup of the
84 * property index by either key or name ( which is useful when other
85 * classes know the key but not the name )
87 * @note Only the following types can be animated:
96 * - Property::ROTATION
97 * @note If a property with the desired name already exists, then the value given is just set.
99 DALI_IMPORT_API Property::Index RegisterProperty( Handle handle, Property::Index key, const std::string& name, const Property::Value& propertyValue );
102 * @brief Set the type-info that the object is created by.
104 * @note This is particularly useful to link C# custom control with its correct type-info in the native side
106 * @param[in] handle The handle created by this TypeInfo.
107 * @param[in] typeInfo The TypeInfo that creates the handle.
109 DALI_IMPORT_API void SetTypeInfo( Handle& handle, const TypeInfo& typeInfo );
111 } // namespace DevelHandle
115 #endif // DALI_HANDLE_DEVEL_H