Tizen Native API  4.0

Dali::Handle is a handle to an internal property owning Dali object that can have constraints applied to it. More...

Inheritance diagram for Dali::Handle:
Dali::BaseHandle Dali::Actor Dali::GestureDetector Dali::LinearConstrainer Dali::Path Dali::Renderer Dali::RenderTask Dali::Shader Dali::CameraActor Dali::CustomActor Dali::Layer Dali::LongPressGestureDetector Dali::PanGestureDetector Dali::PinchGestureDetector Dali::TapGestureDetector Dali::Toolkit::Control Dali::Toolkit::Alignment Dali::Toolkit::Button Dali::Toolkit::FlexContainer Dali::Toolkit::ImageView Dali::Toolkit::Model3dView Dali::Toolkit::ProgressBar Dali::Toolkit::Scrollable Dali::Toolkit::ScrollBar Dali::Toolkit::Slider Dali::Toolkit::TableView Dali::Toolkit::TextEditor Dali::Toolkit::TextField Dali::Toolkit::TextLabel Dali::Toolkit::VideoView Dali::WidgetView::WidgetView

Public Types

enum  Capability
 Enumeration for Handle's capabilities that can be queried using Handle::Supports(). More...

Public Member Functions

 Handle (Dali::Internal::Object *handle)
 This constructor is used by Dali New() methods.
 Handle ()
 This constructor provides an uninitialized Dali::Handle.
 ~Handle ()
 Dali::Handle is intended as a base class.
 Handle (const Handle &handle)
 This copy constructor is required for (smart) pointer semantics.
Handleoperator= (const Handle &rhs)
 This assignment operator is required for (smart) pointer semantics.
bool Supports (Capability capability) const
 Queries whether an handle supports a given capability.
unsigned int GetPropertyCount () const
 Queries how many properties are provided by an handle.
std::string GetPropertyName (Property::Index index) const
 Queries the name of a property.
Property::Index GetPropertyIndex (const std::string &name) const
 Queries the index of a property.
bool IsPropertyWritable (Property::Index index) const
 Queries whether a property can be set using SetProperty().
bool IsPropertyAnimatable (Property::Index index) const
 Queries whether a writable property can be the target of an animation or constraint.
bool IsPropertyAConstraintInput (Property::Index index) const
 Queries whether a property can be used as in input to a constraint.
Property::Type GetPropertyType (Property::Index index) const
 Queries the type of a property.
void SetProperty (Property::Index index, const Property::Value &propertyValue)
 Sets the value of an existing property.
Property::Index RegisterProperty (const std::string &name, const Property::Value &propertyValue)
 Registers a new animatable property.
Property::Index RegisterProperty (const std::string &name, const Property::Value &propertyValue, Property::AccessMode accessMode)
 Registers a new property.
Property::Value GetProperty (Property::Index index) const
 Retrieves a property value.
template<typename T >
GetProperty (Property::Index index) const
 Convenience function for obtaining a property of a known type.
Property::Value GetCurrentProperty (Property::Index index) const
 Retrieves the latest value of the property from the scene-graph.
template<typename T >
GetCurrentProperty (Property::Index index) const
 Convenience function for obtaining the current value of a property of a known type.
void GetPropertyIndices (Property::IndexContainer &indices) const
 Retrieves all the property indices for this object (including custom properties).
PropertyNotification AddPropertyNotification (Property::Index index, const PropertyCondition &condition)
 Adds a property notification to this object.
PropertyNotification AddPropertyNotification (Property::Index index, int componentIndex, const PropertyCondition &condition)
 Adds a property notification to this object.
void RemovePropertyNotification (Dali::PropertyNotification propertyNotification)
 Removes a property notification from this object.
void RemovePropertyNotifications ()
 Removes all property notifications from this object.
void RemoveConstraints ()
 Removes all constraints from an Object.
void RemoveConstraints (unsigned int tag)
 Removes all the constraint from the Object with a matching tag.

Static Public Member Functions

static Handle New ()
 Creates a new object.
static Handle DownCast (BaseHandle handle)
 Downcasts to a handle.

