[Tizen] Implement partial update
[platform/core/uifw/dali-core.git] / dali / devel-api / object / handle-devel.h
index 5a54a3d..df6a4d6 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_HANDLE_DEVEL_H
 
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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.
@@ -44,7 +44,7 @@ namespace DevelHandle
  *
  * @note The key is not the same as the returned index, though it has the same type.
  */
-DALI_IMPORT_API Property::Index GetPropertyIndex( const Handle& handle, Property::Index key );
+DALI_CORE_API Property::Index GetPropertyIndex( const Handle& handle, Property::Index key );
 
 /**
  * @brief Query the index of a property using the given key from a Property::Map
@@ -58,7 +58,7 @@ DALI_IMPORT_API Property::Index GetPropertyIndex( const Handle& handle, Property
  *
  * @note See also, GetPropertyIndex(Property::Index) and GetPropertyIndex(const std::string&)
  */
-DALI_IMPORT_API Property::Index GetPropertyIndex( const Handle& handle, Property::Key key );
+DALI_CORE_API Property::Index GetPropertyIndex( const Handle& handle, Property::Key key );
 
 /**
  * @brief Register a new animatable property with an integer key.
@@ -96,7 +96,73 @@ DALI_IMPORT_API Property::Index GetPropertyIndex( const Handle& handle, Property
  *       - Property::ROTATION
  * @note If a property with the desired name already exists, then the value given is just set.
  */
-DALI_IMPORT_API Property::Index RegisterProperty( Handle handle, Property::Index key, const std::string& name, const Property::Value& propertyValue );
+DALI_CORE_API Property::Index RegisterProperty( Handle handle, Property::Index key, const std::string& name, const Property::Value& propertyValue );
+
+/**
+ * @brief Sets all the properties in the given property map.
+ *
+ * @param[in] handle The handle to set the properties on
+ * @param[in] properties The properties to set
+ */
+DALI_CORE_API void SetProperties( Handle handle, const Property::Map& properties );
+
+/**
+ * @brief Retrieves all the properties and the values for a handle.
+ *
+ * @param[in] handle The handle to retrieve properties from
+ * @param[out] properties A map which is populated with the index-value pairs
+ *
+ * @note The properties map will be cleared by this method first.
+ */
+DALI_CORE_API void GetProperties( Handle handle, Property::Map& properties );
+
+/**
+ * @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_CORE_API void SetTypeInfo( Handle& handle, const TypeInfo& typeInfo );
+
+
+/**
+ * @brief Determine if the custom property index exists on this object without throwing a Dali::Exception.
+ *
+ * @note This does not check default properties.
+ * @param[in] handle The handle to check
+ * @param[in] index The index of the property to test for
+ */
+DALI_CORE_API bool DoesCustomPropertyExist( Handle& handle, Property::Index index );
+
+/**
+ * @brief PropertySetSignal function prototype for signal handler. Called when a property is set on this object.
+ */
+using PropertySetSignalType = Signal< void( Handle& handle, Property::Index index, Property::Value value ) >;
+
+/**
+ * @brief Get a signal when a property is set on this object through the API (i.e. not when animating)
+ *
+ * @param[in] handle The handle of the object to listen to.
+ * @return The signal to attach a connection to.
+ */
+DALI_CORE_API PropertySetSignalType& PropertySetSignal( Handle handle );
+
+/**
+ * @brief Template to create a derived handle and set properties on it.
+ *
+ * @tparam T The derived class to create
+ *
+ * @param[in] properties The properties to set
+ */
+template< typename T >
+DALI_INTERNAL T New( const Property::Map& properties )
+{
+  T handle = T::New();
+  SetProperties( handle, properties );
+  return handle;
+}
 
 } // namespace DevelHandle