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::LongPressGestureDetector Class Reference

This class emits a signals when a long press gesture occurs that meets the requirements set by the application. More...

#include <long-press-gesture-detector-impl.h>

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

Public Member Functions

 LongPressGestureDetector ()
 Construct a new GestureDetector. More...
 
 LongPressGestureDetector (unsigned int minTouches, unsigned int maxTouches)
 Create a new gesture detector with the specified minimum and maximum touches. More...
 
void SetTouchesRequired (unsigned int touches)
 Set the number of touches required. More...
 
void SetTouchesRequired (unsigned int minTouches, unsigned int maxTouches)
 Sets the minimum and maximum touches required. More...
 
unsigned int GetMinimumTouchesRequired () const
 Retrieves the minimum number of touches required. More...
 
unsigned int GetMaximumTouchesRequired () const
 Retrieves the maximum number of touches required. More...
 
void EmitLongPressGestureSignal (Dali::Actor pressedActor, const LongPressGesture &longPress)
 Called by the LongPressGestureProcessor when a tap gesture event occurs within the bounds of our attached actor. More...
 
Dali::LongPressGestureDetector::DetectedSignalTypeDetectedSignal ()
 This signal is emitted when the specified long press 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 LongPressGestureDetectorPtr New ()
 Create a new gesture detector. More...
 
static LongPressGestureDetectorPtr New (unsigned int touchesRequired)
 Create a new gesture detector with the specified touches. More...
 
static LongPressGestureDetectorPtr New (unsigned int minTouches, unsigned int maxTouches)
 Create a new gesture detector with the specified minimum and maximum touches. 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 ~LongPressGestureDetector ()
 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

 LongPressGestureDetector (const LongPressGestureDetector &)
 
