Dali 3D User Interface Engine
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions
Dali::Internal::GestureDetector Class Referenceabstract

GestureDetectors analyse a stream of touch events and attempt to determine the intention of the user. More...

#include <gesture-detector-impl.h>

Inheritance diagram for Dali::Internal::GestureDetector:
Inheritance graph
[legend]
Collaboration diagram for Dali::Internal::GestureDetector:
Collaboration graph
[legend]

Public Member Functions

void Attach (Actor &actor)
 Attaches an actor to the gesture. More...
 
void Detach (Actor &actor)
 Detaches the attached actor from the gesture detector. More...
 
void DetachAll ()
 Detaches all the actors that have been attached to the gesture detector. More...
 
size_t GetAttachedActorCount () const
 Returns the number of actors attached to the gesture detector. More...
 
Dali::Actor GetAttachedActor (size_t index) const
  More...
 
const
GestureDetectorActorContainer
GetAttachedActorPointers () const
 Returns a const reference to the container of attached actor pointers. More...
 
Gesture::Type GetType () const
 Retrieves the type of GestureDetector. More...
 
bool IsAttached (Actor &actor) const
 Checks if the specified actor is still attached. More...
 
- Public Member Functions inherited from Dali::Internal::Object
 Object ()
 Constructor. More...
 
virtual void AddObserver (Observer &observer)
 Add an observer to the object. More...
 
virtual void RemoveObserver (Observer &observer)
 Remove an observer from the object. More...
 
virtual bool Supports (Capability capability) const
 Query whether an handle supports a given capability. More...
 
virtual unsigned int GetPropertyCount () const
 Query how many properties are provided by an handle. More...
 
virtual std::string GetPropertyName (Property::Index index) const
 Query the name of a property. More...
 
virtual Property::Index GetPropertyIndex (const std::string &name) const
 Query the index of a property. More...
 
virtual bool IsPropertyWritable (Property::Index index) const
 Query whether a property can be set using SetProperty(). More...
 
virtual bool IsPropertyAnimatable (Property::Index index) const
 Query whether a writable property can be the target of an animation or constraint. More...
 
virtual bool IsPropertyAConstraintInput (Property::Index index) const
 Query whether a property can be used as in input to a constraint. More...
 
virtual Property::Type GetPropertyType (Property::Index index) const
 Query the type of a property. More...
 
virtual void SetProperty (Property::Index index, const Property::Value &propertyValue)
 Set the value of an existing property. More...
 
virtual Property::Value GetProperty (Property::Index index) const
 Retrieve a property value. More...
 
virtual void GetPropertyIndices (Property::IndexContainer &indices) const
 Retrieve all the property indices for this object (including custom properties). More...
 
virtual Property::Index RegisterProperty (const std::string &name, const Property::Value &propertyValue)
 Register a new animatable property. More...
 
virtual Property::Index RegisterProperty (const std::string &name, const Property::Value &propertyValue, Property::AccessMode accessMode)
  More...
 
virtual Dali::PropertyNotification AddPropertyNotification (Property::Index index, int componentIndex, const Dali::PropertyCondition &condition)
 Add a property notification to this object. More...
 
virtual void RemovePropertyNotification (Dali::PropertyNotification propertyNotification)
 Remove a property notification from this object. More...
 
virtual void RemovePropertyNotifications ()
 Remove all property notifications from this object. More...
 
void AddUniformMapping (Property::Index propertyIndex, const std::string &uniformName) const
  More...
 
void RemoveUniformMapping (const std::string &uniformName)
  More...
 
void ApplyConstraint (ConstraintBase &constraint)
 Apply a constraint to an Object. More...
 
void RemoveConstraint (ConstraintBase &constraint)
 Remove one constraint from an Object. More...
 
void RemoveConstraints ()
 Remove all constraints from a Object. More...
 
void RemoveConstraints (unsigned int tag)
 Remove all constraints from a Object with a matching tag. More...
 
void SetTypeInfo (const TypeInfo *typeInfo)
 Called by TypeInfo to set the type-info that this object-impl is created by. More...
 
