#define __DALI_INTERNAL_TYPE_INFO_H__
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 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.
Dali::TypeInfo::CreateFunction GetCreator() const;
/**
- * @copydoc Dali::TypeInfo::GetActions
+ * @copydoc Dali::TypeInfo::GetActionCount
*/
- void GetActions( Dali::TypeInfo::NameContainer& container ) const;
+ size_t GetActionCount() const;
/**
- * @copydoc Dali::TypeInfo::GetSignals
+ * @copydoc Dali::TypeInfo::GetActionName
*/
- void GetSignals( Dali::TypeInfo::NameContainer& container) const;
+ std::string GetActionName(size_t index) const;
/**
- * @copydoc Dali::TypeInfo::GetProperties
+ * @copydoc Dali::TypeInfo::GetSignalCount
*/
- void GetProperties( Dali::TypeInfo::NameContainer& container) const;
+ size_t GetSignalCount() const;
+
+ /**
+ * @copydoc Dali::TypeInfo::GetSignalName
+ */
+ std::string GetSignalName(size_t index) const;
+
+ /**
+ * @copydoc Dali::TypeInfo::GetPropertyCount
+ */
+ size_t GetPropertyCount() const;
+
+ /**
+ * @copydoc Dali::TypeInfo::GetPropertyName
+ */
+ std::string GetPropertyName(size_t index) const;
/**
* Adds the property indices to the container specified.
* @param[in] signalName The name of the signal.
* @param[in] function The function used for connecting to the signal.
*/
- void AddConnectorFunction( const std::string& signalName, Dali::TypeInfo::SignalConnectorFunctionV2 function );
+ void AddConnectorFunction( const std::string& signalName, Dali::TypeInfo::SignalConnectorFunction function );
/**
* Adds an event-thread only property to the type.
void AddProperty( const std::string& name, Property::Index index, Property::Type type, Dali::TypeInfo::SetPropertyFunction setFunc, Dali::TypeInfo::GetPropertyFunction getFunc );
/**
+ * Adds an animatable property to the type.
+ * @param[in] name The name of the property.
+ * @param[in] index The index of the property
+ * @param[in] type The Property::Type.
+ */
+ void AddAnimatableProperty( const std::string& name, Property::Index index, Property::Type type );
+
+ /**
+ * Adds an animatable property with the given default value.
+ * @param[in] name The name of the property.
+ * @param[in] index The index of the property
+ * @param[in] type The Property::Type.
+ */
+ void AddAnimatableProperty( const std::string& name, Property::Index index, const Property::Value& defaultValue );
+
+ /**
+ * Adds a component of an animatable property to the type.
+ * The animatable property must have been type-registered and must be a Vector2, Vector3 or Vector4 type.
+ * @param[in] name The name of the component.
+ * @param[in] index The index of the property
+ * @param[in] baseIndex The index of the base animatable property
+ * @param[in] component The index The index of the component.
+ */
+ void AddAnimatablePropertyComponent( const std::string& name, Property::Index index, Property::Index baseIndex, unsigned int componentIndex );
+
+ /**
+ * Adds a child property to the type.
+ * @param[in] name The name of the property.
+ * @param[in] index The index of the property
+ * @param[in] type The Property::Type.
+ */
+ void AddChildProperty( const std::string& name, Property::Index index, Property::Type type );
+
+ /**
* Do an action on base object
* @param [in] object The base object to act upon
* @param [in] actionName The name of the desired action
* @param [in] properties The arguments of the action
* @return bool If the action could be executed
*/
- bool DoActionTo(BaseObject *object, const std::string &actionName, const std::vector<Property::Value> &properties);
+ bool DoActionTo(BaseObject *object, const std::string &actionName, const Property::Map &properties);
/**
* Connects a callback function with the object's signals.
bool ConnectSignal( BaseObject* object, ConnectionTrackerInterface* connectionTracker, const std::string& signalName, FunctorDelegate* functor );
/**
- * Retrieve the property count for this type.
- * @return The total number of properties.
- */
- unsigned int GetPropertyCount() const;
-
- /**
* Given a property name, retrieve the index.
* @param[in] name The name of the property.
* @return The index associated with that name.
Property::Index GetPropertyIndex( const std::string& name ) const;
/**
+ * Given a property index, retrieve the index of its base property.
+ * @param[in] index The index of the property.
+ * @return The index of the base property associated with the given property index.
+ */
+ Property::Index GetBasePropertyIndex( Property::Index index ) const;
+
+ /**
+ * Given a property index, retrieve its component index.
+ * @param[in] index The index of the property.
+ * @return The component index associated with that property index.
+ */
+ int GetComponentIndex( Property::Index index ) const;
+
+ /**
* Checks if there is a setter for the property. If there is then it is writable.
* @param[in] index The property index.
* @return True, if writable, false otherwise.
Property::Type GetPropertyType( Property::Index index ) const;
/**
+ * Given a child property name, retrieve the index.
+ * @param[in] name The name of the child property.
+ * @return The index associated with that name.
+ */
+ Property::Index GetChildPropertyIndex( const std::string& name ) const;
+
+ /**
+ * Retrieve the name of the child property at the given index.
+ * @param[in] index The property index.
+ * @return The name of the child property.
+ */
+ const std::string& GetChildPropertyName( Property::Index index ) const;
+
+ /**
+ * Retrieve the Property::Type of the child property at the given index.
+ * @param[in] index The property index.
+ * @return The Property::Type at that index.
+ */
+ Property::Type GetChildPropertyType( Property::Index index ) const;
+
+ /**
+ * Retrieve the default value of the property at the given index.
+ * @param[in] index The property index.
+ * @return The default property value at that index.
+ */
+ Property::Value GetPropertyDefaultValue( Property::Index index ) const;
+
+ /**
* Sets the value of a property at the index specified for the given object.
* @param[in] object The object whose property is to be set.
* @param[in] index The property index.
: type( Property::NONE ),
setFunc( NULL ),
getFunc( NULL ),
- name()
+ name(),
+ basePropertyIndex(Property::INVALID_INDEX),
+ componentIndex(Property::INVALID_COMPONENT_INDEX)
{
}
- RegisteredProperty( Property::Type propType, Dali::TypeInfo::SetPropertyFunction set, Dali::TypeInfo::GetPropertyFunction get, const std::string& propName )
+ RegisteredProperty( Property::Type propType, Dali::TypeInfo::SetPropertyFunction set, Dali::TypeInfo::GetPropertyFunction get, const std::string& propName, Property::Index basePropertyIndex, int componentIndex )
: type( propType ),
setFunc( set ),
getFunc( get ),
- name( propName )
+ name( propName ),
+ basePropertyIndex(basePropertyIndex),
+ componentIndex(componentIndex)
{
}
Dali::TypeInfo::SetPropertyFunction setFunc;
Dali::TypeInfo::GetPropertyFunction getFunc;
std::string name;
+ Property::Index basePropertyIndex;
+ int componentIndex;
};
- typedef std::pair<std::string, Dali::TypeInfo::SignalConnectorFunctionV2 > ConnectionPairV2;
+ typedef std::pair<std::string, Dali::TypeInfo::SignalConnectorFunction > ConnectionPair;
typedef std::pair<std::string, Dali::TypeInfo::ActionFunction > ActionPair;
typedef std::pair<Property::Index, RegisteredProperty> RegisteredPropertyPair;
+ typedef std::pair<Property::Index, Property::Value> PropertyDefaultValuePair;
typedef std::vector< ActionPair > ActionContainer;
- typedef std::vector< ConnectionPairV2 > ConnectorContainerV2;
+ typedef std::vector< ConnectionPair > ConnectorContainer;
typedef std::vector< RegisteredPropertyPair > RegisteredPropertyContainer;
+ typedef std::vector< PropertyDefaultValuePair > PropertyDefaultValueContainer;
std::string mTypeName;
std::string mBaseTypeName;
Dali::TypeInfo::CreateFunction mCreate;
ActionContainer mActions;
- ConnectorContainerV2 mSignalConnectors;
+ ConnectorContainer mSignalConnectors;
RegisteredPropertyContainer mRegisteredProperties;
+ RegisteredPropertyContainer mRegisteredChildProperties;
+ PropertyDefaultValueContainer mPropertyDefaultValues;
};
} // namespace Internal