The event holds the information about a touch event occurrence. More...
#include <kanzi/core.ui/platform/input/common/events.hpp>
Classes | |
class | TouchPoint |
The TouchPoint class holds information about a touch point, such as a finger. More... | |
Public Member Functions | |
TouchState | getState () const |
Returns the overall state of the touch event. | |
const TouchPoint & | getTouchPointByIndex (size_t index) const |
Returns the reference to the touch point at a given index. | |
size_t | getTouchPointCount () const |
Returns the number of touch points that the event holds. | |
bool | isFromPointer () const |
Returns whether a touch event is a pointer event. | |
bool | isMovementOnly () const |
Returns true if the touch event is a movement event only. | |
TouchEvent (TouchState state, const list< TouchEvent::TouchPoint > &points) | |
Creates a touch event with a list of points and an overall touch state. | |
TouchEvent (TouchState state, const TouchEvent::TouchPoint &point) | |
Creates a touch event with a single touch point. | |
TouchEvent (TouchState state, size_t id, TouchPointState pointState, float x, float y, float pressure=1.0f, float radius=1.0f) | |
Creates a touch event with a single touch point. | |
UniqueEventPtr | transform (const Matrix3x3 &transformationMatrix) const |
Transforms the touch event using the given transformationMatrix. | |
Public Member Functions inherited from kanzi::InputEvent | |
Type | getType () const |
Returns the type of the event. | |
InputEvent (Type type) | |
Constructs an event with a given type. | |
bool | isHandled () const |
Returns true if the event is handled, false if not. | |
void | markHandled () |
Marks the event as handled. | |
virtual | ~InputEvent () |
Destructor. | |
Static Public Member Functions | |
static bool | isPointerId (int id) |
Returns whether the given id is equal to the ID reserved for mouse pointer events. | |
Protected Types | |
typedef vector< TouchPoint > | TouchPointContainer |
The touch point container type. | |
Protected Attributes | |
TouchPointContainer | m_points |
Container with the touch points. | |
TouchState | m_state |
The overall state of the touch event. | |
Additional Inherited Members | |
Public Types inherited from kanzi::InputEvent | |
enum | Type { Key , Pointer , Touch , WindowResized , WindowResizeRequest , WindowFocusLost , WindowFocusGained , WindowHidden , WindowResourcesLost , WindowOrientationChanged , WindowRedrawRequest , WindowPlacement , WindowClosed , ApplicationPaused , ApplicationSleep , ApplicationWakeup , DebugToggleHud , DebugSetHud , UserEvent } |
InputEvent type enumeration. More... | |
The event holds the information about a touch event occurrence.
A touch event can have several touch points. Each touch point has information like identifier, state, coordinates, pressure, and radius. The touch point state specifies whether the touch point is down, has moved, or is released. Beside these, the touch event has an overall state that specifies whether the touch event holds the first finger of the kind, an update on the events, or holds the last finger of a gesture.
The type of the event is InputEvent::Touch.
|
protected |
The touch point container type.
|
explicit |
Creates a touch event with a list of points and an overall touch state.
state | The overall touch event state. |
points | The list of touch points held by the touch event. |
|
explicit |
Creates a touch event with a single touch point.
state | The overall touch event state. |
id | The touch point identifier. |
pointState | The touch point state. |
x | The x axis coordinate of the touch point. |
y | The y axis coordinate of the touch point. |
pressure | The pressure of the touch point. The default value is 1.0. |
radius | The radius of the touch point. The default value is 1.0. |
|
explicit |
Creates a touch event with a single touch point.
state | The overall touch event state. |
point | The touch point data. |
|
inline |
Returns the number of touch points that the event holds.
|
inline |
Returns the overall state of the touch event.
const TouchPoint & kanzi::TouchEvent::getTouchPointByIndex | ( | size_t | index | ) | const |
Returns the reference to the touch point at a given index.
If the index is larger than number of the touch points held by the touch event, the method asserts.
index | The index of the touch point. |
bool kanzi::TouchEvent::isMovementOnly | ( | ) | const |
Returns true if the touch event is a movement event only.
This means that the touch event contains touch points with moving state.
UniqueEventPtr kanzi::TouchEvent::transform | ( | const Matrix3x3 & | transformationMatrix | ) | const |
Transforms the touch event using the given transformationMatrix.
transformationMatrix | The transformation matrix to apply on the touch points. |
bool kanzi::TouchEvent::isFromPointer | ( | ) | const |
Returns whether a touch event is a pointer event.
Returns whether the given id is equal to the ID reserved for mouse pointer events.
id | The ID to check. |
|
protected |
Container with the touch points.
|
protected |
The overall state of the touch event.