Vidalia  0.3.1
TorMapWidgetPopupMenu.h
Go to the documentation of this file.
1 /*
2 ** This file is part of Vidalia, and is subject to the license terms in the
3 ** LICENSE file, found in the top level directory of this distribution. If you
4 ** did not receive the LICENSE file with this file, you may obtain it from the
5 ** Vidalia source package distributed by the Vidalia Project at
6 ** http://www.torproject.org/projects/vidalia.html. No part of Vidalia,
7 ** including this file, may be copied, modified, propagated, or distributed
8 ** except according to the terms described in the LICENSE file.
9 */
10 
11 /*
12 ** \file TorMapWidgetPopupMenu.h
13 ** \brief Popup menu displayed when the user mouse clicks on a map placemark
14 */
15 
16 #ifndef _TORMAPWIDGETPOPUPMENU_H
17 #define _TORMAPWIDGETPOPUPMENU_H
18 
19 #include "TorMapWidget.h"
20 
21 #include <QObject>
22 #include <QPoint>
23 #include <QString>
24 #include <QMenu>
25 
26 
27 class TorMapWidgetPopupMenu : public QObject
28 {
29  Q_OBJECT
30 
31 public:
32  /** Constructor. <b>widget</b> is the parent map widget on which the popup
33  * menu will be displayed.
34  */
36 
37 public slots:
38  /** Called when the user clicks on one or more map features located at mouse
39  * position <b>pos</b>. <b>button</b> specifies the mouse button clicked.
40  * A popup menu will be displayed depending on which mouse button was
41  * clicked.
42  *
43  * \sa featureLeftClicked
44  */
45  void featureClicked(const QPoint &pos, Qt::MouseButton button);
46 
47 signals:
48  /** Emitted when the user selects the router placemark whose fingerprint
49  * is <b>id</b>.
50  */
51  void displayRouterInfo(const QString &id);
52 
53 protected:
54  /** Called when the user left-clicks on one or more placemarks at mouse
55  * position <b>pos</b>. If only one relay placemark exists at <b>pos</b>,
56  * then the displayRouterInfo() signal will be emitted. Otherwise, a
57  * popup menu will be displayed listing all placemarks at this location.
58  *
59  * \sa featureLeftClicked
60  */
61  virtual void featureLeftClicked(const QPoint &pos);
62 
63 private slots:
64  /** Called when the user selects a relay from the popup menu used to
65  * disambiguate a location with multiple relay placemarks.
66  */
67  void relaySelected(QAction *action);
68 
69 private:
70  /** The parent map widget on which the popup menu is displayed.
71  */
73 
74  /** Menu displayed when the user left-clicks on one or more placemarks.
75  */
77 };
78 
79 #endif
80 
TorMapWidgetPopupMenu::featureClicked
void featureClicked(const QPoint &pos, Qt::MouseButton button)
Definition: TorMapWidgetPopupMenu.cpp:39
TorMapWidget.h
TorMapWidgetPopupMenu::featureLeftClicked
virtual void featureLeftClicked(const QPoint &pos)
Definition: TorMapWidgetPopupMenu.cpp:55
TorMapWidgetPopupMenu::_widget
TorMapWidget * _widget
Definition: TorMapWidgetPopupMenu.h:72
TorMapWidgetPopupMenu
Definition: TorMapWidgetPopupMenu.h:27
TorMapWidgetPopupMenu::relaySelected
void relaySelected(QAction *action)
Definition: TorMapWidgetPopupMenu.cpp:83
TorMapWidgetPopupMenu::TorMapWidgetPopupMenu
TorMapWidgetPopupMenu(TorMapWidget *widget)
Definition: TorMapWidgetPopupMenu.cpp:29
TorMapWidgetPopupMenu::_leftClickMenu
QMenu * _leftClickMenu
Definition: TorMapWidgetPopupMenu.h:76
TorMapWidget
Definition: TorMapWidget.h:37
TorMapWidgetPopupMenu::displayRouterInfo
void displayRouterInfo(const QString &id)