Tizen Native API
5.5
|
This class looks for panning (or dragging) gestures. More...
Classes | |
struct | Property |
Enumeration for the instance of properties belonging to the PanGestureDetector class. More... | |
Public Types | |
typedef Signal< void(Actor, const PanGesture &) > | DetectedSignalType |
Pan gesture detected signal type. | |
typedef std::pair< Radian, Radian > | AngleThresholdPair |
Range of angles for a direction. | |
Public Member Functions | |
PanGestureDetector () | |
Creates an uninitialized PanGestureDetector; this can be initialized with PanGestureDetector::New(). | |
~PanGestureDetector () | |
Destructor. | |
PanGestureDetector (const PanGestureDetector &handle) | |
This copy constructor is required for (smart) pointer semantics. | |
PanGestureDetector & | operator= (const PanGestureDetector &rhs) |
This assignment operator is required for (smart) pointer semantics. | |
void | SetMinimumTouchesRequired (uint32_t minimum) |
This is the minimum number of touches required for the pan gesture to be detected. | |
void | SetMaximumTouchesRequired (uint32_t maximum) |
This is the maximum number of touches required for the pan gesture to be detected. | |
uint32_t | GetMinimumTouchesRequired () const |
Retrieves the minimum number of touches required for the pan gesture to be detected. | |
uint32_t | GetMaximumTouchesRequired () const |
Retrieves the maximum number of touches required for the pan gesture to be detected. | |
void | AddAngle (Radian angle, Radian threshold=DEFAULT_THRESHOLD) |
The pan gesture is only emitted if the pan occurs in the direction specified by this method with a +/- threshold allowance. | |
void | AddDirection (Radian direction, Radian threshold=DEFAULT_THRESHOLD) |
A helper method for adding bi-directional angles where the pan should take place. | |
size_t | GetAngleCount () const |
Returns the count of angles that this pan gesture detector emits a signal. | |
AngleThresholdPair | GetAngle (size_t index) const |
Returns the angle by index that this pan gesture detector emits a signal. | |
void | ClearAngles () |
Clears any directional angles that are used by the gesture detector. | |
void | RemoveAngle (Radian angle) |
Removes the angle specified from the container. | |
void | RemoveDirection (Radian direction) |
Removes the two angles that make up the direction from the container. | |
DetectedSignalType & | DetectedSignal () |
This signal is emitted when the pan gesture is detected on the attached actor. | |
Static Public Member Functions | |
static PanGestureDetector | New () |
Creates an initialized PanGestureDetector. | |
static PanGestureDetector | DownCast (BaseHandle handle) |
Downcasts a handle to PanGestureDetector handle. | |
static void | SetPanGestureProperties (const PanGesture &pan) |
Allows setting of the pan properties that are returned in constraints. | |
Static Public Attributes | |
static const Radian | DIRECTION_LEFT |
For a left pan (-PI Radians). | |
static const Radian | DIRECTION_RIGHT |
For a right pan (0 Radians). | |
static const Radian | DIRECTION_UP |
For an up pan (-0.5 * PI Radians). | |
static const Radian | DIRECTION_DOWN |
For a down pan (0.5 * PI Radians). | |
static const Radian | DIRECTION_HORIZONTAL |
For a left and right pan (PI Radians). Useful for AddDirection(). | |
static const Radian | DIRECTION_VERTICAL |
For an up and down pan (-0.5 * PI Radians). Useful for AddDirection(). | |
static const Radian | DEFAULT_THRESHOLD |
The default threshold is PI * 0.25 radians (or 45 degrees). |
This class looks for panning (or dragging) gestures.
The user will be pressing one or more fingers on an actor while they pan it.
The application programmer can use this gesture detector as follows:
PanGestureDetector detector = PanGestureDetector::New(); detector.Attach(myActor); detector.DetectedSignal().Connect(this, &MyApplication::OnPan); // Detect pan gesture for single and double touch. detector.SetMaximumTouchesRequired(2);
Signals | Signal Name | Method | |--------------|-----------------------| | panDetected | DetectedSignal() |
typedef std::pair< Radian, Radian > Dali::PanGestureDetector::AngleThresholdPair |
Range of angles for a direction.
typedef Signal< void ( Actor, const PanGesture& ) > Dali::PanGestureDetector::DetectedSignalType |
Pan gesture detected signal type.
Creates an uninitialized PanGestureDetector; this can be initialized with PanGestureDetector::New().
Calling member functions with an uninitialized PanGestureDetector handle is not allowed.
Destructor.
This is non-virtual since derived Handle types must not contain data or virtual methods.
Dali::PanGestureDetector::PanGestureDetector | ( | const PanGestureDetector & | handle | ) |
This copy constructor is required for (smart) pointer semantics.
[in] | handle | A reference to the copied handle |
void Dali::PanGestureDetector::AddAngle | ( | Radian | angle, |
Radian | threshold = DEFAULT_THRESHOLD |
||
) |
The pan gesture is only emitted if the pan occurs in the direction specified by this method with a +/- threshold allowance.
The angle is from -180 -> 0 -> 180 degrees (or -M_PI -> 0 -> M_PI in radians) i.e:
-90.0f ( -0.5f * PI ) | | 180.0f ( PI ) ------------- 0.0f ( 0.0f ) | | 90.0f ( 0.5f * PI )
If an angle of 0.0 degrees is specified and the threshold is 45 degrees then the acceptable direction range is from -45 to 45 degrees.
[in] | angle | The angle that pan should be allowed |
[in] | threshold | The threshold around that angle |
void Dali::PanGestureDetector::AddDirection | ( | Radian | direction, |
Radian | threshold = DEFAULT_THRESHOLD |
||
) |
A helper method for adding bi-directional angles where the pan should take place.
In other words, if 0 is requested, then PI will also be added so that we have both left and right scrolling.
[in] | direction | The direction of panning required |
[in] | threshold | The threshold |
Clears any directional angles that are used by the gesture detector.
After this, the pan gesture will be emitted for a pan in ANY direction.
This signal is emitted when the pan gesture is detected on the attached actor.
A callback of the following type may be connected:
void YourCallbackName( Actor actor, const PanGesture& gesture );
static PanGestureDetector Dali::PanGestureDetector::DownCast | ( | BaseHandle | handle | ) | [static] |
Downcasts a handle to PanGestureDetector handle.
If handle points to a PanGestureDetector object, the downcast produces valid handle. If not, the returned handle is left uninitialized.
[in] | handle | Handle to an object |
Reimplemented from Dali::GestureDetector.
AngleThresholdPair Dali::PanGestureDetector::GetAngle | ( | size_t | index | ) | const |
Returns the angle by index that this pan gesture detector emits a signal.
[in] | index | The angle's index |
size_t Dali::PanGestureDetector::GetAngleCount | ( | ) | const |
Returns the count of angles that this pan gesture detector emits a signal.
uint32_t Dali::PanGestureDetector::GetMaximumTouchesRequired | ( | ) | const |
Retrieves the maximum number of touches required for the pan gesture to be detected.
uint32_t Dali::PanGestureDetector::GetMinimumTouchesRequired | ( | ) | const |
Retrieves the minimum number of touches required for the pan gesture to be detected.
static PanGestureDetector Dali::PanGestureDetector::New | ( | ) | [static] |
Creates an initialized PanGestureDetector.
Reimplemented from Dali::Handle.
PanGestureDetector& Dali::PanGestureDetector::operator= | ( | const PanGestureDetector & | rhs | ) |
This assignment operator is required for (smart) pointer semantics.
[in] | rhs | A reference to the copied handle |
void Dali::PanGestureDetector::RemoveAngle | ( | Radian | angle | ) |
Removes the angle specified from the container.
[in] | angle | The angle to remove |
void Dali::PanGestureDetector::RemoveDirection | ( | Radian | direction | ) |
Removes the two angles that make up the direction from the container.
[in] | direction | The direction to remove |
void Dali::PanGestureDetector::SetMaximumTouchesRequired | ( | uint32_t | maximum | ) |
This is the maximum number of touches required for the pan gesture to be detected.
[in] | maximum | Maximum touches required |
void Dali::PanGestureDetector::SetMinimumTouchesRequired | ( | uint32_t | minimum | ) |
This is the minimum number of touches required for the pan gesture to be detected.
[in] | minimum | Minimum touches required |
static void Dali::PanGestureDetector::SetPanGestureProperties | ( | const PanGesture & | pan | ) | [static] |
Allows setting of the pan properties that are returned in constraints.
[in] | pan | The pan gesture to set |