File indexing completed on 2024-04-21 11:23:25

0001 // SPDX-License-Identifier: LGPL-2.1-or-later
0002 //
0003 // SPDX-FileCopyrightText: 2004-2007 Torsten Rahn <tackat@kde.org>
0004 // SPDX-FileCopyrightText: 2007 Inge Wallin <ingwa@kde.org>
0005 // SPDX-FileCopyrightText: 2007 Thomas Zander <zander@kde.org>
0006 // SPDX-FileCopyrightText: 2010 Bastian Holst <bastianholst@gmx.de>
0007 //
0008 
0009 #ifndef MARBLE_MAPVIEWWIDGET_H
0010 #define MARBLE_MAPVIEWWIDGET_H
0011 
0012 // Marble
0013 #include "MarbleGlobal.h"
0014 #include "marble_export.h"
0015 
0016 // Qt
0017 #include <QWidget>
0018 
0019 namespace Marble
0020 {
0021 
0022 class MapThemeManager;
0023 class MarbleWidget;
0024 
0025 class MARBLE_EXPORT MapViewWidget : public QWidget
0026 {
0027     Q_OBJECT
0028  public:
0029     explicit MapViewWidget( QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags() );
0030     ~MapViewWidget() override;
0031 
0032     /**
0033      * @brief Set a MarbleWidget associated to this widget.
0034      * @param widget  the MarbleWidget to be set.
0035      */
0036     void setMarbleWidget( MarbleWidget *widget, MapThemeManager *mapThemeManager );
0037 
0038 protected:
0039     void resizeEvent(QResizeEvent *event) override;
0040 
0041  public Q_SLOTS:
0042     void setMapThemeId( const QString & );
0043     void setProjection( Projection projection );
0044 
0045 private Q_SLOTS:
0046     void globeViewRequested();
0047     void mercatorViewRequested();
0048     void flatViewRequested();
0049     void gnomonicViewRequested();
0050     void stereographicViewRequested();
0051     void lambertAzimuthalViewRequested();
0052     void azimuthalEquidistantViewRequested(); 
0053     void verticalPerspectiveViewRequested();
0054 
0055  private:
0056     Q_PRIVATE_SLOT( d, void celestialBodySelected( int comboIndex ) )
0057 
0058     Q_PRIVATE_SLOT( d, void projectionSelected( int projectionIndex ) )
0059 
0060     Q_PRIVATE_SLOT( d, void mapThemeSelected( QModelIndex index ) )
0061     Q_PRIVATE_SLOT( d, void mapThemeSelected( int index ) )
0062 
0063     Q_PRIVATE_SLOT( d, void showContextMenu( const QPoint& pos ) )
0064     Q_PRIVATE_SLOT( d, void deleteMap() )
0065     Q_PRIVATE_SLOT( d, void toggleFavorite() )
0066     Q_PRIVATE_SLOT( d, void toggleIconSize() )
0067 
0068  Q_SIGNALS:
0069     void celestialBodyChanged( const QString& );
0070     void mapThemeIdChanged( const QString& );
0071     void projectionChanged( Projection );
0072     void showMapWizard();
0073     void mapThemeDeleted();
0074 
0075  private:
0076     Q_DISABLE_COPY( MapViewWidget )
0077 
0078     friend class Private;
0079     class Private;
0080     Private * const d;
0081 };
0082 
0083 }
0084 
0085 #endif