File indexing completed on 2024-07-21 06:33:37

0001 // SPDX-License-Identifier: LGPL-2.1-or-later
0002 //
0003 // SPDX-FileCopyrightText: 2010 Dennis Nienhüser <nienhueser@kde.org>
0004 //
0005 
0006 #ifndef MARBLE_MONAVCONFIGWIDGET_H
0007 #define MARBLE_MONAVCONFIGWIDGET_H
0008 
0009 #include "ui_MonavConfigWidget.h"
0010 #include "RoutingRunnerPlugin.h"
0011 
0012 #include <QWidget>
0013 
0014 class QNetworkReply;
0015 
0016 namespace Marble
0017 {
0018 
0019 class MonavPlugin;
0020 class MonavConfigWidgetPrivate;
0021 
0022 class MonavConfigWidget : public RoutingRunnerPlugin::ConfigWidget, private Ui::MonavConfigWidget
0023 {
0024     Q_OBJECT
0025 
0026 public:
0027     explicit MonavConfigWidget( MonavPlugin* plugin );
0028 
0029     ~MonavConfigWidget() override;
0030 
0031     void loadSettings( const QHash<QString, QVariant> &settings ) override;
0032 
0033     QHash<QString, QVariant> settings() const override;
0034 
0035 protected:
0036     void showEvent ( QShowEvent * event ) override;
0037 
0038 private Q_SLOTS:
0039     void retrieveMapList( QNetworkReply *reply );
0040 
0041     void retrieveData();
0042 
0043     void updateComboBoxes();
0044 
0045     void updateStates();
0046 
0047     void updateRegions();
0048 
0049     void downloadMap();
0050 
0051     void updateProgressBar( qint64 bytesReceived, qint64 bytesTotal );
0052 
0053     void mapInstalled( int exitStatus );
0054 
0055     void updateTransportTypeFilter( const QString &filter );
0056 
0057     void removeMap( int index );
0058 
0059     void upgradeMap( int index );
0060 
0061     void cancelOperation();
0062 
0063 private:
0064     friend class MonavConfigWidgetPrivate;
0065     MonavConfigWidgetPrivate* const d;
0066 };
0067 
0068 }
0069 
0070 #endif // MARBLE_MONAVCONFIGWIDGET_H