TorMapWidgetPopupMenu.h

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

Generated on Mon Aug 30 19:10:00 2010 for Vidalia by  doxygen 1.5.9