Revert "[Tizen] Move DevelHandle::GetCurrentProperty to public"
[platform/core/uifw/dali-core.git] / dali / devel-api / object / handle-devel.h
index 5a54a3d..03e5c37 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_HANDLE_DEVEL_H
 
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -98,6 +98,41 @@ DALI_IMPORT_API Property::Index GetPropertyIndex( const Handle& handle, Property
  */
 DALI_IMPORT_API Property::Index RegisterProperty( Handle handle, Property::Index key, const std::string& name, const Property::Value& propertyValue );
 
+/**
+ * @brief Set the type-info that the object is created by.
+ *
+ * @note This is particularly useful to link C# custom control with its correct type-info in the native side
+ *
+ * @param[in] handle The handle created by this TypeInfo.
+ * @param[in] typeInfo The TypeInfo that creates the handle.
+ */
+DALI_IMPORT_API void SetTypeInfo( Handle& handle, const TypeInfo& typeInfo );
+
+/**
+ * @brief Retrieves the latest value of the property from the scene-graph.
+ *
+ * @param[in] handle The handle whose current property value is required
+ * @param[in] index The index of the property
+ * @return The property value
+ */
+DALI_IMPORT_API Property::Value GetCurrentProperty( Handle handle, Property::Index index );
+
+/**
+ * @brief Convenience function for obtaining the current value of a property of a known type.
+ *
+ * @param[in] handle The handle whose current property value is required
+ * @param[in] index The index of the property
+ * @return The property value
+ * @pre The property types match i.e. PropertyTypes::Get<T>() is equal to GetPropertyType(index).
+ */
+template <typename T>
+T GetCurrentProperty( Handle handle, Property::Index index )
+{
+  Property::Value value = GetCurrentProperty( handle, index );
+
+  return T( value.Get<T>() );
+}
+
 } // namespace DevelHandle
 
 } // namespace Dali