Detailed Description

Dali::Handle is a handle to an internal property owning Dali object that can have constraints applied to it.

Since:
3.0, DALi version 1.0.0

Member Enumeration Documentation

Enumeration for Handle's capabilities that can be queried using Handle::Supports().

Since:
3.0, DALi version 1.0.0
Enumerator:
DYNAMIC_PROPERTIES 

Some objects support dynamic property creation at run-time.

New properties are registered by calling RegisterProperty() with an unused property name.

Since:
3.0, DALi version 1.0.0

Constructor & Destructor Documentation

Dali::Handle::Handle ( Dali::Internal::Object *  handle)

This constructor is used by Dali New() methods.

Since:
3.0, DALi version 1.0.0
Parameters:
[in]handleA pointer to a newly allocated Dali resource

This constructor provides an uninitialized Dali::Handle.

This should be initialized with a Dali New() method before use. Methods called on an uninitialized Dali::Handle will assert.

 Handle handle; // uninitialized
 handle.SomeMethod(); // unsafe! This will assert

 handle = SomeClass::New(); // now initialized
 handle.SomeMethod(); // safe
Since:
3.0, DALi version 1.0.0

Dali::Handle is intended as a base class.

This is non-virtual since derived Handle types must not contain data or virtual methods.

Since:
3.0, DALi version 1.0.0
Dali::Handle::Handle ( const Handle handle)

This copy constructor is required for (smart) pointer semantics.

Since:
3.0, DALi version 1.0.0
Parameters:
[in]handleA reference to the copied handle

Member Function Documentation

Adds a property notification to this object.

Since:
3.0, DALi version 1.0.0
Parameters:
[in]indexThe index of the property
[in]conditionThe notification will be triggered when this condition is satisfied
Returns:
A handle to the newly created PropertyNotification
PropertyNotification Dali::Handle::AddPropertyNotification ( Property::Index  index,
int  componentIndex,
const PropertyCondition condition 
)

Adds a property notification to this object.

Since:
3.0, DALi version 1.0.0
Parameters:
[in]indexThe index of the property
[in]componentIndexIndex to the component of a complex property such as a Vector
[in]conditionThe notification will be triggered when this condition is satisfied
Returns:
A handle to the newly created PropertyNotification

Retrieves the latest value of the property from the scene-graph.

Since:
4.0, DALi version 1.2.41
Parameters:
[in]indexThe index of the property
Returns:
The property value
template<typename T >
T Dali::Handle::GetCurrentProperty ( Property::Index  index) const

Convenience function for obtaining the current value of a property of a known type.

Since:
4.0, DALi version 1.2.41
Parameters:
[in]indexThe index of the property
Returns:
The property value
Precondition:
The property types match i.e. PropertyTypes::Get<T>() is equal to GetPropertyType(index).

Retrieves a property value.

Since:
3.0, DALi version 1.0.0
Parameters:
[in]indexThe index of the property
Returns:
The property value
template<typename T >
T Dali::Handle::GetProperty ( Property::Index  index) const

Convenience function for obtaining a property of a known type.

Since:
3.0, DALi version 1.0.0
Parameters:
[in]indexThe index of the property
Returns:
The property value
Precondition:
The property types match i.e. PropertyTypes::Get<T>() is equal to GetPropertyType(index).
unsigned int Dali::Handle::GetPropertyCount ( ) const

Queries how many properties are provided by an handle.

This may vary between instances of a class, if dynamic properties are supported.

Since:
3.0, DALi version 1.0.0
Returns:
The number of properties
Property::Index Dali::Handle::GetPropertyIndex ( const std::string &  name) const

Queries the index of a property.

Returns the first property index that matches the given name exactly.

Since:
3.0, DALi version 1.0.0
Parameters:
[in]nameThe name of the property
Returns:
The index of the property, or Property::INVALID_INDEX if no property exists with the given name

Retrieves all the property indices for this object (including custom properties).

Since:
3.0, DALi version 1.0.0
Parameters:
[out]indicesA container of property indices for this object
Note:
The added container is cleared.
std::string Dali::Handle::GetPropertyName ( Property::Index  index) const

