8#ifndef MARBLE_MARBLEINPUTHANDLER_H
9#define MARBLE_MARBLEINPUTHANDLER_H
13#include "GeoDataCoordinates.h"
14#include "marble_export.h"
30class MarbleAbstractPresenter;
31class AbstractDataPluginItem;
34class MARBLE_EXPORT MarbleInputHandler :
public QObject
39 explicit MarbleInputHandler(MarbleAbstractPresenter *);
40 ~MarbleInputHandler()
override;
42 void setPositionSignalConnected(
bool connected);
43 bool isPositionSignalConnected()
const;
53 void setMouseButtonPopupEnabled(
Qt::MouseButton mouseButton,
bool enabled);
61 void setPanViaArrowsEnabled(
bool enabled);
63 bool panViaArrowsEnabled()
const;
65 void setInertialEarthRotationEnabled(
bool enabled);
72 bool inertialEarthRotationEnabled()
const;
74 void setMouseViewRotationEnabled(
bool enabled);
76 bool mouseViewRotationEnabled()
const;
79 virtual void stopInertialEarthRotation();
83 void lmbRequest(
int,
int);
84 void rmbRequest(
int,
int);
87 void mouseClickScreenPosition(
int,
int);
88 void mouseMoveGeoPosition(
const QString &);
94 void mouseClickGeoPosition(qreal, qreal, GeoDataCoordinates::Unit);
97 void restoreViewContext();
104 virtual void installPluginEventFilter(RenderPlugin *renderPlugin) = 0;
107 Q_DISABLE_COPY(MarbleInputHandler)
110class AbstractSelectionRubber
113 virtual ~AbstractSelectionRubber() =
default;
114 virtual void show() = 0;
115 virtual void hide() = 0;
116 virtual bool isVisible()
const = 0;
117 virtual const QRect &geometry()
const = 0;
118 virtual void setGeometry(
const QRect &geometry) = 0;
121class MARBLE_EXPORT MarbleDefaultInputHandler :
public MarbleInputHandler
126 explicit MarbleDefaultInputHandler(MarbleAbstractPresenter *marblePresenter);
127 ~MarbleDefaultInputHandler()
override;
129 void stopInertialEarthRotation()
override;
137 const AbstractDataPluginItem *lastToolTipItem()
const;
139 QPoint toolTipPosition()
const;
141 virtual bool handleKeyPress(
QKeyEvent *e);
142 virtual void handleMouseButtonPressAndHold(
const QPoint &position);
145 void installPluginEventFilter(RenderPlugin *renderPlugin)
override = 0;
146 virtual void showLmbMenu(
int,
int) = 0;
147 virtual void showRmbMenu(
int,
int) = 0;
148 void handlePressAndHold();
150 virtual void openItemToolTip() = 0;
151 virtual void setCursor(
const QCursor &) = 0;
156 virtual AbstractSelectionRubber *selectionRubber() = 0;
164 virtual void handleMouseButtonPress(
QMouseEvent *e);
165 virtual void handleLeftMouseButtonPress(
QMouseEvent *e);
166 virtual void handleRightMouseButtonPress(
QMouseEvent *e);
167 virtual void handleMiddleMouseButtonPress(
QMouseEvent *e);
168 virtual void handleMouseButtonRelease(
QMouseEvent *e);
170 virtual void hideSelectionIfCtrlReleased(
QEvent *e);
174 virtual bool acceptMouse();
176 void notifyPosition(
bool isAboveMap, qreal mouseLon, qreal mouseLat);
178 void adjustCursorShape(
const QPoint &mousePosition,
const QPoint &mouseDirection);
180 Q_DISABLE_COPY(MarbleDefaultInputHandler)
Binds a QML item to a specific geodetic location in screen coordinates.