/usr/include/marble/MarbleInputHandler.h is in libmarble-dev 4:17.12.3-0ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 | //
// This file is part of the Marble Virtual Globe.
//
// This program is free software licensed under the GNU LGPL. You can
// find a copy of this license in LICENSE.txt in the top directory of
// the source code.
//
// Copyright 2005-2007 Torsten Rahn <tackat@kde.org>
// Copyright 2007 Inge Wallin <ingwa@kde.org>
// Copyright 2014 Adam Dabrowski <adamdbrw@gmail.com>
//
#ifndef MARBLE_MARBLEINPUTHANDLER_H
#define MARBLE_MARBLEINPUTHANDLER_H
#include <QObject>
#include "marble_export.h"
#include "GeoDataCoordinates.h"
class QEvent;
class QKeyEvent;
class QMouseEvent;
class QTouchEvent;
class QWheelEvent;
class QGestureEvent;
class QCursor;
class QTimer;
class QString;
class QRect;
namespace Marble
{
class MarbleAbstractPresenter;
class AbstractDataPluginItem;
class RenderPlugin;
class MARBLE_EXPORT MarbleInputHandler : public QObject
{
Q_OBJECT
public:
explicit MarbleInputHandler( MarbleAbstractPresenter* );
~MarbleInputHandler() override;
void setPositionSignalConnected( bool connected );
bool isPositionSignalConnected() const;
/**
//
// The MarbleInputHandler handles mouse and keyboard input.
//
* @brief Set whether a popup menu appears on a click (not drag) with the left mouse button
* @param enabled True to enable the popup menu (default), false to disable it
*/
void setMouseButtonPopupEnabled( Qt::MouseButton mouseButton, bool enabled );
/**
* @brief Return whether the left mouse button popup menu is active
* @return True iff a popup menu is shown on left mouse button clicks
*/
bool isMouseButtonPopupEnabled( Qt::MouseButton mouseButton ) const;
void setPanViaArrowsEnabled( bool enabled );
bool panViaArrowsEnabled() const;
void setInertialEarthRotationEnabled( bool enabled );
/**
* @brief Returns true iff dragging the map with the mouse keeps spinning
* in the chosen direction for a slightly longer time than the mouse is
* actually performing the drag operation
*/
bool inertialEarthRotationEnabled() const;
Q_SIGNALS:
// Mouse button menus
void lmbRequest( int, int );
void rmbRequest( int, int );
//Gps coordinates
void mouseClickScreenPosition( int, int );
void mouseMoveGeoPosition( const QString& );
/*
* To detect mouse click followed by mouse move
* with no mouse move in between
*/
void mouseClickGeoPosition( qreal, qreal, GeoDataCoordinates::Unit );
protected Q_SLOTS:
void restoreViewContext();
protected:
class Protected;
Protected * const d;
private Q_SLOTS:
virtual void installPluginEventFilter( RenderPlugin *renderPlugin ) = 0;
private:
Q_DISABLE_COPY( MarbleInputHandler )
};
class AbstractSelectionRubber
{
public:
virtual ~AbstractSelectionRubber() {}
virtual void show() = 0;
virtual void hide() = 0;
virtual bool isVisible() const = 0;
virtual const QRect &geometry() const = 0;
virtual void setGeometry(const QRect &geometry) = 0;
};
class MARBLE_EXPORT MarbleDefaultInputHandler : public MarbleInputHandler
{
Q_OBJECT
public:
explicit MarbleDefaultInputHandler( MarbleAbstractPresenter* marblePresenter);
~MarbleDefaultInputHandler() override;
protected:
bool eventFilter( QObject *, QEvent * ) override;
bool handleMouseEvent(QMouseEvent *e);
bool handlePinch(const QPointF ¢er, qreal scaleFactor, Qt::GestureState state);
//FIXME - refactor (abstraction & composition)
const AbstractDataPluginItem *lastToolTipItem() const;
QTimer* toolTipTimer();
QPoint toolTipPosition() const;
virtual bool handleKeyPress(QKeyEvent *e);
virtual void handleMouseButtonPressAndHold(const QPoint &position);
private Q_SLOTS:
void installPluginEventFilter( RenderPlugin *renderPlugin ) override = 0;
virtual void showLmbMenu( int, int ) = 0;
virtual void showRmbMenu( int, int ) = 0;
void handlePressAndHold();
virtual void openItemToolTip() = 0;
virtual void setCursor(const QCursor &) = 0;
void lmbTimeout();
private:
virtual AbstractSelectionRubber *selectionRubber() = 0;
virtual bool layersEventFilter(QObject *, QEvent *) = 0;
virtual bool handleTouch(QTouchEvent *e);
virtual bool handleDoubleClick(QMouseEvent *e);
virtual bool handleWheel(QWheelEvent *e);
virtual bool handleGesture(QGestureEvent *e);
virtual void handleMouseButtonPress(QMouseEvent *e);
virtual void handleLeftMouseButtonPress(QMouseEvent *e);
virtual void handleRightMouseButtonPress(QMouseEvent *e);
virtual void handleMiddleMouseButtonPress(QMouseEvent *e);
virtual void handleMouseButtonRelease(QMouseEvent *e);
virtual void hideSelectionIfCtrlReleased(QEvent *e);
virtual void checkReleasedMove(QMouseEvent *e);
//Returns whatever should be returned from mouse event handling loop
virtual bool acceptMouse();
void notifyPosition(bool isAboveMap, qreal mouseLon, qreal mouseLat);
QPoint mouseMovedOutside(QMouseEvent *event);
void adjustCursorShape(const QPoint& mousePosition, const QPoint& mouseDirection);
Q_DISABLE_COPY(MarbleDefaultInputHandler)
class Private;
Private * const d;
};
}
#endif //MARBLE_MARBLEINPUTHANDLER_H
|