[dali_1.1.4] Merge branch 'devel/master'
[platform/core/uifw/dali-core.git] / dali / public-api / object / type-registry.h
index 7945328..e4a0338 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TYPE_REGISTRY_H__
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2015 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.
 #include <dali/public-api/object/base-handle.h>
 #include <dali/public-api/object/type-info.h>
 
-namespace Dali DALI_IMPORT_API
+namespace Dali
 {
+/**
+ * @addtogroup dali_core_object
+ * @{
+ */
 
 namespace Internal DALI_INTERNAL
 {
@@ -88,11 +92,9 @@ class TypeRegistry;
  *   separated ie 'next-page'. This maintains consistency with the scripted interface.
  *
  */
-class TypeRegistry : public BaseHandle
+class DALI_IMPORT_API TypeRegistry : public BaseHandle
 {
 public:
-  typedef std::vector<std::string> NameContainer; ///< Container of type names
-
   /**
    * @brief Get Type Registry handle.
    *
@@ -126,16 +128,6 @@ public:
   TypeRegistry& operator=(const TypeRegistry& rhs);
 
   /**
-   * @brief This method is defined to allow assignment of the NULL value,
-   * and will throw an exception if passed any other value.
-   *
-   * Assigning to NULL is an alias for Reset().
-   * @param [in] rhs  A NULL pointer
-   * @return A reference to this handle
-   */
-  TypeRegistry& operator=(BaseHandle::NullType* rhs);
-
-  /**
    * @brief Get TypeInfo for a registered type.
    *
    * @param [in] uniqueTypeName A unique type name
@@ -152,11 +144,18 @@ public:
   TypeInfo GetTypeInfo( const std::type_info& registerType );
 
   /**
-   * @brief Get type names.
+   * @brief Get type name count.
+   *
+   * @return The count
+   */
+  size_t GetTypeNameCount() const;
+
+  /**
+   * @brief Get type names by index.
    *
-   * @return list of known types by name
+   * @return The type name or an empty string when index is not valid
    */
-  NameContainer GetTypeNames() const;
+  std::string GetTypeName(size_t index) const;
 
 public: // Not intended for application developers
 
@@ -171,7 +170,7 @@ public: // Not intended for application developers
 /**
  * @brief Register a type from type info.
  */
-class TypeRegistration
+class DALI_IMPORT_API TypeRegistration
 {
 public:
   /**
@@ -222,7 +221,7 @@ private:
 /**
  * @brief Register a signal connector function to a registered type.
  */
-class SignalConnectorType
+class DALI_IMPORT_API SignalConnectorType
 {
 public:
   /**
@@ -232,13 +231,13 @@ public:
    * @param [in] name The signal name
    * @param [in] func The signal connector function
    */
-  SignalConnectorType( TypeRegistration& typeRegistration, const std::string& name, TypeInfo::SignalConnectorFunctionV2 func );
+  SignalConnectorType( TypeRegistration& typeRegistration, const std::string& name, TypeInfo::SignalConnectorFunction func );
 };
 
 /**
  * @brief Register an action function.
  */
-class TypeAction
+class DALI_IMPORT_API TypeAction
 {
 public:
   /**
@@ -254,7 +253,7 @@ public:
 /**
  * @brief Register a property for the given type.
  */
-class PropertyRegistration
+class DALI_IMPORT_API PropertyRegistration
 {
 public:
 
@@ -289,6 +288,60 @@ public:
                         TypeInfo::SetPropertyFunction setFunc, TypeInfo::GetPropertyFunction getFunc );
 };
 
+/**
+ * @brief Register an animatable property for the given type.
+ */
+class DALI_IMPORT_API AnimatablePropertyRegistration
+{
+public:
+
+  /**
+   * @brief This constructor registers the animatable property with the registered type.
+   *
+   * This constructor is for scene-graph only properties where the
+   * value of the property can be retrieved and set via specified
+   * functions.
+   *
+   * @param [in] registered The TypeRegistration object
+   * @param [in] name The name of the property
+   * @param [in] index The property index. Must be a value between ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX and ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX inclusive.
+   * @param [in] type The property value type.
+   *
+   * @pre "registered" must be registered with the TypeRegistry.
+   */
+  AnimatablePropertyRegistration( TypeRegistration& registered, const std::string& name, Property::Index index, Property::Type type );
+};
+
+/**
+ * @brief Register a component of animatable property for the given component index.
+ */
+class DALI_IMPORT_API AnimatablePropertyComponentRegistration
+{
+public:
+
+  /**
+   * @brief This constructor registers a component of an animatable property where
+   * the base animatable property must be a property that supports property component
+   * (i.e. Vector2, Vector3 or Vector4) and the base animatable property must have
+   * been registered.
+   *
+   * This constructor is for a component of scene-graph only properties where the
+   * value of the property can be retrieved and set via specified functions.
+   *
+   * @param [in] registered The TypeRegistration object
+   * @param [in] name The name of the component
+   * @param [in] index The property index. Must be a value between ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX and ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX inclusive.
+   * @param [in] baseIndex The index of the base animatable property. Must be a value between ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX and ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX inclusive.
+   * @param [in] componentIndex The index of the component (e.g. 0 for the x component of a Vector2 property and 1 for the y component of a Vector2 property).
+   *
+   * @pre "registered" must be registered with the TypeRegistry.
+   */
+  AnimatablePropertyComponentRegistration( TypeRegistration& registered, const std::string& name, Property::Index index, Property::Index baseIndex, unsigned int componentIndex );
+};
+
+/**
+ * @}
+ */
 } // namespace Dali
 
 #endif // header