Vidalia 0.2.15
|
00001 /* 00002 ** This file is part of Vidalia, and is subject to the license terms in the 00003 ** LICENSE file, found in the top level directory of this distribution. If you 00004 ** did not receive the LICENSE file with this file, you may obtain it from the 00005 ** Vidalia source package distributed by the Vidalia Project at 00006 ** http://www.torproject.org/projects/vidalia.html. No part of Vidalia, 00007 ** including this file, may be copied, modified, propagated, or distributed 00008 ** except according to the terms described in the LICENSE file. 00009 */ 00010 00011 #ifndef _TORMAPWIDGETINPUTHANDLER_H 00012 #define _TORMAPWIDGETINPUTHANDLER_H 00013 00014 #include "MarbleWidgetInputHandler.h" 00015 00016 #include <QEvent> 00017 #include <QObject> 00018 #include <QPoint> 00019 00020 00021 class TorMapWidgetInputHandler : public Marble::MarbleWidgetInputHandler 00022 { 00023 Q_OBJECT 00024 00025 public: 00026 /** Default constructor. 00027 */ 00028 TorMapWidgetInputHandler(); 00029 00030 signals: 00031 /** Emitted when the user clicks on a map feature located at <b>point</b>. 00032 * <b>button</b> indicates which mouse button was clicked. 00033 */ 00034 void featureClicked(const QPoint &point, Qt::MouseButton button); 00035 00036 protected: 00037 /** Filter and handles event <b>e</b> that was sent to widget <b>obj</b>. 00038 * <b>obj</b> is always a MarbleWidget object. 00039 */ 00040 virtual bool eventFilter(QObject *obj, QEvent *e); 00041 00042 private: 00043 /** Returns true if the map has one or more features located at the screen 00044 * position <b>point</b>. 00045 */ 00046 bool pointHasFeatures(const QPoint &point) const; 00047 00048 int _mousePressedX; 00049 int _mousePressedY; 00050 qreal _mousePressedLon; 00051 qreal _mousePressedLat; 00052 }; 00053 00054 #endif 00055