KWeatherCore

weatherforecastsource.h
1 /*
2  * SPDX-FileCopyrightText: 2020-2021 Han Young <[email protected]>
3  * SPDX-FileCopyrightText: 2020 Devin Lin <[email protected]>
4  *
5  * SPDX-License-Identifier: LGPL-2.0-or-later
6  */
7 #pragma once
8 
9 #include "pendingweatherforecast.h"
10 #include <kweathercore/kweathercore_export.h>
11 
12 #include <QObject>
13 
14 #include <memory>
15 
17 
18 namespace KWeatherCore
19 {
20 
21 class LocationQueryResult;
22 class WeatherForecastSourcePrivate;
23 
24 /**
25  * @short The WeatherForecastSource class is intended for query weather
26  * information about a location
27  *
28  * @see WeatherForecast, PendingWeatherForecast
29  *
30  * @author Han Young <[email protected]>
31  */
32 class KWEATHERCORE_EXPORT WeatherForecastSource : public QObject
33 {
34  Q_OBJECT
35 public:
36  explicit WeatherForecastSource(QObject *parent = nullptr);
38 
39  /**
40  * requestData
41  * @param latitude
42  * @param longitude
43  * @return it is the client's responsibility to delete the
44  * PendingWeatherForecast afterhand to avoid memory leak.
45  */
46  PendingWeatherForecast *requestData(double latitude, double longitude);
47 
48  /**
49  * requestData
50  * @param result
51  * @return it is the client's responsibility to delete the
52  * PendingWeatherForecast afterhand to avoid memory leak.
53  */
55 
56  /** Set the network access manager to use for network operations.
57  * If not set, an instance is created internally.
58  * Ownership is not transferred.
59  */
60  void setNetworkAccessManager(QNetworkAccessManager *nam);
61 
62 private:
63  std::unique_ptr<WeatherForecastSourcePrivate> d;
64 };
65 }
Class represents location query result.
The WeatherForecastSource class is intended for query weather information about a location.
The PendingWeatherForecast class contains the reply to an asynchronous weather forecast request.
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Fri Sep 30 2022 03:57:06 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.