Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
IGenericTouchGestureDetector Class Referenceabstract

Interface defining methods to perform gesture recognition. More...

#include <IGenericTouchGestureDetector.h>

Inheritance diagram for IGenericTouchGestureDetector:
ITouchInputHandling ITouchActionHandler CGenericTouchPinchDetector CGenericTouchRotateDetector CGenericTouchSwipeDetector

Public Member Functions

 IGenericTouchGestureDetector (ITouchActionHandler *handler, float dpi)
 
 ~IGenericTouchGestureDetector () override=default
 
bool IsDone ()
 Check whether the gesture recognition is finished or not.
 
virtual bool OnTouchDown (unsigned int index, const Pointer &pointer)=0
 A new touch pointer has been recognised.
 
virtual bool OnTouchUp (unsigned int index, const Pointer &pointer)
 An active touch pointer has vanished.
 
virtual bool OnTouchMove (unsigned int index, const Pointer &pointer)
 An active touch pointer has moved.
 
virtual bool OnTouchUpdate (unsigned int index, const Pointer &pointer)
 An active touch pointer's values have been updated but no event has occurred.
 
- Public Member Functions inherited from ITouchInputHandling
 ITouchInputHandling ()
 
 ~ITouchInputHandling () override=default
 
void RegisterHandler (ITouchActionHandler *touchHandler)
 Register a touch input handler.
 
void UnregisterHandler ()
 Unregister the previously registered touch handler.
 

Static Public Attributes

static constexpr int MAX_POINTERS = 2
 

Protected Attributes

bool m_done = false
 Whether the gesture recognition is finished or not.
 
float m_dpi
 DPI value of the touch screen.
 
std::array< Pointer, MAX_POINTERSm_pointers
 Local list of all known touch pointers.
 

Additional Inherited Members

- Protected Member Functions inherited from ITouchInputHandling
void OnTouchAbort () override
 A touch action has been aborted.
 
bool OnSingleTouchStart (float x, float y) override
 A single touch has started.
 
bool OnSingleTouchHold (float x, float y) override
 A single touch has been held down for a certain amount of time.
 
bool OnSingleTouchMove (float x, float y, float offsetX, float offsetY, float velocityX, float velocityY) override
 A single touch has moved.
 
bool OnSingleTouchEnd (float x, float y) override
 A single touch has been lifted.
 
bool OnMultiTouchDown (float x, float y, int32_t pointer) override
 An additional touch has been performed.
 
bool OnMultiTouchHold (float x, float y, int32_t pointers=2) override
 Multiple simultaneous touches have been held down for a certain amount of time.
 
bool OnMultiTouchMove (float x, float y, float offsetX, float offsetY, float velocityX, float velocityY, int32_t pointer) override
 A touch has moved.
 
bool OnMultiTouchUp (float x, float y, int32_t pointer) override
 A touch has been lifted (but there are still active touches)
 
bool OnTouchGestureStart (float x, float y) override
 A pan gesture with a single touch has been started.
 
bool OnTouchGesturePan (float x, float y, float offsetX, float offsetY, float velocityX, float velocityY) override
 A pan gesture with a single touch is in progress.
 
bool OnTouchGestureEnd (float x, float y, float offsetX, float offsetY, float velocityX, float velocityY) override
 A pan gesture with a single touch has ended.
 
void OnTap (float x, float y, int32_t pointers=1) override
 A tap with a one or more touches has been performed.
 
void OnLongPress (float x, float y, int32_t pointers=1) override
 One or more touches have been held down for a certain amount of time.
 
void OnSwipe (TouchMoveDirection direction, float xDown, float yDown, float xUp, float yUp, float velocityX, float velocityY, int32_t pointers=1) override
 One or more touches has been moved quickly in a single direction in a short time.
 
void OnZoomPinch (float centerX, float centerY, float zoomFactor) override
 Two simultaneous touches have been held down and moved to perform a zooming/pinching gesture.
 
void OnRotate (float centerX, float centerY, float angle) override
 Two simultaneous touches have been held down and moved to perform a rotating gesture.
 
- Protected Member Functions inherited from ITouchActionHandler
virtual ~ITouchActionHandler ()=default
 

Detailed Description

Interface defining methods to perform gesture recognition.

Constructor & Destructor Documentation

◆ IGenericTouchGestureDetector()

IGenericTouchGestureDetector::IGenericTouchGestureDetector ( ITouchActionHandler * handler,
float dpi )
inline

◆ ~IGenericTouchGestureDetector()

IGenericTouchGestureDetector::~IGenericTouchGestureDetector ( )
overridedefault

Member Function Documentation

◆ IsDone()

bool IGenericTouchGestureDetector::IsDone ( )
inline

Check whether the gesture recognition is finished or not.

Returns
True if the gesture recognition is finished otherwise false

◆ OnTouchDown()

virtual bool IGenericTouchGestureDetector::OnTouchDown ( unsigned int index,
const Pointer & pointer )
pure virtual

A new touch pointer has been recognised.

Parameters
indexIndex of the given touch pointer
pointerTouch pointer that has changed
Returns
True if the event was handled otherwise false

Implemented in CGenericTouchPinchDetector, CGenericTouchRotateDetector, and CGenericTouchSwipeDetector.

◆ OnTouchMove()

virtual bool IGenericTouchGestureDetector::OnTouchMove ( unsigned int index,
const Pointer & pointer )
inlinevirtual

An active touch pointer has moved.

Parameters
indexIndex of the given touch pointer
pointerTouch pointer that has changed
Returns
True if the event was handled otherwise false

Reimplemented in CGenericTouchPinchDetector, CGenericTouchRotateDetector, and CGenericTouchSwipeDetector.

◆ OnTouchUp()

virtual bool IGenericTouchGestureDetector::OnTouchUp ( unsigned int index,
const Pointer & pointer )
inlinevirtual

An active touch pointer has vanished.

If the first touch pointer is lifted and there are more active touch pointers, the remaining pointers change their index.

Parameters
indexIndex of the given touch pointer
pointerTouch pointer that has changed
Returns
True if the event was handled otherwise false

Reimplemented in CGenericTouchPinchDetector, CGenericTouchRotateDetector, and CGenericTouchSwipeDetector.

◆ OnTouchUpdate()

virtual bool IGenericTouchGestureDetector::OnTouchUpdate ( unsigned int index,
const Pointer & pointer )
inlinevirtual

An active touch pointer's values have been updated but no event has occurred.

Parameters
indexIndex of the given touch pointer
pointerTouch pointer that has changed
Returns
True if the event was handled otherwise false

Reimplemented in CGenericTouchRotateDetector, and CGenericTouchSwipeDetector.

Member Data Documentation

◆ m_done

bool IGenericTouchGestureDetector::m_done = false
protected

Whether the gesture recognition is finished or not.

◆ m_dpi

float IGenericTouchGestureDetector::m_dpi
protected

DPI value of the touch screen.

◆ m_pointers

std::array<Pointer, MAX_POINTERS> IGenericTouchGestureDetector::m_pointers
protected

Local list of all known touch pointers.

◆ MAX_POINTERS

constexpr int IGenericTouchGestureDetector::MAX_POINTERS = 2
staticconstexpr

The documentation for this class was generated from the following file: