Files
pilotclient/src/blackcore/weatherdata.h
2016-01-28 01:35:58 +01:00

68 lines
1.9 KiB
C++

/* Copyright (C) 2016
* swift Project Community / Contributors
*
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
* including this file, may be copied, modified, propagated, or distributed except according to the terms
* contained in the LICENSE file.
*/
//! \file
#ifndef BLACKCORE_WEATHERDATA_H
#define BLACKCORE_WEATHERDATA_H
#include "blackcoreexport.h"
#include "blackmisc/geo/latitude.h"
#include "blackmisc/geo/longitude.h"
#include "blackmisc/weather/gridpoint.h"
#include "blackmisc/weather/weathergrid.h"
#include <QObject>
namespace BlackCore
{
/*!
* Interface to weather data
*/
class BLACKCORE_EXPORT IWeatherData : public QObject
{
Q_OBJECT
public:
//! Destructor
virtual ~IWeatherData() {}
//! Fetch new weather data
virtual void fetchWeatherData(const BlackMisc::Geo::CLatitude &latitude, const BlackMisc::Geo::CLongitude &longitude, double maxDistance = -1) = 0;
//! Get fetched weather data
virtual BlackMisc::Weather::CWeatherGrid getWeatherData() const = 0;
signals:
//! Finished fetching data
void fetchingFinished();
protected:
//! Default constructor
IWeatherData(QObject *parent = nullptr) : QObject(parent) {}
};
/*!
* Factory pattern class to create instances of IWeatherData
*/
class BLACKCORE_EXPORT IWeatherDataFactory
{
public:
//! Virtual destructor
virtual ~IWeatherDataFactory() {}
//! Create a new instance
virtual IWeatherData *create(QObject *parent = nullptr) = 0;
};
} // namespace
Q_DECLARE_INTERFACE(BlackCore::IWeatherDataFactory, "org.swift-project.blackcore.weatherdata")
#endif // guard