Tizen Native API  6.5
Dali::LongPressGestureDetector Class Reference

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

Inheritance diagram for Dali::LongPressGestureDetector:
Dali::GestureDetector Dali::Handle Dali::BaseHandle

Public Types

typedef Signal< void(Actor,
const LongPressGesture &) > 
DetectedSignalType
 Gesture detected signal type.

Public Member Functions

 LongPressGestureDetector ()
 Creates an uninitialized LongPressGestureDetector; this can be initialized with LongPressGestureDetector::New().
 ~LongPressGestureDetector ()
 Destructor.
 LongPressGestureDetector (const LongPressGestureDetector &handle)
 This copy constructor is required for (smart) pointer semantics.
LongPressGestureDetectoroperator= (const LongPressGestureDetector &rhs)
 This assignment operator is required for (smart) pointer semantics.
void SetTouchesRequired (uint32_t touches)
 Sets the number of touches required.
void SetTouchesRequired (uint32_t minTouches, uint32_t maxTouches)
 Sets the minimum and maximum touches required.
uint32_t GetMinimumTouchesRequired () const
 Retrieves the minimum number of touches required.
uint32_t GetMaximumTouchesRequired () const
 Retrieves the maximum number of touches required.
DetectedSignalTypeDetectedSignal ()
 This signal is emitted when the specified long press is detected on the attached actor.

Static Public Member Functions

static LongPressGestureDetector New ()
 Creates an initialized LongPressGestureDetector.
static LongPressGestureDetector New (uint32_t touchesRequired)
 Creates an initialized LongPressGestureDetector with the number of touches required.
static LongPressGestureDetector New (uint32_t minTouches, uint32_t maxTouches)
 Creates an initialized LongPressGestureDetector with the minimum and maximum number of touches required.
static LongPressGestureDetector DownCast (BaseHandle handle)
 Downcasts a handle to LongPressGestureDetector handle.

Detailed Description

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

Since:
2.4, DALi version 1.0.0

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

  • First identifying the beginning (state = Started) i.e. when fingers held down for the required time.
  • Second identifying the ending (state = Finished) i.e. when fingers are released.

The application programmer can use this gesture detector as follows:

 LongPressGestureDetector detector = LongPressGestureDetector::New();
 detector.Attach(myActor);
 detector.DetectedSignal().Connect(this, &MyApplication::OnLongPress);
See also:
LongPressGesture

Signals | Signal Name | Method | |-------------------|-----------------------| | longPressDetected | DetectedSignal() |


Member Typedef Documentation

Gesture detected signal type.

Since:
2.4, DALi version 1.0.0

Constructor & Destructor Documentation

Creates an uninitialized LongPressGestureDetector; this can be initialized with LongPressGestureDetector::New().

Calling member functions with an uninitialized LongPressGestureDetector handle is not allowed.

Since:
2.4, DALi version 1.0.0

Destructor.

This is non-virtual since derived Handle types must not contain data or virtual methods.

Since:
2.4, DALi version 1.0.0

This copy constructor is required for (smart) pointer semantics.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]handleA reference to the copied handle

Member Function Documentation

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 );
Since:
2.4, DALi version 1.0.0
Returns:
The signal to connect to
Precondition:
The gesture detector has been initialized.

Downcasts a handle to LongPressGestureDetector handle.

If handle points to a LongPressGestureDetector object, the downcast produces valid handle. If not, the returned handle is left uninitialized.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]handleHandle to an object
Returns:
Handle to a LongPressGestureDetector object or an uninitialized handle

Reimplemented from Dali::GestureDetector.

Retrieves the maximum number of touches required.

Since:
2.4, DALi version 1.0.0
Returns:
The maximum number of touches required
Precondition:
The gesture detector has been initialized.

Retrieves the minimum number of touches required.

Since:
2.4, DALi version 1.0.0
Returns:
The minimum number of touches required
Precondition:
The gesture detector has been initialized.

Creates an initialized LongPressGestureDetector.

By default, this would create a gesture detector that requires only one touch.

Since:
2.4, DALi version 1.0.0
Returns:
A handle to a newly allocated Dali resource

Reimplemented from Dali::Handle.

static LongPressGestureDetector Dali::LongPressGestureDetector::New ( uint32_t  touchesRequired) [static]

Creates an initialized LongPressGestureDetector with the number of touches required.

A long press gesture will be emitted from this detector if the number of fingers touching the screen is equal to the touches required.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]touchesRequiredThe number of touches required
Returns:
A handle to a newly allocated Dali resource
static LongPressGestureDetector Dali::LongPressGestureDetector::New ( uint32_t  minTouches,
uint32_t  maxTouches 
) [static]

Creates an initialized LongPressGestureDetector with the minimum and maximum number of touches required.

A long press gesture will be emitted from this detector if the number of fingers touching the screen falls between the minimum and maximum touches set.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]minTouchesThe minimum number of touches required
[in]maxTouchesThe maximum number of touches required
Returns:
A handle to a newly allocated Dali resource
LongPressGestureDetector& Dali::LongPressGestureDetector::operator= ( const LongPressGestureDetector rhs)

This assignment operator is required for (smart) pointer semantics.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]rhsA reference to the copied handle
Returns:
A reference to this

Sets 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.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]touchesTouches required
Precondition:
The gesture detector has been initialized.
Note:
The default is '1'.
void Dali::LongPressGestureDetector::SetTouchesRequired ( uint32_t  minTouches,
uint32_t  maxTouches 
)

Sets the minimum and maximum touches required.

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

Since:
2.4, DALi version 1.0.0
Parameters:
[in]minTouchesMinimum Touches required
[in]maxTouchesMaximum Touches required
Precondition:
The gesture detector has been initialized.
Note:
The default is '1'.