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

Generic implementation of ITouchActionHandler to translate touch actions into XBMC specific and mappable actions. More...

#include <GenericTouchActionHandler.h>

Inheritance diagram for CGenericTouchActionHandler:
ITouchActionHandler

Public Member Functions

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.
 
int QuerySupportedGestures (float x, float y)
 Asks the control at the given coordinates for a list of the supported gestures.
 
- Public Member Functions inherited from ITouchActionHandler
virtual ~ITouchActionHandler ()=default
 

Static Public Member Functions

static CGenericTouchActionHandlerGetInstance ()
 Get an instance of the touch input manager.
 

Detailed Description

Generic implementation of ITouchActionHandler to translate touch actions into XBMC specific and mappable actions.

See also
ITouchActionHandler

Member Function Documentation

◆ GetInstance()

CGenericTouchActionHandler & CGenericTouchActionHandler::GetInstance ( )
static

Get an instance of the touch input manager.

◆ OnLongPress()

void CGenericTouchActionHandler::OnLongPress ( float x,
float y,
int32_t pointers = 1 )
overridevirtual

One or more touches have been held down for a certain amount of time.

Parameters
xThe x coordinate (with sub-pixel) of the touch
yThe y coordinate (with sub-pixel) of the touch
pointersThe number of pointers involved (default 1)
Returns
True if the event was handled otherwise false
See also
OnSingleTouchHold

Reimplemented from ITouchActionHandler.

◆ OnMultiTouchDown()

bool CGenericTouchActionHandler::OnMultiTouchDown ( float x,
float y,
int32_t pointer )
overridevirtual

An additional touch has been performed.

Parameters
xThe x coordinate (with sub-pixel) of the touch
yThe y coordinate (with sub-pixel) of the touch
pointerThe pointer that has performed the touch
Returns
True if the event was handled otherwise false

Reimplemented from ITouchActionHandler.

◆ OnMultiTouchHold()

bool CGenericTouchActionHandler::OnMultiTouchHold ( float x,
float y,
int32_t pointers = 2 )
overridevirtual

Multiple simultaneous touches have been held down for a certain amount of time.

Parameters
xThe x coordinate (with sub-pixel) of the touch
yThe y coordinate (with sub-pixel) of the touch
pointersThe number of pointers involved (default 2)
Returns
True if the event was handled otherwise false

Reimplemented from ITouchActionHandler.

◆ OnMultiTouchMove()

bool CGenericTouchActionHandler::OnMultiTouchMove ( float x,
float y,
float offsetX,
float offsetY,
float velocityX,
float velocityY,
int32_t pointer )
overridevirtual

A touch has moved.

Parameters
xThe x coordinate (with sub-pixel) of the current touch
yThe y coordinate (with sub-pixel) of the current touch
offsetXThe covered distance on the x axis (with sub-pixel)
offsetXThe covered distance on the y axis (with sub-pixel)
velocityXThe velocity of the gesture in x direction (pixels/second)
velocityXThe velocity of the gesture in y direction (pixels/second)
pointerThe pointer that has performed the touch
Returns
True if the event was handled otherwise false

Reimplemented from ITouchActionHandler.

◆ OnMultiTouchUp()

bool CGenericTouchActionHandler::OnMultiTouchUp ( float x,
float y,
int32_t pointer )
overridevirtual

A touch has been lifted (but there are still active touches)

Parameters
xThe x coordinate (with sub-pixel) of the touch
yThe y coordinate (with sub-pixel) of the touch
pointerThe pointer that has performed the touch
Returns
True if the event was handled otherwise false

Reimplemented from ITouchActionHandler.

◆ OnRotate()

void CGenericTouchActionHandler::OnRotate ( float centerX,
float centerY,
float angle )
overridevirtual

Two simultaneous touches have been held down and moved to perform a rotating gesture.

Parameters
centerXThe x coordinate (with sub-pixel) of the center of the two touches
centerYThe y coordinate (with sub-pixel) of the center of the two touches
angleThe clockwise angle in degrees of the rotation
Returns
True if the event was handled otherwise false

Reimplemented from ITouchActionHandler.

◆ OnSingleTouchEnd()

bool CGenericTouchActionHandler::OnSingleTouchEnd ( float x,
float y )
overridevirtual

A single touch has been lifted.

Parameters
xThe x coordinate (with sub-pixel) of the touch
yThe y coordinate (with sub-pixel) of the touch
Returns
True if the event was handled otherwise false
See also
OnSingleTap

Reimplemented from ITouchActionHandler.

◆ OnSingleTouchHold()

bool CGenericTouchActionHandler::OnSingleTouchHold ( float x,
float y )
overridevirtual

A single touch has been held down for a certain amount of time.

Parameters
xThe x coordinate (with sub-pixel) of the touch
yThe y coordinate (with sub-pixel) of the touch
Returns
True if the event was handled otherwise false
See also
OnSingleLongPress

Reimplemented from ITouchActionHandler.

◆ OnSingleTouchMove()

bool CGenericTouchActionHandler::OnSingleTouchMove ( float x,
float y,
float offsetX,
float offsetY,
float velocityX,
float velocityY )
overridevirtual

A single touch has moved.

