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

This class emits a signal when a tap gesture occurs that meets the requirements set by the application. More...

#include <tap-gesture-detector-impl.h>

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

Public Member Functions

 TapGestureDetector ()
 Construct a new GestureDetector. More...
 
 TapGestureDetector (unsigned int tapsRequired)
 Construct a new GestureDetector with the specified parameters. More...
 
void SetTouchesRequired (unsigned int touches)
  More...
 
void SetMinimumTapsRequired (unsigned int minTaps)
 Set the minimum number of taps required. More...
 
void SetMaximumTapsRequired (unsigned int maxTaps)
 Set the maximum number of taps required. More...
 
unsigned int GetMinimumTapsRequired () const
 Retrieves the minimum number of taps required. More...
 
unsigned int GetMaximumTapsRequired () const
 Set the maximum number of taps required. More...
 
unsigned int GetTouchesRequired () const
  More...
 
void EmitTapGestureSignal (Dali::Actor tappedActor, const TapGesture &tap)
 Called by the TapGestureProcessor when a tap gesture event occurs within the bounds of our attached actor. More...
 
Dali::TapGestureDetector::DetectedSignalTypeDetectedSignal ()
 This signal is emitted when the specified tap is detected on the attached actor. More...
 
- Public Member Functions inherited from Dali::Internal::GestureDetector
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...
 

Static Public Member Functions

static TapGestureDetectorPtr New ()
 Create a new gesture detector. More...
 
static TapGestureDetectorPtr New (unsigned int tapsRequired)
 Create a new gesture detector with the specified parameters. More...
 
static bool DoConnectSignal (BaseObject *object, ConnectionTrackerInterface *tracker, const std::string &signalName, FunctorDelegate *functor)
 Connects a callback function with the object's signals. More...
 

Protected Member Functions

virtual ~TapGestureDetector ()
 A reference counted object may only be deleted by calling Unreference() More...
 
- Protected Member Functions inherited from Dali::Internal::GestureDetector
 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...
 

Private Member Functions

 TapGestureDetector (const TapGestureDetector &)
 
TapGestureDetectoroperator= (const TapGestureDetector &rhs)
 
virtual void OnActorAttach (Actor &actor)
 For use in derived classes, called after an actor is attached. More...
 
virtual void OnActorDetach (Actor &actor)
 For use in derived classes, called after an actor is detached. More...
 
virtual void OnActorDestroyed (Object &object)
 For use in derived classes, called when an attached actor is destroyed. More...
 

Private Attributes

Dali::TapGestureDetector::DetectedSignalType mDetectedSignal
 
unsigned int mMinimumTapsRequired
 
unsigned int mMaximumTapsRequired
 
unsigned int mTouchesRequired
 

Additional Inherited Members

- Public Types inherited from Dali::Internal::Object
typedef Dali::Handle::Capability Capability
 
- Protected Attributes inherited from Dali::Internal::GestureDetector
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...
 

Detailed Description

This class emits a signal when a tap gesture occurs that meets the requirements set by the application.

See TapGestureDetector::SetMinimumTapsRequired See TapGestureDetector::SetMaximumTapsRequired

A TapGesture is a discrete gesture, which means it does not have any state information attached to it. Please see TapGesture for more information.

The application programmer can use this gesture detector as follows:

detector.Attach(myActor);
detector.DetectedSignal().Connect(this, &MyApplication::OnTap);

.0

Note
Multi-touch taps are not currently supported. However, multiple taps (double & triple tap etc.) are supported.

Signals

Signal Name Method
tapDetected DetectedSignal()
See Also
TapGesture

Definition at line 41 of file tap-gesture-detector-impl.h.

Constructor & Destructor Documentation

Dali::Internal::TapGestureDetector::TapGestureDetector ( )

Construct a new GestureDetector.

Definition at line 66 of file tap-gesture-detector-impl.cpp.

Referenced by New().

Here is the caller graph for this function:

Dali::Internal::TapGestureDetector::TapGestureDetector ( unsigned int  tapsRequired)

Construct a new GestureDetector with the specified parameters.