unsigned int CustomPropertyStartIndex ()
 
virtual int GetPropertyComponentIndex (Property::Index index) const
 Query whether the property is a component of a scene-graph property. More...
 
- Public Member Functions inherited from Dali::BaseObject
template<class T >
bool ConnectSignal (ConnectionTrackerInterface *connectionTracker, const std::string &signalName, const T &functor)
 Connects a void() functor to a specified signal. More...
 
bool DoAction (const std::string &actionName, const Property::Map &attributes)
 Perform action on this object with the given action name and attributes. More...
 
const std::string & GetTypeName () const
 Returns the type name for the Handle. More...
 
bool GetTypeInfo (Dali::TypeInfo &info) const
 Returns the type info for the Handle. More...
 
bool DoConnectSignal (ConnectionTrackerInterface *connectionTracker, const std::string &signalName, FunctorDelegate *functorDelegate)
 Not intended for application developers. More...
 
- Public Member Functions inherited from Dali::RefObject
void Reference ()
 Increment the object's reference count. More...
 
void Unreference ()
 Decrement the object's reference count. More...
 
int ReferenceCount ()
 Retrieve the object's reference count. More...
 

Protected Member Functions

 GestureDetector (Gesture::Type mType)
 Construct a new GestureDetector. More...
 
virtual ~GestureDetector ()
 A reference counted object may only be deleted by calling Unreference() More...
 
- Protected Member Functions inherited from Dali::Internal::Object
virtual ~Object ()
 A reference counted object may only be deleted by calling Unreference() More...
 
void OnSceneObjectAdd ()
 Called immediately by derived classes, after the scene-object has been created & passed to the scene-graph. More...
 
void OnSceneObjectRemove ()
 Called by derived classes, shortly before send a message to remove the scene-object. More...
 
virtual void OnPropertySet (Property::Index index, Property::Value propertyValue)
 For use in derived classes. More...
 
const TypeInfoGetTypeInfo () const
 Retrieves the TypeInfo for this object. More...
 
CustomPropertyMetadataFindCustomProperty (Property::Index index) const
 Helper to find custom property. More...
 
AnimatablePropertyMetadataFindAnimatableProperty (Property::Index index) const
 Helper to find animatable property. More...
 
Property::Index RegisterSceneGraphProperty (const std::string &name, Property::Index index, const Property::Value &propertyValue) const
 Helper to register a scene-graph property. More...
 
AnimatablePropertyMetadataRegisterAnimatableProperty (Property::Index index) const
 Check whether the animatable property is registered already, if not then register one. More...
 
EventThreadServicesGetEventThreadServices ()
 Get the event thread services object - used for sending messages to the scene graph Assert if called from the wrong thread. More...
 
const EventThreadServicesGetEventThreadServices () const
 Get the event thread services object - used for sending messages to the scene graph Assert if called from the wrong thread This is intentionally inline for performance reasons. More...
 
- Protected Member Functions inherited from Dali::BaseObject
 BaseObject ()
 Default constructor. More...
 
virtual ~BaseObject ()
 A reference counted object may only be deleted by calling Unreference(). More...
 
void RegisterObject ()
 Registers the object as created with the Object registry. More...
 
void UnregisterObject ()
 Unregisters the object from Object registry. More...
 
- Protected Member Functions inherited from Dali::RefObject
 RefObject ()
 Default constructor. More...
 
virtual ~RefObject ()
 RefObject is intended as a base class. More...
 
 RefObject (const RefObject &rhs)
 Copy constructor. More...
 
RefObjectoperator= (const RefObject &rhs)
 Assignment operator. More...
 
- Protected Member Functions inherited from Dali::Internal::Object::Observer
virtual ~Observer ()
 Virtual destructor. More...
 

Protected Attributes

Gesture::Type mType
 The gesture detector will detect this type of gesture. More...
 
GestureDetectorActorContainer mAttachedActors
 Object::Observer is used to provide weak-pointer behaviour. More...
 
GestureEventProcessormGestureEventProcessor
 A reference to the gesture event processor. More...
 

