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

Tap Gesture Event Processing: More...

#include <tap-gesture-processor.h>

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

Public Member Functions

 TapGestureProcessor (Stage &stage, Integration::GestureManager &gestureManager)
 Create a tap gesture processor. More...
 
 ~TapGestureProcessor ()
 Non-virtual destructor; TapGestureProcessor is not a base class. More...
 
void Process (const Integration::TapGestureEvent &tapEvent)
 This method is called whenever a tap gesture event occurs. More...
 
void AddGestureDetector (TapGestureDetector *gestureDetector)
 Adds a gesture detector to this gesture processor. More...
 
void RemoveGestureDetector (TapGestureDetector *gestureDetector)
 Removes the specified gesture detector from this gesture processor. More...
 
void GestureDetectorUpdated (TapGestureDetector *gestureDetector)
 This method updates the gesture detection parameters. More...
 

Private Member Functions

 TapGestureProcessor (const TapGestureProcessor &)
 
TapGestureProcessoroperator= (const TapGestureProcessor &rhs)
 
void UpdateDetection ()
 Iterates through our GestureDetectors and determines if we need to ask the adaptor to update its detection policy. More...
 
void OnGesturedActorStageDisconnection ()
 Called when the gestured actor is removed from the stage. More...
 
bool CheckGestureDetector (GestureDetector *detector, Actor *actor)
 Called by the ProcessAndEmit() & GetGesturedActor() methods to check if the provided gesture-detector meets the parameters of the current gesture. More...
 
void EmitGestureSignal (Actor *actor, const GestureDetectorContainer &gestureDetectors, Vector2 actorCoordinates)
 Called by the ProcessAndEmit() method when the gesture meets all applicable criteria and should be overridden by deriving classes to emit the gesture signal on gesture-detectors provided for the actor the gesture has occurred on. More...
 

Private Attributes

StagemStage
 
Integration::GestureManagermGestureManager
 
TapGestureDetectorContainer mGestureDetectors
 
unsigned int mMinTapsRequired
 
unsigned int mMaxTapsRequired
 
unsigned int mMinTouchesRequired
 
unsigned int mMaxTouchesRequired
 
ActorObserver mCurrentTapActor
 Observer for the current gesture actor. More...
 
const
Integration::TapGestureEvent * 
mCurrentTapEvent
 Pointer to current TapEvent, used when calling ProcessAndEmit() More...
 
bool mPossibleProcessed
 Indication of whether we've processed a touch down for this gestuee. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Dali::Internal::GestureProcessor
 GestureProcessor (Gesture::Type type)
 Protected constructor. More...
 
virtual ~GestureProcessor ()
 Virtual protected destructor. More...
 
void GetGesturedActor (Actor *&actor, GestureDetectorContainer &gestureDetectors)
 Given the hit actor, this walks up the actor tree to determine the actor that is connected to one (or several) gesture detectors. More...
 
void ProcessAndEmit (HitTestAlgorithm::Results &hitTestResults)
 Calls the emission method in the deriving class for matching gesture-detectors with the hit-actor (or one of its parents). More...
 
virtual bool HitTest (Stage &stage, Vector2 screenCoordinates, HitTestAlgorithm::Results &hitTestResults)
 Hit test the screen coordinates, and place the results in hitTestResults. More...
 
void SetActor (Actor *actor)
 Sets the mCurrentGesturedActor and connects to the required signals. More...
 
void ResetActor ()
 Resets the set actor and disconnects any connected signals. More...
 
ActorGetCurrentGesturedActor ()
 Returns the current gestured actor if it is on stage. More...
 

Detailed Description

Tap Gesture Event Processing:

When we receive a tap gesture event, we do the following:

Definition at line 49 of file tap-gesture-processor.h.

Constructor & Destructor Documentation

Dali::Internal::TapGestureProcessor::TapGestureProcessor ( Stage stage,
Integration::GestureManager gestureManager 
)

Create a tap gesture processor.

Parameters
[in]stageThe stage.
[in]gestureManagerThe gesture manager.

