mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-23 05:45:35 +08:00
67
src/blackcore/weatherdata.h
Normal file
67
src/blackcore/weatherdata.h
Normal file
@@ -0,0 +1,67 @@
|
||||
/* 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
|
||||
Reference in New Issue
Block a user