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 &);
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;
132 bool eventFilter(QObject *, QEvent *)
override;
133 bool handleMouseEvent(QMouseEvent *e);
134 bool handlePinch(
const QPointF ¢er, qreal scaleFactor,
Qt::GestureState state);
137 const AbstractDataPluginItem *lastToolTipItem()
const;
138 QTimer *toolTipTimer();
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;
157 virtual bool layersEventFilter(QObject *, QEvent *) = 0;
159 virtual bool handleTouch(QTouchEvent *e);
160 virtual bool handleDoubleClick(QMouseEvent *e);
161 virtual bool handleWheel(QWheelEvent *e);
162 virtual bool handleGesture(QGestureEvent *e);
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);
171 virtual void checkReleasedMove(QMouseEvent *e);
174 virtual bool acceptMouse();
176 void notifyPosition(
bool isAboveMap, qreal mouseLon, qreal mouseLat);
177 QPoint mouseMovedOutside(QMouseEvent *event);
178 void adjustCursorShape(
const QPoint &mousePosition,
const QPoint &mouseDirection);
180 Q_DISABLE_COPY(MarbleDefaultInputHandler)
Unit
enum used constructor to specify the units used
The abstract class that creates a renderable item.
Binds a QML item to a specific geodetic location in screen coordinates.