Add weather routes project progress
This commit is contained in:
30
WeatherRoutes/mvc/controller/weathercontroller.h
Normal file
30
WeatherRoutes/mvc/controller/weathercontroller.h
Normal file
@@ -0,0 +1,30 @@
|
||||
#ifndef WEATHERCONTROLLER_H
|
||||
#define WEATHERCONTROLLER_H
|
||||
|
||||
#include "../data/weatherdata.h"
|
||||
#include <QGeoCoordinate>
|
||||
#include <QObject>
|
||||
|
||||
class WeatherController : public QObject {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit WeatherController(QObject *parent = nullptr);
|
||||
|
||||
static const QString FILENAME;
|
||||
bool parseJSONData();
|
||||
QJsonObject fetchCurrentWeatherData(const QGeoCoordinate &coord);
|
||||
|
||||
signals:
|
||||
|
||||
private:
|
||||
bool readWeatherData(QJsonDocument &doc, QString objName = NULL);
|
||||
bool checkToDownload(QJsonDocument &doc);
|
||||
bool saveWeatherData(QJsonDocument &doc);
|
||||
bool fetchWeatherData(QUrl url, QJsonDocument &doc);
|
||||
void updateWeatherData(QJsonDocument &inputDoc);
|
||||
QUrl prepareURL(const QString &plaats);
|
||||
QUrl prepareURL(const QGeoCoordinate &coord);
|
||||
QList<WeatherData> mData;
|
||||
};
|
||||
|
||||
#endif // WEATHERCONTROLLER_H
|
||||
Reference in New Issue
Block a user