File indexing completed on 2024-05-19 11:32:00
0001 // SPDX-License-Identifier: LGPL-2.1-or-later 0002 // 0003 // SPDX-FileCopyrightText: 2010 Utku Aydın <utkuaydin34@gmail.com> 0004 // 0005 0006 #ifndef OPENDESKTOPMODEL_H 0007 #define OPENDESKTOPMODEL_H 0008 0009 #include "AbstractDataPluginModel.h" 0010 0011 namespace Marble { 0012 0013 class MarbleWidget; 0014 class MarbleModel; 0015 0016 class OpenDesktopModel : public AbstractDataPluginModel 0017 { 0018 Q_OBJECT 0019 0020 public: 0021 explicit OpenDesktopModel( const MarbleModel *marbleModel, QObject *parent = nullptr ); 0022 ~OpenDesktopModel() override; 0023 0024 void setMarbleWidget(MarbleWidget *widget); 0025 0026 protected: 0027 /** 0028 * Generates the download url for the description file from the web service depending on 0029 * the @p box surrounding the view and the @p number of files to show. 0030 **/ 0031 void getAdditionalItems(const Marble::GeoDataLatLonAltBox& box, qint32 number = 10) override; 0032 /** 0033 * Parses the @p file which getAdditionalItems downloads and 0034 * prepares the data for usage. 0035 **/ 0036 void parseFile(const QByteArray& file) override; 0037 0038 private: 0039 MarbleWidget *m_marbleWidget; 0040 }; 0041 0042 } 0043 0044 #endif // OPENDESKTOPMODEL_H