Parameters
[in]tapsRequiredThe number of taps required.

Definition at line 74 of file tap-gesture-detector-impl.cpp.

Dali::Internal::TapGestureDetector::~TapGestureDetector ( )
protectedvirtual

A reference counted object may only be deleted by calling Unreference()

Definition at line 82 of file tap-gesture-detector-impl.cpp.

Dali::Internal::TapGestureDetector::TapGestureDetector ( const TapGestureDetector )
private

Member Function Documentation

Dali::TapGestureDetector::DetectedSignalType& Dali::Internal::TapGestureDetector::DetectedSignal ( )
inline

This signal is emitted when the specified tap is detected on the attached actor.

A callback of the following type may be connected:

void YourCallbackName( Actor actor, const TapGesture& gesture );

.0

Returns
The signal to connect to.
Precondition
The gesture detector has been initialized.

Definition at line 116 of file tap-gesture-detector-impl.h.

References mDetectedSignal.

Referenced by DoConnectSignal().

Here is the caller graph for this function:

bool Dali::Internal::TapGestureDetector::DoConnectSignal ( BaseObject object,
ConnectionTrackerInterface tracker,
const std::string &  signalName,
FunctorDelegate functor 
)
static

Connects a callback function with the object's signals.

Parameters
[in]objectThe object providing the signal.
[in]trackerUsed to disconnect the signal.
[in]signalNameThe signal to connect to.
[in]functorA newly allocated FunctorDelegate.
Returns
True if the signal was connected.
Postcondition
If a signal was connected, ownership of functor was passed to CallbackBase. Otherwise the caller is responsible for deleting the unused functor.

Definition at line 148 of file tap-gesture-detector-impl.cpp.

References DetectedSignal(), and Dali::Internal::anonymous_namespace{tap-gesture-detector-impl.cpp}::SIGNAL_TAP_DETECTED.

Here is the call graph for this function:

void Dali::Internal::TapGestureDetector::EmitTapGestureSignal ( Dali::Actor  tappedActor,
const TapGesture tap 
)

Called by the TapGestureProcessor when a tap gesture event occurs within the bounds of our attached actor.

Parameters
[in]tappedActorThe tapped actor.
[in]tapThe tap gesture.

Definition at line 140 of file tap-gesture-detector-impl.cpp.

References mDetectedSignal.

Referenced by Dali::Internal::anonymous_namespace{tap-gesture-processor.cpp}::EmitTapSignal().

Here is the caller graph for this function:

unsigned int Dali::Internal::TapGestureDetector::GetMaximumTapsRequired ( ) const

Set the maximum number of taps required.

The tap count is the number of times a user should "tap" the screen. .0

Parameters
[in]maximumTapsThe maximum taps required.
Precondition
The gesture detector has been initialized.
Note
The default is '1'.

Definition at line 130 of file tap-gesture-detector-impl.cpp.

References mMaximumTapsRequired.

Referenced by Dali::Internal::TapGestureProcessor::AddGestureDetector(), Dali::Internal::TapGestureProcessor::CheckGestureDetector(), Dali::Internal::TapGestureProcessor::GestureDetectorUpdated(), and Dali::Internal::TapGestureProcessor::UpdateDetection().

Here is the caller graph for this function:

unsigned int Dali::Internal::TapGestureDetector::GetMinimumTapsRequired ( ) const

Retrieves the minimum number of taps required.

.0

Returns
The minimum taps required.
Precondition
The gesture detector has been initialized.

Definition at line 125 of file tap-gesture-detector-impl.cpp.

References mMinimumTapsRequired.

Referenced by Dali::Internal::TapGestureProcessor::AddGestureDetector(), Dali::Internal::TapGestureProcessor::CheckGestureDetector(), Dali::Internal::TapGestureProcessor::GestureDetectorUpdated(), and Dali::Internal::TapGestureProcessor::UpdateDetection().

Here is the caller graph for this function:

unsigned int Dali::Internal::TapGestureDetector::GetTouchesRequired ( ) const
TapGestureDetectorPtr Dali::Internal::TapGestureDetector::New ( )
static

