File indexing completed on 2024-05-05 16:49:21
0001 /* 0002 * SPDX-FileCopyrightText: 2020-2021 Han Young <hanyoung@protonmail.com> 0003 * SPDX-FileCopyrightText: 2020 Devin Lin <espidev@gmail.com> 0004 * 0005 * SPDX-License-Identifier: LGPL-2.0-or-later 0006 */ 0007 0008 #pragma once 0009 #include <QObject> 0010 #include <kweathercore/kweathercore_export.h> 0011 class QNetworkReply; 0012 class QNetworkAccessManager; 0013 namespace KWeatherCore 0014 { 0015 class GeoTimezonePrivate; 0016 /** 0017 * @short Class to obtain timezone via coordinate 0018 * 0019 * This is a class to obtain timezone via coordinate and signals finished() with 0020 * a QString 0021 * 0022 * @author Han Young <hanyoung@protonmail.com> 0023 */ 0024 class KWEATHERCORE_EXPORT GeoTimezone : public QObject 0025 { 0026 Q_OBJECT 0027 public: 0028 /** 0029 * GeoTimezone 0030 * @param latitude latitude for the request location 0031 * @param longitude longitude for the request location 0032 */ 0033 GeoTimezone(double latitude, double longitude, QObject *parent = nullptr); 0034 0035 Q_SIGNALS: 0036 /** 0037 * finished emit when the timezone has been obtained 0038 * @param timezone IANA timezone string 0039 */ 0040 void finished(const QString &timezone); 0041 /** 0042 * networkError encounted network error 0043 */ 0044 void networkErrorOccured(); 0045 0046 private: 0047 GeoTimezonePrivate *d; 0048 }; 0049 }