Private Member Functions

 GestureDetector (const GestureDetector &)
 
GestureDetectoroperator= (const GestureDetector &rhs)
 
virtual void SceneObjectAdded (Object &object)
 Called immediately after the object has created & passed ownership of a scene-graph object. More...
 
virtual void SceneObjectRemoved (Object &object)
 Called immediately after the object has created & passed ownership of a scene-graph object. More...
 
virtual void ObjectDestroyed (Object &object)
 Called shortly before the object itself is destroyed; no further callbacks will be received. More...
 
virtual void OnActorAttach (Actor &actor)=0
 For use in derived classes, called after an actor is attached. More...
 
virtual void OnActorDetach (Actor &actor)=0
 For use in derived classes, called after an actor is detached. More...
 
virtual void OnActorDestroyed (Object &object)=0
 For use in derived classes, called when an attached actor is destroyed. More...
 
virtual unsigned int GetDefaultPropertyCount () const
 Query how many default properties the derived class supports. More...
 
virtual void GetDefaultPropertyIndices (Property::IndexContainer &indices) const
 Retrieve all the indices that are associated with the default properties supported by the derived class. More...
 
virtual const char * GetDefaultPropertyName (Property::Index index) const
 Query how many default properties the derived class supports. More...
 
virtual Property::Index GetDefaultPropertyIndex (const std::string &name) const
 Query the index of a default property. More...
 
virtual bool IsDefaultPropertyWritable (Property::Index index) const
 Query whether a default property is writable. More...
 
virtual bool IsDefaultPropertyAnimatable (Property::Index index) const
 Query whether a default property is animatable. More...
 
virtual bool IsDefaultPropertyAConstraintInput (Property::Index index) const
 Query whether a default property can be used as an input to a constraint. More...
 
virtual Property::Type GetDefaultPropertyType (Property::Index index) const
 Query the type of a default property. More...
 
virtual void SetDefaultProperty (Property::Index index, const Property::Value &propertyValue)
 Set the value of a default property. More...
 
virtual Property::Value GetDefaultProperty (Property::Index index) const
 Retrieve a default property value. More...
 
virtual const
SceneGraph::PropertyOwner
GetSceneObject () const
 Retrieve the scene-graph object added by this object. More...
 
virtual const
SceneGraph::PropertyBase
GetSceneObjectAnimatableProperty (Property::Index index) const
 Retrieve an animatable property owned by the scene-graph object. More...
 
virtual const PropertyInputImplGetSceneObjectInputProperty (Property::Index index) const
 Retrieve a constraint input-property owned by the scene-graph object. More...
 

Additional Inherited Members

- Public Types inherited from Dali::Internal::Object
typedef Dali::Handle::Capability Capability
 

Detailed Description

GestureDetectors analyse a stream of touch events and attempt to determine the intention of the user.

An actor is attached to a gesture detector and if the detector recognises a pattern in its analysis, it will emit a detected signal to the application.

This is the base class for different gesture detectors available and provides functionality that is common to all the gesture detectors.

.0

See Also
Gesture

Definition at line 59 of file gesture-detector-impl.h.

Constructor & Destructor Documentation

Dali::Internal::GestureDetector::GestureDetector ( Gesture::Type  mType)
protected

Construct a new GestureDetector.

Definition at line 37 of file gesture-detector-impl.cpp.

Dali::Internal::GestureDetector::~GestureDetector ( )
protectedvirtual
Dali::Internal::GestureDetector::GestureDetector ( const GestureDetector )
private

Member Function Documentation

void Dali::Internal::GestureDetector::Attach ( Actor actor)

Attaches an actor to the gesture.

The detected signal will be dispatched when the gesture occurs on the attached actor. .0

Parameters
[in]actorThe actor to attach to the gesture detector
Precondition
The gesture detector has been initialized.
Note
You can attach several actors to a gesture detector.

Definition at line 64 of file gesture-detector-impl.cpp.

