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

Long Press Gesture Event Processing: More...

#include <long-press-gesture-processor.h>

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

Public Member Functions

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

Private Member Functions

 LongPressGestureProcessor (const LongPressGestureProcessor &)
 
LongPressGestureProcessoroperator= (const LongPressGestureProcessor &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
 
LongPressGestureDetectorContainer mGestureDetectors
 
GestureDetectorContainer mCurrentEmitters
 
Dali::RenderTask mCurrentRenderTask
 
unsigned int mMinTouchesRequired
 
unsigned int mMaxTouchesRequired
 
const
Integration::LongPressGestureEvent * 
mCurrentLongPressEvent
 Pointer to current longPressEvent, used when calling ProcessAndEmit() 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

Long Press Gesture Event Processing:

When we receive a long press gesture event, we do the following:

Definition at line 48 of file long-press-gesture-processor.h.

Constructor & Destructor Documentation

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

Create a long press gesture processor.

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

Definition at line 101 of file long-press-gesture-processor.cpp.

Dali::Internal::LongPressGestureProcessor::~LongPressGestureProcessor ( )

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

Definition at line 114 of file long-press-gesture-processor.cpp.

Dali::Internal::LongPressGestureProcessor::LongPressGestureProcessor ( const LongPressGestureProcessor )
private

Member Function Documentation

void Dali::Internal::LongPressGestureProcessor::AddGestureDetector ( LongPressGestureDetector 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 213 of file long-press-gesture-processor.cpp.

References Dali::Internal::LongPressGestureDetector::GetMaximumTouchesRequired(), Dali::Internal::LongPressGestureDetector::GetMinimumTouchesRequired(), mGestureDetectors, mGestureManager, mMaxTouchesRequired, mMinTouchesRequired, Dali::Integration::GestureManager::Register(), and UpdateDetection().

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::LongPressGestureProcessor::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 306 of file long-press-gesture-processor.cpp.

References DALI_ASSERT_DEBUG, Dali::Internal::LongPressGestureDetector::GetMaximumTouchesRequired(), Dali::Internal::LongPressGestureDetector::GetMinimumTouchesRequired(), and mCurrentLongPressEvent.

Here is the call graph for this function:

void Dali::Internal::LongPressGestureProcessor::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 316 of file long-press-gesture-processor.cpp.

References DALI_ASSERT_DEBUG, Dali::Internal::anonymous_namespace{long-press-gesture-processor.cpp}::EmitLongPressSignal(), mCurrentEmitters, mCurrentLongPressEvent, Dali::Internal::Actor::OnStage(), Dali::Internal::GestureProcessor::ResetActor(), and Dali::Internal::GestureProcessor::SetActor().

Here is the call graph for this function:

void Dali::Internal::LongPressGestureProcessor::GestureDetectorUpdated ( LongPressGestureDetector gestureDetector)

This method updates the gesture detection parameters.

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

Definition at line 255 of file long-press-gesture-processor.cpp.

References DALI_ASSERT_DEBUG, 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::LongPressGestureProcessor::OnGesturedActorStageDisconnection ( )
privatevirtual

Called when the gestured actor is removed from the stage.

Implements Dali::Internal::GestureProcessor.

Definition at line 301 of file long-press-gesture-processor.cpp.

References mCurrentEmitters.

LongPressGestureProcessor& Dali::Internal::LongPressGestureProcessor::operator= ( const LongPressGestureProcessor rhs)
private
void Dali::Internal::LongPressGestureProcessor::Process ( const Integration::LongPressGestureEvent &  longPressEvent)
void Dali::Internal::LongPressGestureProcessor::RemoveGestureDetector ( LongPressGestureDetector 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 235 of file long-press-gesture-processor.cpp.

References DALI_ASSERT_DEBUG, Dali::Gesture::LongPress, mGestureDetectors, mGestureManager, 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::LongPressGestureProcessor::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 262 of file long-press-gesture-processor.cpp.

References DALI_ASSERT_DEBUG, Dali::Internal::LongPressGestureDetector::GetMaximumTouchesRequired(), Dali::Internal::LongPressGestureDetector::GetMinimumTouchesRequired(), mGestureDetectors, mGestureManager, mMaxTouchesRequired, mMinTouchesRequired, and Dali::Integration::GestureManager::Update().

Referenced by AddGestureDetector(), GestureDetectorUpdated(), and RemoveGestureDetector().

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

GestureDetectorContainer Dali::Internal::LongPressGestureProcessor::mCurrentEmitters
private
const Integration::LongPressGestureEvent* Dali::Internal::LongPressGestureProcessor::mCurrentLongPressEvent
private

Pointer to current longPressEvent, used when calling ProcessAndEmit()

Definition at line 137 of file long-press-gesture-processor.h.

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

Dali::RenderTask Dali::Internal::LongPressGestureProcessor::mCurrentRenderTask
private

Definition at line 132 of file long-press-gesture-processor.h.

Referenced by Process().

LongPressGestureDetectorContainer Dali::Internal::LongPressGestureProcessor::mGestureDetectors
private
Integration::GestureManager& Dali::Internal::LongPressGestureProcessor::mGestureManager
private
unsigned int Dali::Internal::LongPressGestureProcessor::mMaxTouchesRequired
private

Definition at line 135 of file long-press-gesture-processor.h.

Referenced by AddGestureDetector(), and UpdateDetection().

unsigned int Dali::Internal::LongPressGestureProcessor::mMinTouchesRequired
private

Definition at line 134 of file long-press-gesture-processor.h.

Referenced by AddGestureDetector(), and UpdateDetection().

Stage& Dali::Internal::LongPressGestureProcessor::mStage
private

Definition at line 127 of file long-press-gesture-processor.h.

Referenced by Process().


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