Create a new gesture detector.

Returns
A smart-pointer to the newly allocated detector.

Definition at line 56 of file tap-gesture-detector-impl.cpp.

References TapGestureDetector().

Referenced by Dali::TapGestureDetector::New().

Here is the call graph for this function:

Here is the caller graph for this function:

TapGestureDetectorPtr Dali::Internal::TapGestureDetector::New ( unsigned int  tapsRequired)
static

Create a new gesture detector with the specified parameters.

Parameters
[in]tapsRequiredThe number of taps required.
Returns
A smart-pointer to the newly allocated detector.

Definition at line 61 of file tap-gesture-detector-impl.cpp.

References TapGestureDetector().

Here is the call graph for this function:

void Dali::Internal::TapGestureDetector::OnActorAttach ( Actor actor)
privatevirtual

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

Parameters
[in]actorThe actor that is being attached.

Implements Dali::Internal::GestureDetector.

Definition at line 166 of file tap-gesture-detector-impl.cpp.

void Dali::Internal::TapGestureDetector::OnActorDestroyed ( Object object)
privatevirtual

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.

Implements Dali::Internal::GestureDetector.

Definition at line 176 of file tap-gesture-detector-impl.cpp.

void Dali::Internal::TapGestureDetector::OnActorDetach ( Actor actor)
privatevirtual

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

Parameters
[in]actorThe actor that is being detached.

Implements Dali::Internal::GestureDetector.

Definition at line 171 of file tap-gesture-detector-impl.cpp.

TapGestureDetector& Dali::Internal::TapGestureDetector::operator= ( const TapGestureDetector rhs)
private
void Dali::Internal::TapGestureDetector::SetMaximumTapsRequired ( unsigned int  maxTaps)

Set the maximum number of taps required.

The tap count is the number of times a user should "tap" the screen. .0

Parameters
[in]maximumTapsThe maximum taps required.
Precondition
The gesture detector has been initialized.
Note
The default is '1'.

Definition at line 99 of file tap-gesture-detector-impl.cpp.

References Dali::Internal::GestureEventProcessor::GestureDetectorUpdated(), Dali::Internal::GestureDetector::mAttachedActors, Dali::Internal::GestureDetector::mGestureEventProcessor, and mMaximumTapsRequired.

Here is the call graph for this function:

void Dali::Internal::TapGestureDetector::SetMinimumTapsRequired ( unsigned int  minTaps)

Set the minimum number of taps required.

The tap count is the number of times a user should "tap" the screen. .0

Parameters
[in]minimumTapsThe minimum taps required.
Precondition
The gesture detector has been initialized.
Note
The default is '1'.

Definition at line 86 of file tap-gesture-detector-impl.cpp.

References Dali::Internal::GestureEventProcessor::GestureDetectorUpdated(), Dali::Internal::GestureDetector::mAttachedActors, Dali::Internal::GestureDetector::mGestureEventProcessor, and mMinimumTapsRequired.

Here is the call graph for this function:

void Dali::Internal::TapGestureDetector::SetTouchesRequired ( unsigned int  touches)

Member Data Documentation

Dali::TapGestureDetector::DetectedSignalType Dali::Internal::TapGestureDetector::mDetectedSignal
private

Definition at line 164 of file tap-gesture-detector-impl.h.

Referenced by DetectedSignal(), and EmitTapGestureSignal().

unsigned int Dali::Internal::TapGestureDetector::mMaximumTapsRequired
private

Definition at line 167 of file tap-gesture-detector-impl.h.

Referenced by GetMaximumTapsRequired(), and SetMaximumTapsRequired().

unsigned int Dali::Internal::TapGestureDetector::mMinimumTapsRequired
private

Definition at line 166 of file tap-gesture-detector-impl.h.

Referenced by GetMinimumTapsRequired(), and SetMinimumTapsRequired().

unsigned int Dali::Internal::TapGestureDetector::mTouchesRequired
private

Definition at line 168 of file tap-gesture-detector-impl.h.

Referenced by GetTouchesRequired(), and SetTouchesRequired().


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