LongPressGestureDetectoroperator= (const LongPressGestureDetector &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::LongPressGestureDetector::DetectedSignalType mDetectedSignal
 
unsigned int mMinimumTouchesRequired
 
unsigned int mMaximumTouchesRequired
 

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 signals when a long press gesture occurs that meets the requirements set by the application.

.0

See Also
LongPressGestureDetector::SetTouchesRequired.

For any valid long press, two signals will be emitted:

The application programmer can use this gesture detector as follows:

detector.Attach(myActor);
detector.DetectedSignal().Connect(this, &MyApplication::OnLongPress);
See Also
LongPressGesture

Signals

Signal Name Method
longPressDetected DetectedSignal()

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

Constructor & Destructor Documentation

Dali::Internal::LongPressGestureDetector::LongPressGestureDetector ( )

Construct a new GestureDetector.

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

Referenced by New().

Here is the caller graph for this function:

Dali::Internal::LongPressGestureDetector::LongPressGestureDetector ( unsigned int  minTouches,
unsigned int  maxTouches 
)

Create a new gesture detector with the specified minimum and maximum touches.

Parameters
[in]minTouchesThe minimum number of touches required.
[in]maxTouchesThe maximum number of touches required.

Definition at line 81 of file long-press-gesture-detector-impl.cpp.

Dali::Internal::LongPressGestureDetector::~LongPressGestureDetector ( )
protectedvirtual

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

Definition at line 88 of file long-press-gesture-detector-impl.cpp.

Dali::Internal::LongPressGestureDetector::LongPressGestureDetector ( const LongPressGestureDetector )
private

Member Function Documentation

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

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

A callback of the following type may be connected:

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

.0

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

Definition at line 115 of file long-press-gesture-detector-impl.h.

References mDetectedSignal.

Referenced by DoConnectSignal().

Here is the caller graph for this function:

bool Dali::Internal::LongPressGestureDetector::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 143 of file long-press-gesture-detector-impl.cpp.

References DetectedSignal(), and Dali::Internal::anonymous_namespace{long-press-gesture-detector-impl.cpp}::SIGNAL_LONG_PRESS_DETECTED.

Here is the call graph for this function:

void Dali::Internal::LongPressGestureDetector::EmitLongPressGestureSignal ( Dali::Actor  pressedActor,
const LongPressGesture longPress 
)

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

Parameters
[in]pressedActorThe pressed actor.
[in]longPressThe long press

Definition at line 135 of file long-press-gesture-detector-impl.cpp.

References mDetectedSignal.

Referenced by Dali::Internal::anonymous_namespace{long-press-gesture-processor.cpp}::EmitLongPressSignal().

Here is the caller graph for this function:

unsigned int Dali::Internal::LongPressGestureDetector::GetMaximumTouchesRequired ( ) const

Retrieves the maximum number of touches required.

.0

Returns
The maximum number of touches required.
Precondition
The gesture detector has been initialized.

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

References mMaximumTouchesRequired.

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

Here is the caller graph for this function:

unsigned int Dali::Internal::LongPressGestureDetector::GetMinimumTouchesRequired ( ) const

Retrieves the minimum number of touches required.

.0

Returns
The minimum number of touches required.
Precondition
The gesture detector has been initialized.

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

References mMinimumTouchesRequired.

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

Here is the caller graph for this function:

LongPressGestureDetectorPtr Dali::Internal::LongPressGestureDetector::New ( )
static

Create a new gesture detector.

Returns
A smart-pointer to the newly allocated detector.

Definition at line 59 of file long-press-gesture-detector-impl.cpp.

References LongPressGestureDetector().

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

Here is the call graph for this function:

Here is the caller graph for this function:

LongPressGestureDetectorPtr Dali::Internal::LongPressGestureDetector::New ( unsigned int  touchesRequired)
static

Create a new gesture detector with the specified touches.

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

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

References LongPressGestureDetector().

Here is the call graph for this function:

LongPressGestureDetectorPtr Dali::Internal::LongPressGestureDetector::New ( unsigned int  minTouches,
unsigned int  maxTouches 
)
static

Create a new gesture detector with the specified minimum and maximum touches.

Parameters
[in]minTouchesThe minimum number of touches required.
[in]maxTouchesThe maximum number of touches required.
Returns
A smart-pointer to the newly allocated detector.

Definition at line 69 of file long-press-gesture-detector-impl.cpp.

References LongPressGestureDetector().

Here is the call graph for this function:

void Dali::Internal::LongPressGestureDetector::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 161 of file long-press-gesture-detector-impl.cpp.

void Dali::Internal::LongPressGestureDetector::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 171 of file long-press-gesture-detector-impl.cpp.

void Dali::Internal::LongPressGestureDetector::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 166 of file long-press-gesture-detector-impl.cpp.

LongPressGestureDetector& Dali::Internal::LongPressGestureDetector::operator= ( const LongPressGestureDetector rhs)
private
void Dali::Internal::LongPressGestureDetector::SetTouchesRequired ( unsigned int  touches)

Set the number of touches required.

The number of touches corresponds to the number of fingers a user has on the screen. This sets the minimum and maximum touches to the input parameter.

.0

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

Definition at line 92 of file long-press-gesture-detector-impl.cpp.

References DALI_ASSERT_ALWAYS, Dali::Internal::GestureEventProcessor::GestureDetectorUpdated(), Dali::Internal::GestureDetector::mAttachedActors, Dali::Internal::GestureDetector::mGestureEventProcessor, mMaximumTouchesRequired, and mMinimumTouchesRequired.

Here is the call graph for this function:

void Dali::Internal::LongPressGestureDetector::SetTouchesRequired ( unsigned int  minTouches,
unsigned int  maxTouches 
)

Sets the minimum and maximum touches required.

The number of touches corresponds to the number of fingers a user has on the screen.

.0

Parameters
[in]minTouchesMinimum Touches required.
[in]maxTouchesMaximum Touches required.
Precondition
The gesture detector has been initialized.
Note
The default is '1'.

Definition at line 107 of file long-press-gesture-detector-impl.cpp.

References DALI_ASSERT_ALWAYS, Dali::Internal::GestureEventProcessor::GestureDetectorUpdated(), Dali::Internal::GestureDetector::mAttachedActors, Dali::Internal::GestureDetector::mGestureEventProcessor, mMaximumTouchesRequired, and mMinimumTouchesRequired.

Here is the call graph for this function:

Member Data Documentation

Dali::LongPressGestureDetector::DetectedSignalType Dali::Internal::LongPressGestureDetector::mDetectedSignal
private
unsigned int Dali::Internal::LongPressGestureDetector::mMaximumTouchesRequired
private
unsigned int Dali::Internal::LongPressGestureDetector::mMinimumTouchesRequired
private

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