References Dali::Internal::ActorGestureData::AddGestureDetector(), Dali::Internal::GestureEventProcessor::AddGestureDetector(), Dali::Internal::Object::AddObserver(), Dali::Internal::Actor::GetGestureData(), IsAttached(), mAttachedActors, mGestureEventProcessor, and OnActorAttach().

Here is the call graph for this function:

void Dali::Internal::GestureDetector::Detach ( Actor actor)

Detaches the attached actor from the gesture detector.

.0

Parameters
[in]actorThe actor to detach from the gesture detector.
Precondition
The gesture detector has been initialized.
The specified actor has been attached to the gesture detector.

Definition at line 87 of file gesture-detector-impl.cpp.

References Dali::Internal::Actor::GetGestureData(), Dali::Internal::Stage::IsInstalled(), mAttachedActors, mGestureEventProcessor, OnActorDetach(), Dali::Internal::ActorGestureData::RemoveGestureDetector(), Dali::Internal::GestureEventProcessor::RemoveGestureDetector(), and Dali::Internal::Object::RemoveObserver().

Here is the call graph for this function:

void Dali::Internal::GestureDetector::DetachAll ( )

Detaches all the actors that have been attached to the gesture detector.

.0

Precondition
The gesture detector has been initialized.
At least one actor has been attached to the gesture detector.

Definition at line 119 of file gesture-detector-impl.cpp.

References Dali::Internal::Actor::GetGestureData(), Dali::Internal::Stage::IsInstalled(), mAttachedActors, mGestureEventProcessor, OnActorDetach(), Dali::Internal::ActorGestureData::RemoveGestureDetector(), Dali::Internal::GestureEventProcessor::RemoveGestureDetector(), and Dali::Internal::Object::RemoveObserver().

Here is the call graph for this function:

Dali::Actor Dali::Internal::GestureDetector::GetAttachedActor ( size_t  index) const

Definition at line 156 of file gesture-detector-impl.cpp.

References mAttachedActors.

size_t Dali::Internal::GestureDetector::GetAttachedActorCount ( ) const

Returns the number of actors attached to the gesture detector.

.0

Returns
The count
Precondition
The gesture detector has been initialized.

Definition at line 151 of file gesture-detector-impl.cpp.

References mAttachedActors.

const GestureDetectorActorContainer& Dali::Internal::GestureDetector::GetAttachedActorPointers ( ) const
inline

Returns a const reference to the container of attached actor pointers.

Returns
A const reference to the attached internal actors.

Definition at line 92 of file gesture-detector-impl.h.

References mAttachedActors.

Property::Value Dali::Internal::GestureDetector::GetDefaultProperty ( Property::Index  index) const
privatevirtual

Retrieve a default property value.

Parameters
[in]indexThe index of the property.
Returns
The property value.

Implements Dali::Internal::Object.

Reimplemented in Dali::Internal::PanGestureDetector.

Definition at line 243 of file gesture-detector-impl.cpp.

References Dali::Property::Value().

Here is the call graph for this function:

unsigned int Dali::Internal::GestureDetector::GetDefaultPropertyCount ( ) const
privatevirtual

Query how many default properties the derived class supports.

Returns
The number of default properties.

Implements Dali::Internal::Object.

Reimplemented in Dali::Internal::PanGestureDetector.

Definition at line 199 of file gesture-detector-impl.cpp.

Property::Index Dali::Internal::GestureDetector::GetDefaultPropertyIndex ( const std::string &  name) const
privatevirtual

Query the index of a default property.

Parameters
[in]nameThe name of the property.
Returns
The index of the property, or Property::INVALID_INDEX if no default property exists with the given name.

Implements Dali::Internal::Object.

Reimplemented in Dali::Internal::PanGestureDetector.

Definition at line 213 of file gesture-detector-impl.cpp.

void Dali::Internal::GestureDetector::GetDefaultPropertyIndices ( Property::IndexContainer indices) const
privatevirtual

Retrieve all the indices that are associated with the default properties supported by the derived class.

Returns
A container of default property indices.
Note
The deriving class must not modify the existing elements in the container.

Implements Dali::Internal::Object.

Reimplemented in Dali::Internal::PanGestureDetector.

