File indexing completed on 2024-04-14 03:47:56

0001 // SPDX-License-Identifier: LGPL-2.1-or-later
0002 //
0003 // SPDX-FileCopyrightText: 2006-2007 Torsten Rahn <tackat@kde.org>
0004 // SPDX-FileCopyrightText: 2007 Inge Wallin <ingwa@kde.org>
0005 //
0006 
0007 #ifndef MARBLE_MARBLEWIDGETPOPUPMENU_H
0008 #define MARBLE_MARBLEWIDGETPOPUPMENU_H
0009 
0010 #include "marble_export.h"
0011 
0012 #include <QObject>
0013 
0014 class QAction;
0015 class QPoint;
0016 
0017 namespace Marble
0018 {
0019 
0020 class MarbleWidget;
0021 class MarbleModel;
0022 class GeoDataCoordinates;
0023 class GeoDataPlacemark;
0024 
0025 /**
0026  * The MarbleWidgetPopupMenu handles context menus.
0027  */
0028 class MARBLE_EXPORT MarbleWidgetPopupMenu  : public QObject
0029 {
0030     Q_OBJECT
0031 
0032  public:
0033     MarbleWidgetPopupMenu( MarbleWidget*, const MarbleModel* );
0034 
0035     ~MarbleWidgetPopupMenu() override;
0036 
0037     /**
0038       * Adds the action to the menu associated with the specified
0039       * mouse button
0040       */
0041     void addAction( Qt::MouseButton button, QAction* action );
0042 
0043     /**
0044      * @brief mousePosition Position of the last mouse button click
0045      * @return
0046      */
0047     QPoint mousePosition() const;
0048 
0049  public Q_SLOTS:
0050     void  showLmbMenu( int, int );
0051     void  showRmbMenu( int, int );
0052 
0053 private Q_SLOTS:
0054     void resetMenu();
0055     void slotInfoDialog();
0056     void slotCopyCoordinates();
0057     void slotCopyGeo();
0058     void slotAboutDialog();
0059 
0060 private Q_SLOTS:
0061     void directionsFromHere();
0062     void directionsToHere();
0063     void startReverseGeocoding();
0064     void showAddressInformation( const GeoDataCoordinates &coordinates, const GeoDataPlacemark &placemark );
0065     void addBookmark();
0066     void toggleFullscreen( bool enabled );
0067 
0068  private:
0069     Q_DISABLE_COPY( MarbleWidgetPopupMenu )
0070     class Private;
0071     Private* const d;
0072 };
0073 
0074 }
0075 
0076 #endif