Definition at line 75 of file tap-gesture-processor.cpp.

Dali::Internal::TapGestureProcessor::~TapGestureProcessor ( )

Non-virtual destructor; TapGestureProcessor is not a base class.

Definition at line 89 of file tap-gesture-processor.cpp.

Dali::Internal::TapGestureProcessor::TapGestureProcessor ( const TapGestureProcessor )
private

Member Function Documentation

void Dali::Internal::TapGestureProcessor::AddGestureDetector ( TapGestureDetector gestureDetector)

Adds a gesture detector to this gesture processor.

If this is the first gesture detector being added, then this method registers the required gesture with the adaptor.

Parameters
[in]gestureDetectorThe gesture detector being added.

Definition at line 155 of file tap-gesture-processor.cpp.

References DALI_ASSERT_ALWAYS, Dali::Internal::TapGestureDetector::GetMaximumTapsRequired(), Dali::Internal::TapGestureDetector::GetMinimumTapsRequired(), Dali::Internal::TapGestureDetector::GetTouchesRequired(), mGestureDetectors, mGestureManager, mMaxTapsRequired, mMaxTouchesRequired, mMinTapsRequired, mMinTouchesRequired, Dali::Integration::GestureManager::Register(), and Dali::Integration::GestureManager::Update().

Referenced by Dali::Internal::GestureEventProcessor::AddGestureDetector().

Here is the call graph for this function:

Here is the caller graph for this function:

bool Dali::Internal::TapGestureProcessor::CheckGestureDetector ( GestureDetector detector,
Actor actor 
)
privatevirtual

Called by the ProcessAndEmit() & GetGesturedActor() methods to check if the provided gesture-detector meets the parameters of the current gesture.

Parameters
[in]detectorThe gesture detector to check.
[in]actorThe actor that has been gestured.
Returns
true, if the detector meets the parameters, false otherwise.

Implements Dali::Internal::GestureProcessor.

Definition at line 281 of file tap-gesture-processor.cpp.

References DALI_ASSERT_DEBUG, Dali::Internal::TapGestureDetector::GetMaximumTapsRequired(), Dali::Internal::TapGestureDetector::GetMinimumTapsRequired(), Dali::Internal::TapGestureDetector::GetTouchesRequired(), and mCurrentTapEvent.

Here is the call graph for this function:

void Dali::Internal::TapGestureProcessor::EmitGestureSignal ( Actor actor,
const GestureDetectorContainer gestureDetectors,
Vector2  actorCoordinates 
)
privatevirtual

Called by the ProcessAndEmit() method when the gesture meets all applicable criteria and should be overridden by deriving classes to emit the gesture signal on gesture-detectors provided for the actor the gesture has occurred on.

Parameters
[in]actorThe actor which has been gestured.
[in]gestureDetectorsThe detectors that should emit the signal.
[in]actorCoordinatesThe local actor coordinates where the gesture took place.

Implements Dali::Internal::GestureProcessor.

Definition at line 291 of file tap-gesture-processor.cpp.

References DALI_ASSERT_DEBUG, Dali::Internal::anonymous_namespace{tap-gesture-processor.cpp}::EmitTapSignal(), and mCurrentTapEvent.

Here is the call graph for this function:

void Dali::Internal::TapGestureProcessor::GestureDetectorUpdated ( TapGestureDetector gestureDetector)

This method updates the gesture detection parameters.

Parameters
[in]gestureDetectorThe gesture detector that has been updated.

Definition at line 231 of file tap-gesture-processor.cpp.

References DALI_ASSERT_ALWAYS, DALI_ASSERT_DEBUG, Dali::Internal::TapGestureDetector::GetMaximumTapsRequired(), Dali::Internal::TapGestureDetector::GetMinimumTapsRequired(), mGestureDetectors, and UpdateDetection().

Referenced by Dali::Internal::GestureEventProcessor::GestureDetectorUpdated().

Here is the call graph for this function:

Here is the caller graph for this function:

void Dali::Internal::TapGestureProcessor::OnGesturedActorStageDisconnection ( )
inlineprivatevirtual

