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

0001 // SPDX-License-Identifier: LGPL-2.1-or-later
0002 //
0003 // SPDX-FileCopyrightText: 2010 Utku Aydin <utkuaydin34@gmail.com>
0004 //
0005 
0006 #ifndef EARTHQUAKEMODEL_H
0007 #define EARTHQUAKEMODEL_H
0008 
0009 #include "AbstractDataPluginModel.h"
0010 #include <QDateTime>
0011 
0012 namespace Marble
0013 {
0014 
0015 class EarthquakeModel : public AbstractDataPluginModel
0016 {
0017     Q_OBJECT
0018 
0019 public:
0020     explicit EarthquakeModel( const MarbleModel *marbleModel, QObject *parent = nullptr );
0021     ~EarthquakeModel() override;
0022 
0023     void setMinMagnitude( double minMagnitude );
0024     void setStartDate( const QDateTime& startDate );
0025     void setEndDate( const QDateTime& endDate );
0026 
0027 protected:
0028     /**
0029      * Generates the download url for the description file from the web service depending on
0030      * the @p box surrounding the view and the @p number of files to show.
0031      **/
0032     void getAdditionalItems( const GeoDataLatLonAltBox& box,
0033                                      qint32 number = 10 ) override;
0034 
0035     /**
0036      * Parses the @p file which getAdditionalItems downloads and
0037      * prepares the data for usage.
0038      **/
0039     void parseFile( const QByteArray& file ) override;
0040 
0041 private:
0042     double m_minMagnitude;
0043     QDateTime m_startDate;
0044     QDateTime m_endDate;
0045 };
0046 
0047 }
0048 
0049 #endif // EARTHQUAKEMODEL_H