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

0001 // SPDX-License-Identifier: LGPL-2.1-or-later
0002 //
0003 // SPDX-FileCopyrightText: 2011 Utku Aydın <utkuaydin34@gmail.com>
0004 //
0005 
0006 #ifndef MARBLE_MAPWIZARD_H
0007 #define MARBLE_MAPWIZARD_H
0008 
0009 #include <QWizard>
0010 
0011 #include "marble_export.h"
0012 
0013 /**
0014  * @file
0015  * This file contains the header for MapWizard
0016  * @author Utku Aydın <utkuaydin34@gmail.com>
0017  */
0018 
0019 class QNetworkReply;
0020 
0021 namespace Marble {
0022 
0023 class GeoSceneDocument;
0024 
0025 class MapWizardPrivate;
0026 
0027 class MARBLE_EXPORT MapWizard : public QWizard
0028 {
0029     Q_OBJECT
0030 
0031 public:
0032     explicit MapWizard(QWidget *parent = nullptr);
0033     ~MapWizard() override;
0034 
0035     QStringList wmsServers() const;
0036     void setWmsServers( const QStringList& uris );
0037 
0038     QStringList wmtsServers() const;
0039     void setWmtsServers( const QStringList& uris );
0040 
0041     QStringList staticUrlServers() const;
0042     void setStaticUrlServers( const QStringList& uris );
0043 
0044     static QString createArchive( QWidget *parent, const QString& mapId );
0045     static void deleteArchive( const QString& mapId );
0046 
0047     // QWizard's functions
0048     void accept() override;
0049     bool validateCurrentPage() override;
0050     int nextId() const override;
0051     void cleanupPage(int id) override;
0052 
0053 public Q_SLOTS:
0054     // WMS protocol
0055     void processCapabilitiesResults();
0056     void processSelectedLayerInformation();
0057     void processImageResults();
0058 
0059     void createWmsLegend();
0060 
0061     // Open file dialogs
0062     void querySourceImage();
0063     void queryPreviewImage();
0064     void queryLegendImage();
0065 
0066     // Other
0067     void setLineEditWms(const QString& text);
0068     void setLayerButtonsVisible( bool visible );
0069     void setSearchFieldVisible( bool visible );
0070     void showPreview();
0071 
0072     void updateSearchFilter(const QString& text);
0073     void updateListViewSelection();
0074     void updateBackdropCheckBox();
0075     void updateOwsServiceType();
0076     void chooseBackgroundColor();
0077 
0078 private:
0079     Q_PRIVATE_SLOT( d, void pageEntered( int ) )
0080 
0081     GeoSceneDocument* createDocument();
0082     bool createFiles( const GeoSceneDocument* head );
0083     static QString createLegendHtml( const QString& image = QLatin1String("./legend/legend.png") );
0084     void createLegendFile( const QString& legendHtml );
0085     void createLegend();
0086     void downloadLegend( const QString& url );
0087 
0088     Q_DISABLE_COPY( MapWizard )
0089     MapWizardPrivate * const d;
0090 };
0091 
0092 }
0093 
0094 #endif