Called when the gestured actor is removed from the stage.

Implements Dali::Internal::GestureProcessor.

Definition at line 114 of file tap-gesture-processor.h.

TapGestureProcessor& Dali::Internal::TapGestureProcessor::operator= ( const TapGestureProcessor rhs)
private
void Dali::Internal::TapGestureProcessor::Process ( const Integration::TapGestureEvent &  tapEvent)
void Dali::Internal::TapGestureProcessor::RemoveGestureDetector ( TapGestureDetector gestureDetector)

Removes the specified gesture detector from this gesture processor.

If, after removing this gesture detector, there are no more gesture detectors registered, then this method unregisters the gesture from the adaptor.

Parameters
[in]gestureDetectorThe gesture detector being removed.

Definition at line 209 of file tap-gesture-processor.cpp.

References DALI_ASSERT_DEBUG, mGestureDetectors, mGestureManager, Dali::Internal::GestureProcessor::ResetActor(), Dali::Gesture::Tap, Dali::Integration::GestureManager::Unregister(), and UpdateDetection().

Referenced by Dali::Internal::GestureEventProcessor::RemoveGestureDetector().

Here is the call graph for this function:

Here is the caller graph for this function:

void Dali::Internal::TapGestureProcessor::UpdateDetection ( )
private

Iterates through our GestureDetectors and determines if we need to ask the adaptor to update its detection policy.

If it does, it sends the appropriate gesture update request to adaptor.

Definition at line 243 of file tap-gesture-processor.cpp.

References DALI_ASSERT_DEBUG, Dali::Internal::TapGestureDetector::GetMaximumTapsRequired(), Dali::Internal::TapGestureDetector::GetMinimumTapsRequired(), Dali::Internal::TapGestureDetector::GetTouchesRequired(), mGestureDetectors, mGestureManager, mMaxTapsRequired, mMaxTouchesRequired, mMinTapsRequired, mMinTouchesRequired, and Dali::Integration::GestureManager::Update().

Referenced by GestureDetectorUpdated(), and RemoveGestureDetector().

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

ActorObserver Dali::Internal::TapGestureProcessor::mCurrentTapActor
private

Observer for the current gesture actor.

Definition at line 137 of file tap-gesture-processor.h.

Referenced by Process().

const Integration::TapGestureEvent* Dali::Internal::TapGestureProcessor::mCurrentTapEvent
private

Pointer to current TapEvent, used when calling ProcessAndEmit()

Definition at line 138 of file tap-gesture-processor.h.

Referenced by CheckGestureDetector(), EmitGestureSignal(), and Process().

TapGestureDetectorContainer Dali::Internal::TapGestureProcessor::mGestureDetectors
private
Integration::GestureManager& Dali::Internal::TapGestureProcessor::mGestureManager
private
unsigned int Dali::Internal::TapGestureProcessor::mMaxTapsRequired
private

Definition at line 133 of file tap-gesture-processor.h.

Referenced by AddGestureDetector(), and UpdateDetection().

unsigned int Dali::Internal::TapGestureProcessor::mMaxTouchesRequired
private

Definition at line 135 of file tap-gesture-processor.h.

Referenced by AddGestureDetector(), and UpdateDetection().

unsigned int Dali::Internal::TapGestureProcessor::mMinTapsRequired
private

Definition at line 132 of file tap-gesture-processor.h.

Referenced by AddGestureDetector(), and UpdateDetection().

unsigned int Dali::Internal::TapGestureProcessor::mMinTouchesRequired
private

Definition at line 134 of file tap-gesture-processor.h.

Referenced by AddGestureDetector(), and UpdateDetection().

bool Dali::Internal::TapGestureProcessor::mPossibleProcessed
private

Indication of whether we've processed a touch down for this gestuee.

Definition at line 139 of file tap-gesture-processor.h.

Referenced by Process().

Stage& Dali::Internal::TapGestureProcessor::mStage
private

Definition at line 128 of file tap-gesture-processor.h.

Referenced by Process().


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