libosmscout 0.1
Loading...
Searching...
No Matches
osmscout::InputHandler Class Reference

Input handler retrieve all inputs from user and may change MapView (emits viewChange signal). More...

#include <InputHandler.h>

Inheritance diagram for osmscout::InputHandler:

Signals

void viewChanged (const MapView &view)

Public Member Functions

virtual bool animationInProgress ()
virtual bool currentPosition (bool locationValid, osmscout::GeoCoord currentPosition)
virtual bool focusOutEvent (QFocusEvent *event)
 InputHandler (const MapView &view)
virtual bool isFollowVehicle ()
virtual bool isLockedToPosition ()
virtual bool move (const QVector2D &vector)
virtual void painted ()
virtual bool pivotBy (double angleChange)
virtual bool rotateBy (double angleChange)
virtual bool rotateTo (double angle)
virtual bool showCoordinates (const osmscout::GeoCoord &coord, const osmscout::Magnification &magnification, const osmscout::Bearing &bearing)
virtual bool touch (const QTouchEvent &event)
virtual bool vehiclePosition (const VehiclePosition &vehiclePosition, bool autoRotateMap)
virtual void widgetResized (const QSizeF &widgetSize)
virtual bool zoom (double zoomFactor, const QPoint &widgetPosition, const QRect &widgetDimension)
 ~InputHandler () override=default

Protected Attributes

MapView view

Detailed Description

Input handler retrieve all inputs from user and may change MapView (emits viewChange signal).

If handler don't accept specific action, returns false. In such case, default handler for this action should be activated.

Input handlers is application of behaviour pattern. It solves problems like:

  • what should happen when finger is on the screen and plus button is pressed
  • recognising multitouch gestures

Qt provides api for register custom gesture recognizers, but it is not available in QML world and its api don't fit to Map application requierements.

Handler also controls map animations.

Constructor & Destructor Documentation

◆ InputHandler()

osmscout::InputHandler::InputHandler ( const MapView & view)
explicit

◆ ~InputHandler()

Member Function Documentation

◆ animationInProgress()

bool osmscout::InputHandler::animationInProgress ( )
virtual

◆ currentPosition()

bool osmscout::InputHandler::currentPosition ( bool locationValid,
osmscout::GeoCoord currentPosition )
virtual

Reimplemented in osmscout::LockHandler.

Referenced by ~InputHandler().

◆ focusOutEvent()

bool osmscout::InputHandler::focusOutEvent ( QFocusEvent * event)
virtual

Reimplemented in osmscout::LockHandler.

Referenced by ~InputHandler().

◆ isFollowVehicle()

bool osmscout::InputHandler::isFollowVehicle ( )
virtual

Reimplemented in osmscout::VehicleFollowHandler.

Referenced by ~InputHandler().

◆ isLockedToPosition()

bool osmscout::InputHandler::isLockedToPosition ( )
virtual

◆ move()

bool osmscout::InputHandler::move ( const QVector2D & vector)
virtual

◆ painted()

void osmscout::InputHandler::painted ( )
virtual

Referenced by ~InputHandler().

◆ pivotBy()

bool osmscout::InputHandler::pivotBy ( double angleChange)
virtual

Reimplemented in osmscout::MoveHandler.

Referenced by ~InputHandler().

◆ rotateBy()

bool osmscout::InputHandler::rotateBy ( double angleChange)
virtual

◆ rotateTo()

bool osmscout::InputHandler::rotateTo ( double angle)
virtual

Reimplemented in osmscout::MoveHandler.

Referenced by ~InputHandler().

◆ showCoordinates()

bool osmscout::InputHandler::showCoordinates ( const osmscout::GeoCoord & coord,
const osmscout::Magnification & magnification,
const osmscout::Bearing & bearing )
virtual

Reimplemented in osmscout::JumpHandler, and osmscout::LockHandler.

Referenced by ~InputHandler().

◆ touch()

bool osmscout::InputHandler::touch ( const QTouchEvent & event)
virtual

◆ vehiclePosition()

bool osmscout::InputHandler::vehiclePosition ( const VehiclePosition & vehiclePosition,
bool autoRotateMap )
virtual

Reimplemented in osmscout::VehicleFollowHandler.

Referenced by ~InputHandler().

◆ viewChanged

void osmscout::InputHandler::viewChanged ( const MapView & view)
signal

◆ widgetResized()

void osmscout::InputHandler::widgetResized ( const QSizeF & widgetSize)
virtual

◆ zoom()

bool osmscout::InputHandler::zoom ( double zoomFactor,
const QPoint & widgetPosition,
const QRect & widgetDimension )
virtual

Member Data Documentation

◆ view


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