Definition at line 204 of file gesture-detector-impl.cpp.

const char * Dali::Internal::GestureDetector::GetDefaultPropertyName ( Property::Index  index) const
privatevirtual

Query how many default properties the derived class supports.

Returns
The number of default properties.

Implements Dali::Internal::Object.

Reimplemented in Dali::Internal::PanGestureDetector.

Definition at line 208 of file gesture-detector-impl.cpp.

Property::Type Dali::Internal::GestureDetector::GetDefaultPropertyType ( Property::Index  index) const
privatevirtual

Query the type of a default property.

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

Implements Dali::Internal::Object.

Reimplemented in Dali::Internal::PanGestureDetector.

Definition at line 233 of file gesture-detector-impl.cpp.

References Dali::Property::NONE.

const SceneGraph::PropertyOwner * Dali::Internal::GestureDetector::GetSceneObject ( ) const
privatevirtual

Retrieve the scene-graph object added by this object.

Returns
A pointer to the object, or NULL if no object has been added to the scene-graph.

Implements Dali::Internal::Object.

Reimplemented in Dali::Internal::PanGestureDetector.

Definition at line 248 of file gesture-detector-impl.cpp.

const SceneGraph::PropertyBase * Dali::Internal::GestureDetector::GetSceneObjectAnimatableProperty ( Property::Index  index) const
privatevirtual

Retrieve an animatable property owned by the scene-graph object.

Precondition
-1 < index < GetPropertyCount().
Parameters
[in]indexThe index of the property.
Returns
A dereferenceable pointer to a property, or NULL if a scene-object does not exist with this property.

Implements Dali::Internal::Object.

Reimplemented in Dali::Internal::PanGestureDetector.

Definition at line 253 of file gesture-detector-impl.cpp.

const PropertyInputImpl * Dali::Internal::GestureDetector::GetSceneObjectInputProperty ( Property::Index  index) const
privatevirtual

Retrieve a constraint input-property owned by the scene-graph object.

Precondition
-1 < index < GetPropertyCount().
Parameters
[in]indexThe index of the property.
Returns
A dereferenceable pointer to an input property, or NULL if a scene-object does not exist with this property.

Implements Dali::Internal::Object.

Reimplemented in Dali::Internal::PanGestureDetector.

Definition at line 258 of file gesture-detector-impl.cpp.

Gesture::Type Dali::Internal::GestureDetector::GetType ( ) const
inline
bool Dali::Internal::GestureDetector::IsAttached ( Actor actor) const

Checks if the specified actor is still attached.

Parameters
[in]actorThe actor to check.
Returns
true, if the actor is attached, false otherwise.

Definition at line 168 of file gesture-detector-impl.cpp.

References mAttachedActors.

Referenced by Attach(), Dali::Internal::anonymous_namespace{pan-gesture-processor.cpp}::IsNotAttachedAndOutsideTouchesRangeFunctor::operator()(), Dali::Internal::anonymous_namespace{long-press-gesture-processor.cpp}::IsNotAttachedFunctor::operator()(), and Dali::Internal::anonymous_namespace{pinch-gesture-processor.cpp}::IsNotAttachedFunctor::operator()().

Here is the caller graph for this function:

bool Dali::Internal::GestureDetector::IsDefaultPropertyAConstraintInput ( Property::Index  index) const
privatevirtual

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

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

Implements Dali::Internal::Object.

Reimplemented in Dali::Internal::PanGestureDetector.

Definition at line 228 of file gesture-detector-impl.cpp.

bool Dali::Internal::GestureDetector::IsDefaultPropertyAnimatable ( Property::Index  index) const
privatevirtual

Query whether a default property is animatable.

This determines whether the property can be the target of an animation or constraint.

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

Implements Dali::Internal::Object.

Reimplemented in Dali::Internal::PanGestureDetector.

Definition at line 223 of file gesture-detector-impl.cpp.

bool Dali::Internal::GestureDetector::IsDefaultPropertyWritable ( Property::Index  index) const
privatevirtual

Query whether a default property is writable.

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

