Tizen Native API
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 ()
 Create 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 (unsigned int touches)
 Set the number of touches required.
void SetTouchesRequired (unsigned int minTouches, unsigned int maxTouches)
 Sets the minimum and maximum touches required.
unsigned int GetMinimumTouchesRequired () const
 Retrieves the minimum number of touches required.
unsigned int 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 ()
 Create an initialized LongPressGestureDetector.
static LongPressGestureDetector New (unsigned int touchesRequired)
 Create an initialized LongPressGestureDetector with the number of touches required.
static LongPressGestureDetector New (unsigned int minTouches, unsigned int maxTouches)
 Create an initialized LongPressGestureDetector with the minimum and maximum number of touches required.
static LongPressGestureDetector DownCast (BaseHandle handle)
 Downcast 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
See also:
LongPressGestureDetector::SetTouchesRequired.

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

Member Typedef Documentation

Gesture detected signal type.

Since :
2.4

Constructor & Destructor Documentation

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

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

Since :
2.4

Destructor.

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

Since :
2.4

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

Since :
2.4
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
Returns:
The signal to connect to.
Precondition:
The gesture detector has been initialized.

Downcast 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
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
Returns:
The maximum number of touches required.
Precondition:
The gesture detector has been initialized.

Retrieves the minimum number of touches required.

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

Create an initialized LongPressGestureDetector.

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

Since :
2.4
Returns:
A handle to a newly allocated Dali resource.

Reimplemented from Dali::Handle.

static LongPressGestureDetector Dali::LongPressGestureDetector::New ( unsigned int  touchesRequired) [static]

Create 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
Parameters:
[in]touchesRequiredThe number of touches required.
Returns:
A handle to a newly allocated Dali resource.
static LongPressGestureDetector Dali::LongPressGestureDetector::New ( unsigned int  minTouches,
unsigned int  maxTouches 
) [static]

Create 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
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
Parameters:
[in]rhsA reference to the copied handle
Returns:
A reference to this

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.

Since :
2.4
Parameters:
[in]touchesTouches required.
Precondition:
The gesture detector has been initialized.
Note:
The default is '1'.
void Dali::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.

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