Queries the name of a property.

Since:
3.0, DALi version 1.0.0
Parameters:
[in]indexThe index of the property
Returns:
The name of the property

Queries the type of a property.

Since:
3.0, DALi version 1.0.0
Parameters:
[in]indexThe index of the property
Returns:
The type of the property

Queries whether a property can be used as in input to a constraint.

Since:
3.0, DALi version 1.0.0
Parameters:
[in]indexThe index of the property
Returns:
True if the property can be used as a constraint input

Queries whether a writable property can be the target of an animation or constraint.

Since:
3.0, DALi version 1.0.0
Parameters:
[in]indexThe index of the property
Returns:
True if the property is animatable

Queries whether a property can be set using SetProperty().

Since:
3.0, DALi version 1.0.0
Parameters:
[in]indexThe index of the property
Returns:
True if the property is writable
Precondition:
Property::INVALID_INDEX < index.
Handle& Dali::Handle::operator= ( const Handle rhs)

This assignment operator is required for (smart) pointer semantics.

Since:
3.0, DALi version 1.0.0
Parameters:
[in]rhsA reference to the copied handle
Returns:
A reference to this
Property::Index Dali::Handle::RegisterProperty ( const std::string &  name,
const Property::Value propertyValue 
)

Registers a new animatable property.

Since:
3.0, DALi version 1.0.0
Parameters:
[in]nameThe name of the property
[in]propertyValueThe new value of the property
Returns:
The index of the property or Property::INVALID_INDEX if registration failed
Precondition:
The object supports dynamic properties i.e. Supports(Handle::DYNAMIC_PROPERTIES) returns true. Property names are expected to be unique, but this is not enforced. Property indices are unique to each registered custom property in a given object. returns Property::INVALID_INDEX if registration failed. This can happen if you try to register animatable property on an object that does not have scene graph object.
Note:
Only the following types can be animated:
If a property with the desired name already exists, then the value given is just set.
Property::Index Dali::Handle::RegisterProperty ( const std::string &  name,
const Property::Value propertyValue,
Property::AccessMode  accessMode 
)

Registers a new property.

Properties can be set as non animatable using property attributes.

Since:
3.0, DALi version 1.0.0
Parameters:
[in]nameThe name of the property
[in]propertyValueThe new value of the property
[in]accessModeThe property access mode (writable, animatable etc)
Returns:
The index of the property
Precondition:
The handle supports dynamic properties i.e. Supports(Handle::DYNAMIC_PROPERTIES) returns true.
name is unused i.e. GetPropertyIndex(name) returns PropertyIndex::INVALID.
Note:
Only the following types can be animated:
If a property with the desired name already exists, then the value given is just set.

Removes all constraints from an Object.

Since:
3.0, DALi version 1.0.0
Precondition:
The object has been initialized.
void Dali::Handle::RemoveConstraints ( unsigned int  tag)

Removes all the constraint from the Object with a matching tag.

Since:
3.0, DALi version 1.0.0
Parameters:
[in]tagThe tag of the constraints which will be removed
Precondition:
The Object has been initialized.

Removes a property notification from this object.

Since:
3.0, DALi version 1.0.0
Parameters:
[in]propertyNotificationThe propertyNotification to be removed

Removes all property notifications from this object.

Since:
3.0, DALi version 1.0.0
void Dali::Handle::SetProperty ( Property::Index  index,
const Property::Value propertyValue 
)

Sets the value of an existing property.

Property should be write-able. Setting a read-only property is a no-op.

Since:
3.0, DALi version 1.0.0
Parameters:
[in]indexThe index of the property
[in]propertyValueThe new value of the property
Precondition:
The property types match i.e. propertyValue.GetType() is equal to GetPropertyType(index).
bool Dali::Handle::Supports ( Capability  capability) const

Queries whether an handle supports a given capability.

Since:
3.0, DALi version 1.0.0
Parameters:
[in]capabilityThe queried capability
Returns:
True if the capability is supported