KWeatherCore

weatherforecastsource.h
1/*
2 * SPDX-FileCopyrightText: 2020-2021 Han Young <hanyoung@protonmail.com>
3 * SPDX-FileCopyrightText: 2020 Devin Lin <espidev@gmail.com>
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
18namespace KWeatherCore
19{
20
21class LocationQueryResult;
22class 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 <hanyoung@protonmail.com>
31 */
32class KWEATHERCORE_EXPORT WeatherForecastSource : public QObject
33{
34 Q_OBJECT
35public:
36 explicit WeatherForecastSource(QObject *parent = nullptr);
37 ~WeatherForecastSource() override;
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
62private:
63 std::unique_ptr<WeatherForecastSourcePrivate> d;
64};
65}
Class represents location query result.
The PendingWeatherForecast class contains the reply to an asynchronous weather forecast request.
The WeatherForecastSource class is intended for query weather information about a location.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:00:30 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.