Parameters
xThe x coordinate (with sub-pixel) of the current touch
yThe y coordinate (with sub-pixel) of the current touch
offsetXThe covered distance on the x axis (with sub-pixel)
offsetXThe covered distance on the y axis (with sub-pixel)
velocityXThe velocity of the gesture in x direction (pixels/second)
velocityXThe velocity of the gesture in y direction (pixels/second)
Returns
True if the event was handled otherwise false
See also
OnTouchGesturePan

Reimplemented from ITouchActionHandler.

◆ OnSingleTouchStart()

bool CGenericTouchActionHandler::OnSingleTouchStart ( float x,
float y )
overridevirtual

A single touch has started.

Parameters
xThe x coordinate (with sub-pixel) of the touch
yThe y coordinate (with sub-pixel) of the touch
Returns
True if the event was handled otherwise false
See also
OnSingleTap

Reimplemented from ITouchActionHandler.

◆ OnSwipe()

void CGenericTouchActionHandler::OnSwipe ( TouchMoveDirection direction,
float xDown,
float yDown,
float xUp,
float yUp,
float velocityX,
float velocityY,
int32_t pointers = 1 )
overridevirtual

One or more touches has been moved quickly in a single direction in a short time.

Parameters
directionThe direction (left, right, up, down) of the swipe gesture
xDownThe x coordinate (with sub-pixel) of the first touch
yDownThe y coordinate (with sub-pixel) of the first touch
xUpThe x coordinate (with sub-pixel) of the last touch
yUpThe y coordinate (with sub-pixel) of the last touch
velocityXThe velocity of the gesture in x direction (pixels/second)
velocityXThe velocity of the gesture in y direction (pixels/second)
pointersThe number of pointers involved (default 1)
Returns
True if the event was handled otherwise false

Reimplemented from ITouchActionHandler.

◆ OnTap()

void CGenericTouchActionHandler::OnTap ( float x,
float y,
int32_t pointers = 1 )
overridevirtual

A tap with a one or more touches has been performed.

Parameters
xThe x coordinate (with sub-pixel) of the touch
yThe y coordinate (with sub-pixel) of the touch
pointersThe number of pointers involved (default 1)
Returns
True if the event was handled otherwise false

Reimplemented from ITouchActionHandler.

◆ OnTouchAbort()

void CGenericTouchActionHandler::OnTouchAbort ( )
overridevirtual

A touch action has been aborted.

Reimplemented from ITouchActionHandler.

◆ OnTouchGestureEnd()

bool CGenericTouchActionHandler::OnTouchGestureEnd ( float x,
float y,
float offsetX,
float offsetY,
float velocityX,
float velocityY )
overridevirtual

A pan gesture with a single touch has ended.

Parameters
xThe x coordinate (with sub-pixel) of the current touch
yThe y coordinate (with sub-pixel) of the current touch
offsetXThe covered distance on the x axis (with sub-pixel)
offsetXThe covered distance on the y axis (with sub-pixel)
velocityXThe velocity of the gesture in x direction (pixels/second)
velocityXThe velocity of the gesture in y direction (pixels/second)
Returns
True if the event was handled otherwise false

Reimplemented from ITouchActionHandler.

◆ OnTouchGesturePan()

bool CGenericTouchActionHandler::OnTouchGesturePan ( float x,
float y,
float offsetX,
float offsetY,
float velocityX,
float velocityY )
overridevirtual

A pan gesture with a single touch is in progress.

Parameters
xThe x coordinate (with sub-pixel) of the current touch
yThe y coordinate (with sub-pixel) of the current touch
offsetXThe covered distance on the x axis (with sub-pixel)
offsetXThe covered distance on the y axis (with sub-pixel)
velocityXThe velocity of the gesture in x direction (pixels/second)
velocityXThe velocity of the gesture in y direction (pixels/second)
Returns
True if the event was handled otherwise false

Reimplemented from ITouchActionHandler.

◆ OnTouchGestureStart()

bool CGenericTouchActionHandler::OnTouchGestureStart ( float x,
float y )
overridevirtual

A pan gesture with a single touch has been started.

Parameters
xThe x coordinate (with sub-pixel) of the initial touch
yThe y coordinate (with sub-pixel) of the initial touch
Returns
True if the event was handled otherwise false

Reimplemented from ITouchActionHandler.

◆ OnZoomPinch()

void CGenericTouchActionHandler::OnZoomPinch ( float centerX,
float centerY,
float zoomFactor )
overridevirtual

Two simultaneous touches have been held down and moved to perform a zooming/pinching gesture.

Parameters
centerXThe x coordinate (with sub-pixel) of the center of the two touches
centerYThe y coordinate (with sub-pixel) of the center of the two touches
zoomFactorThe zoom (> 1.0) or pinch (< 1.0) factor of the two touches
Returns
True if the event was handled otherwise false

Reimplemented from ITouchActionHandler.

◆ QuerySupportedGestures()

int CGenericTouchActionHandler::QuerySupportedGestures ( float x,
float y )

Asks the control at the given coordinates for a list of the supported gestures.

Parameters
xThe x coordinate (with sub-pixel) of the touch
yThe y coordinate (with sub-pixel) of the touch
Returns
EVENT_RESULT value of bitwise ORed gestures.

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