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

Convenience interface implementing ITouchActionHandler with an implementation that forwards any ITouchActionHandler-related calls to a previously registered ITouchActionHandler. More...

#include <ITouchInputHandling.h>

Inheritance diagram for ITouchInputHandling:
ITouchActionHandler IGenericTouchGestureDetector ITouchInputHandler CGenericTouchPinchDetector CGenericTouchRotateDetector CGenericTouchSwipeDetector CGenericTouchInputHandler

Public Member Functions

 ITouchInputHandling ()
 
 ~ITouchInputHandling () override=default
 
void RegisterHandler (ITouchActionHandler *touchHandler)
 Register a touch input handler.
 
void UnregisterHandler ()
 Unregister the previously registered touch handler.
 

Protected 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.
 
- Protected Member Functions inherited from ITouchActionHandler
virtual ~ITouchActionHandler ()=default
 

Detailed Description

Convenience interface implementing ITouchActionHandler with an implementation that forwards any ITouchActionHandler-related calls to a previously registered ITouchActionHandler.

See also
ITouchActionHandler

Constructor & Destructor Documentation

◆ ITouchInputHandling()

ITouchInputHandling::ITouchInputHandling ( )
inline

◆ ~ITouchInputHandling()

ITouchInputHandling::~ITouchInputHandling ( )
overridedefault

Member Function Documentation

◆ OnLongPress()

void ITouchInputHandling::OnLongPress ( float x,
float y,
int32_t pointers = 1 )
overrideprotectedvirtual

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 ITouchInputHandling::OnMultiTouchDown ( float x,
float y,
int32_t pointer )
overrideprotectedvirtual

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 ITouchInputHandling::OnMultiTouchHold ( float x,
float y,
int32_t pointers = 2 )
overrideprotectedvirtual

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 ITouchInputHandling::OnMultiTouchMove ( float x,
float y,
float offsetX,
float offsetY,
float velocityX,
float velocityY,
int32_t pointer )
overrideprotectedvirtual

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 ITouchInputHandling::OnMultiTouchUp ( float x,
float y,
int32_t pointer )
overrideprotectedvirtual

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 ITouchInputHandling::OnRotate ( float centerX,
float centerY,
float angle )
overrideprotectedvirtual

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 ITouchInputHandling::OnSingleTouchEnd ( float x,
float y )
overrideprotectedvirtual

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 ITouchInputHandling::OnSingleTouchHold ( float x,
float y )
overrideprotectedvirtual

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 ITouchInputHandling::OnSingleTouchMove ( float x,
float y,
float offsetX,
float offsetY,
float velocityX,
float velocityY )
overrideprotectedvirtual

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 ITouchInputHandling::OnSingleTouchStart ( float x,
float y )
overrideprotectedvirtual

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 ITouchInputHandling::OnSwipe ( TouchMoveDirection direction,
float xDown,
float yDown,
float xUp,
float yUp,
float velocityX,
float velocityY,
int32_t pointers = 1 )
overrideprotectedvirtual

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 ITouchInputHandling::OnTap ( float x,
float y,
int32_t pointers = 1 )
overrideprotectedvirtual

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 ITouchInputHandling::OnTouchAbort ( )
overrideprotectedvirtual

A touch action has been aborted.

Reimplemented from ITouchActionHandler.

◆ OnTouchGestureEnd()

bool ITouchInputHandling::OnTouchGestureEnd ( float x,
float y,
float offsetX,
float offsetY,
float velocityX,
float velocityY )
overrideprotectedvirtual

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 ITouchInputHandling::OnTouchGesturePan ( float x,
float y,
float offsetX,
float offsetY,
float velocityX,
float velocityY )
overrideprotectedvirtual

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 ITouchInputHandling::OnTouchGestureStart ( float x,
float y )
overrideprotectedvirtual

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 ITouchInputHandling::OnZoomPinch ( float centerX,
float centerY,
float zoomFactor )
overrideprotectedvirtual

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.

◆ RegisterHandler()

void ITouchInputHandling::RegisterHandler ( ITouchActionHandler * touchHandler)

Register a touch input handler.

There can only be one touch input handler.

Parameters
touchHandlerAn instance of a touch handler implementing the ITouchActionHandler interface
See also
UnregisterHandler

◆ UnregisterHandler()

void ITouchInputHandling::UnregisterHandler ( )

Unregister the previously registered touch handler.

See also
RegisterHandler

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