Implements Dali::Internal::Object.

Reimplemented in Dali::Internal::PanGestureDetector.

Definition at line 218 of file gesture-detector-impl.cpp.

void Dali::Internal::GestureDetector::ObjectDestroyed ( Object object)
privatevirtual

Called shortly before the object itself is destroyed; no further callbacks will be received.

Parameters
[in]objectThe object object.

Implements Dali::Internal::Object::Observer.

Definition at line 173 of file gesture-detector-impl.cpp.

References Dali::Internal::Stage::IsInstalled(), mAttachedActors, mGestureEventProcessor, OnActorDestroyed(), and Dali::Internal::GestureEventProcessor::RemoveGestureDetector().

Here is the call graph for this function:

virtual void Dali::Internal::GestureDetector::OnActorAttach ( Actor actor)
privatepure virtual

For use in derived classes, called after an actor is attached.

Parameters
[in]actorThe actor that is being attached.

Implemented in Dali::Internal::PanGestureDetector, Dali::Internal::TapGestureDetector, Dali::Internal::LongPressGestureDetector, and Dali::Internal::PinchGestureDetector.

Referenced by Attach().

Here is the caller graph for this function:

virtual void Dali::Internal::GestureDetector::OnActorDestroyed ( Object object)
privatepure virtual

For use in derived classes, called when an attached actor is destroyed.

Parameters
[in]objectThe object (Actor's base class) that has been destroyed.
Note
Derived classes should not call any Actor specific APIs in this method as the Actor's destructor would have already been called.

Implemented in Dali::Internal::PanGestureDetector, Dali::Internal::TapGestureDetector, Dali::Internal::LongPressGestureDetector, and Dali::Internal::PinchGestureDetector.

Referenced by ObjectDestroyed().

Here is the caller graph for this function:

virtual void Dali::Internal::GestureDetector::OnActorDetach ( Actor actor)
privatepure virtual

For use in derived classes, called after an actor is detached.

Parameters
[in]actorThe actor that is being detached.

Implemented in Dali::Internal::PanGestureDetector, Dali::Internal::TapGestureDetector, Dali::Internal::LongPressGestureDetector, and Dali::Internal::PinchGestureDetector.

Referenced by Detach(), and DetachAll().

Here is the caller graph for this function:

GestureDetector& Dali::Internal::GestureDetector::operator= ( const GestureDetector rhs)
private
virtual void Dali::Internal::GestureDetector::SceneObjectAdded ( Object object)
inlineprivatevirtual

Called immediately after the object has created & passed ownership of a scene-graph object.

Parameters
[in]objectThe object object.

Implements Dali::Internal::Object::Observer.

Definition at line 136 of file gesture-detector-impl.h.

virtual void Dali::Internal::GestureDetector::SceneObjectRemoved ( Object object)
inlineprivatevirtual

Called immediately after the object has created & passed ownership of a scene-graph object.

Parameters
[in]objectThe object object.

Implements Dali::Internal::Object::Observer.

Definition at line 141 of file gesture-detector-impl.h.

void Dali::Internal::GestureDetector::SetDefaultProperty ( Property::Index  index,
const Property::Value propertyValue 
)
privatevirtual

Set the value of a default property.

Precondition
The property types match i.e. propertyValue.GetType() is equal to GetPropertyType(index).
Parameters
[in]indexThe index of the property.
[in]propertyValueThe new value of the property.

Implements Dali::Internal::Object.

Reimplemented in Dali::Internal::PanGestureDetector.

Definition at line 238 of file gesture-detector-impl.cpp.

Member Data Documentation

GestureDetectorActorContainer Dali::Internal::GestureDetector::mAttachedActors
protected
GestureEventProcessor& Dali::Internal::GestureDetector::mGestureEventProcessor
protected
Gesture::Type Dali::Internal::GestureDetector::mType
protected

The gesture detector will detect this type of gesture.

Definition at line 237 of file gesture-detector-impl.h.

Referenced by GetType().


The documentation for this class was generated from the following files:
Dali Docs Home
Read more about Dali