#define __DALI_INTERNAL_OBJECT_H__
/*
- * Copyright (c) 2014 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.
#include <dali/public-api/object/property-index-ranges.h>
#include <dali/public-api/object/property-input.h>
#include <dali/public-api/object/property-notification.h>
-#include <dali/internal/common/owner-container.h>
+#include <dali/devel-api/common/owner-container.h>
#include <dali/internal/event/common/event-thread-services.h>
#include <dali/internal/event/common/property-input-impl.h>
#include <dali/internal/event/common/property-metadata.h>
typedef ConstraintContainer::iterator ConstraintIter;
typedef ConstraintContainer::const_iterator ConstraintConstIter;
+
/**
* A base class for objects which optionally provide properties.
* The concrete derived class is responsible for implementing the property system methods.
virtual Property::Index GetPropertyIndex( const std::string& name ) const;
/**
+ * @copydoc Dali::Handle::GetPropertyIndex()
+ */
+ virtual Property::Index GetPropertyIndex( Property::Index key ) const;
+
+ /**
+ * @copydoc Dali::Handle::GetPropertyIndex()
+ */
+ virtual Property::Index GetPropertyIndex( Property::Key key ) const;
+
+ /**
* @copydoc Dali::Handle::IsPropertyWritable()
*/
virtual bool IsPropertyWritable( Property::Index index ) const;
virtual Property::Value GetProperty( Property::Index index ) const;
/**
+ * @brief Retrieves the latest value of the property on the scene-graph.
+ * @param[in] index The index of the property required.
+ * @return The latest value of the property on the scene-graph.
+ */
+ virtual Property::Value GetCurrentProperty( Property::Index index ) const;
+
+ /**
* @copydoc Dali::Handle::GetPropertyIndices()
*/
virtual void GetPropertyIndices( Property::IndexContainer& indices ) const;
virtual Property::Index RegisterProperty( const std::string& name, const Property::Value& propertyValue );
/**
+ * @copydoc Dali::Handle::RegisterProperty()
+ */
+ virtual Property::Index RegisterProperty( const std::string& name, Property::Index key, const Property::Value& propertyValue );
+
+ /**
* @copydoc Dali::Handle::RegisterProperty(std::string name, Property::Value propertyValue, Property::AccessMode accessMode)
*/
virtual Property::Index RegisterProperty( const std::string& name, const Property::Value& propertyValue, Property::AccessMode accessMode );
/**
+ * @brief Implementing method for this override
+ */
+ virtual Property::Index RegisterProperty( const std::string& name, Property::Index key, const Property::Value& propertyValue, Property::AccessMode accessMode );
+
+ /**
* @copydoc Dali::Handle::AddPropertyNotification()
*/
virtual Dali::PropertyNotification AddPropertyNotification( Property::Index index,
*/
virtual void RemovePropertyNotifications();
- // Constraints
+ /******************************** Uniform Mappings ********************************/
+
+ /**
+ * @copydoc Dali::Handle::AddUniformMapping()
+ */
+ void AddUniformMapping( Property::Index propertyIndex, const std::string& uniformName ) const;
+
+ /**
+ * @copydoc Dali::Handle::RemoveUniformMapping( )
+ */
+ void RemoveUniformMapping( const std::string& uniformName );
+
+ /******************************** Constraints ********************************/
/**
* Apply a constraint to an Object.
return PROPERTY_CUSTOM_START_INDEX;
}
- // To be overridden by deriving classes
+ /******************** To be overridden by deriving classes ********************/
/**
* Retrieve the scene-graph object added by this object.
virtual const SceneGraph::PropertyBase* GetSceneObjectAnimatableProperty( Property::Index index ) const = 0;
/**
- * Retrieve an constraint input-property owned by the scene-graph object.
+ * Retrieve a constraint input-property owned by the scene-graph object.
* @pre -1 < index < GetPropertyCount().
* @param[in] index The index of the property.
* @return A dereferenceable pointer to an input property, or NULL if a scene-object does not exist with this property.
void OnSceneObjectRemove();
/**
+ * For overriding by derived classes to return the parent of this object.
+ */
+ virtual Object* GetParentObject() const
+ {
+ // By default the Object does not have a parent
+ return NULL;
+ };
+
+ /**
* For use in derived classes.
- * This is called after a non animatable custom property is set.
+ * This is called after a property is set.
* @param [in] index The index of the property.
* @param [in] propertyValue The value of the property.
*/
/**
* Helper to register a scene-graph property
* @param [in] name The name of the property.
+ * @param [in] key The key of the property
* @param [in] index The index of the property
* @param [in] value The value of the property.
* @return The index of the registered property or Property::INVALID_INDEX if registration failed.
*/
- Property::Index RegisterSceneGraphProperty(const std::string& name, Property::Index index, const Property::Value& propertyValue) const;
+ Property::Index RegisterSceneGraphProperty(const std::string& name, Property::Index key, Property::Index index, const Property::Value& propertyValue) const;
+
+ /**
+ * Check whether the animatable property is registered already, if not then register one.
+ * @param [in] index The index of the property
+ * @return pointer to the property.
+ */
+ AnimatablePropertyMetadata* RegisterAnimatableProperty(Property::Index index) const;
+
+ /**
+ * Resolve the index and name of child properties if any.
+ */
+ void ResolveChildProperties();
private: // Default property extensions for derived classes
virtual Property::Value GetDefaultProperty( Property::Index index ) const = 0;
/**
+ * Retrieve the latest scene-graph value of a default property.
+ * @param[in] index The index of the property.
+ * @return The latest scene-graph value of a default property.
+ */
+ virtual Property::Value GetDefaultPropertyCurrentValue( Property::Index index ) const = 0;
+
+ /**
* @todo this is virtual so that for now actor can override it,
* it needs to be removed and only have GetSceneObject but that requires changing actor and constraint logic
* Retrieve the scene-graph object added by this object.
void DisablePropertyNotifications();
/**
- * Get the value of the property.
- * @param [in] entry An entry from the property lookup container.
- * @return The new value of the property.
+ * Get the latest value of the property on the scene-graph.
+ * @param[in] entry An entry from the property lookup container.
+ * @return The latest value of the property.
*/
- Property::Value GetPropertyValue( const PropertyMetadata* entry ) const;
+ Property::Value GetCurrentPropertyValue( const PropertyMetadata* entry ) const;
/**
* Set the value of scene graph property.
typedef PropertyNotificationContainer::const_iterator PropertyNotificationContainerConstIter;
PropertyNotificationContainer* mPropertyNotifications; ///< Container of owned property notifications.
};
-
} // namespace Internal
// Helpers for public-api forwarding methods