Tizen Native API

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::RenderTask 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::ImageView Dali::Toolkit::Scrollable Dali::Toolkit::ScrollBar Dali::Toolkit::TableView Dali::Toolkit::TextField Dali::Toolkit::TextLabel

Public Types

enum  Capability
 An Handle's capabilities 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
 Query whether an handle supports a given capability.
unsigned int GetPropertyCount () const
 Query how many properties are provided by an handle.
std::string GetPropertyName (Property::Index index) const
 Query the name of a property.
Property::Index GetPropertyIndex (const std::string &name) const
 Query the index of a property.
bool IsPropertyWritable (Property::Index index) const
 Query whether a property can be set using SetProperty().
bool IsPropertyAnimatable (Property::Index index) const
 Query whether a writable property can be the target of an animation or constraint.
bool IsPropertyAConstraintInput (Property::Index index) const
 Query whether a property can be used as in input to a constraint.
Property::Type GetPropertyType (Property::Index index) const
 Query the type of a property.
void SetProperty (Property::Index index, const Property::Value &propertyValue)
 Set the value of an existing property.
Property::Index RegisterProperty (const std::string &name, const Property::Value &propertyValue)
 Register a new animatable property.
Property::Index RegisterProperty (const std::string &name, const Property::Value &propertyValue, Property::AccessMode accessMode)
 Register a new property.
Property::Value GetProperty (Property::Index index) const
 Retrieve a property value.
template<typename T >
GetProperty (Property::Index index) const
 Convenience function for obtaining a property of a known type.
void GetPropertyIndices (Property::IndexContainer &indices) const
 Retrieve all the property indices for this object (including custom properties).
PropertyNotification AddPropertyNotification (Property::Index index, const PropertyCondition &condition)
 Add a property notification to this object.
PropertyNotification AddPropertyNotification (Property::Index index, int componentIndex, const PropertyCondition &condition)
 Add a property notification to this object.
void RemovePropertyNotification (Dali::PropertyNotification propertyNotification)
 Remove a property notification from this object.
void RemovePropertyNotifications ()
 Remove all property notifications from this object.
void RemoveConstraints ()
 Remove all constraints from an Object.
void RemoveConstraints (unsigned int tag)
 Remove all the constraint from the Object with a matching tag.

Static Public Member Functions

static Handle New ()
 Create a new object.
static Handle DownCast (BaseHandle handle)
 Downcast 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 :
2.4

Member Enumeration Documentation

An Handle's capabilities can be queried using Handle::Supports()

Since :
2.4
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 :
2.4

Constructor & Destructor Documentation

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

This constructor is used by Dali New() methods.

Since :
2.4
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 :
2.4

Dali::Handle is intended as a base class.

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

Since :
2.4
Dali::Handle::Handle ( const Handle handle)

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

Since :
2.4
Parameters:
[in]handleA reference to the copied handle

Member Function Documentation

Add a property notification to this object.

Since :
2.4
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 
)

Add a property notification to this object.

Since :
2.4
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

Retrieve a property value.

Since :
2.4
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 :
2.4
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

Query how many properties are provided by an handle.

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

Since :
2.4
Returns:
The number of properties.
Property::Index Dali::Handle::GetPropertyIndex ( const std::string &  name) const

Query the index of a property.

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

Since :
2.4
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.

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

Since :
2.4
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

Query the name of a property.

Since :
2.4
Parameters:
[in]indexThe index of the property.
Returns:
The name of the property.

Query the type of a property.

Since :
2.4
Parameters:
[in]indexThe index of the property.
Returns:
The type of the property.

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

Since :
2.4
Parameters:
[in]indexThe index of the property.
Returns:
True if the property can be used as a constraint input.

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

Since :
2.4
Parameters:
[in]indexThe index of the property.
Returns:
True if the property is animatable.

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

Since :
2.4
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 :
2.4
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 
)

Register a new animatable property.

Since :
2.4
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:
Property::Index Dali::Handle::RegisterProperty ( const std::string &  name,
const Property::Value propertyValue,
Property::AccessMode  accessMode 
)

Register a new property.

Properties can be set as non animatable using property attributes.

Since :
2.4
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:

Remove all constraints from an Object.

Since :
2.4
Precondition:
The object has been initialized.
void Dali::Handle::RemoveConstraints ( unsigned int  tag)

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

Since :
2.4
Parameters:
[in]tagThe tag of the constraints which will be removed
Precondition:
The Object has been initialized.

Remove a property notification from this object.

Since :
2.4
Parameters:
[in]propertyNotificationThe propertyNotification to be removed.

Remove all property notifications from this object.

Since :
2.4
void Dali::Handle::SetProperty ( Property::Index  index,
const Property::Value propertyValue 
)

Set the value of an existing property.

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

Since :
2.4
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

Query whether an handle supports a given capability.

Since :
2.4
Parameters:
[in]capabilityThe queried capability.
Returns:
True if the capability is supported.