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 /* 00012 ** \file TorMapWidgetPopupMenu.h 00013 ** \brief Popup menu displayed when the user mouse clicks on a map placemark 00014 */ 00015 00016 #ifndef _TORMAPWIDGETPOPUPMENU_H 00017 #define _TORMAPWIDGETPOPUPMENU_H 00018 00019 #include "TorMapWidget.h" 00020 00021 #include <QObject> 00022 #include <QPoint> 00023 #include <QString> 00024 #include <QMenu> 00025 00026 00027 class TorMapWidgetPopupMenu : public QObject 00028 { 00029 Q_OBJECT 00030 00031 public: 00032 /** Constructor. <b>widget</b> is the parent map widget on which the popup 00033 * menu will be displayed. 00034 */ 00035 TorMapWidgetPopupMenu(TorMapWidget *widget); 00036 00037 public slots: 00038 /** Called when the user clicks on one or more map features located at mouse 00039 * position <b>pos</b>. <b>button</b> specifies the mouse button clicked. 00040 * A popup menu will be displayed depending on which mouse button was 00041 * clicked. 00042 * 00043 * \sa featureLeftClicked 00044 */ 00045 void featureClicked(const QPoint &pos, Qt::MouseButton button); 00046 00047 signals: 00048 /** Emitted when the user selects the router placemark whose fingerprint 00049 * is <b>id</b>. 00050 */ 00051 void displayRouterInfo(const QString &id); 00052 00053 protected: 00054 /** Called when the user left-clicks on one or more placemarks at mouse 00055 * position <b>pos</b>. If only one relay placemark exists at <b>pos</b>, 00056 * then the displayRouterInfo() signal will be emitted. Otherwise, a 00057 * popup menu will be displayed listing all placemarks at this location. 00058 * 00059 * \sa featureLeftClicked 00060 */ 00061 virtual void featureLeftClicked(const QPoint &pos); 00062 00063 private slots: 00064 /** Called when the user selects a relay from the popup menu used to 00065 * disambiguate a location with multiple relay placemarks. 00066 */ 00067 void relaySelected(QAction *action); 00068 00069 private: 00070 /** The parent map widget on which the popup menu is displayed. 00071 */ 00072 TorMapWidget *_widget; 00073 00074 /** Menu displayed when the user left-clicks on one or more placemarks. 00075 */ 00076 QMenu *_leftClickMenu; 00077 }; 00078 00079 #endif 00080