File indexing completed on 2024-05-05 03:50:49
0001 // SPDX-License-Identifier: LGPL-2.1-or-later 0002 // 0003 // SPDX-FileCopyrightText: 2009 Bastian Holst <bastianholst@gmx.de> 0004 // SPDX-FileCopyrightText: 2012 Mohammed Nafees <nafees.technocool@gmail.com> 0005 // 0006 0007 #ifndef PHOTOPLUGINMODEL_H 0008 #define PHOTOPLUGINMODEL_H 0009 0010 #include "AbstractDataPluginModel.h" 0011 0012 namespace Marble 0013 { 0014 0015 class MarbleWidget; 0016 0017 const quint32 numberOfImagesPerFetch = 15; 0018 0019 class PhotoPluginModel : public AbstractDataPluginModel 0020 { 0021 Q_OBJECT 0022 0023 public: 0024 explicit PhotoPluginModel( const MarbleModel *marbleModel, QObject *parent = nullptr ); 0025 0026 static QUrl generateUrl( const QString& service, 0027 const QString& method, 0028 const QHash<QString,QString>& options ); 0029 0030 void setMarbleWidget( MarbleWidget* widget ); 0031 0032 void setLicenseValues( const QString &licenses ); 0033 0034 protected: 0035 /** 0036 * Generates the download url for the description file from the web service depending on 0037 * the @p box surrounding the view and the @p number of files to show. 0038 **/ 0039 void getAdditionalItems( const GeoDataLatLonAltBox& box, 0040 qint32 number = 10 ) override; 0041 0042 /** 0043 * The reimplementation has to parse the @p file and should generate items. This items 0044 * have to be scheduled to downloadItemData or could be directly added to the list, 0045 * depending on if they have to download information to be shown. 0046 **/ 0047 void parseFile( const QByteArray& file ) override; 0048 0049 private: 0050 MarbleWidget *m_marbleWidget; 0051 0052 QString m_licenses; 0053 }; 0054 0055 } 0056 0057 #endif //PHOTOPLUGINMODEL_H