File indexing completed on 2025-01-19 03:58:07

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2011-04-30
0007  * Description : Class for geonames.org based altitude lookup
0008  *
0009  * SPDX-FileCopyrightText: 2010-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
0010  * SPDX-FileCopyrightText: 2010-2011 by Michael G. Hansen <mike at mghansen dot de>
0011  *
0012  * SPDX-License-Identifier: GPL-2.0-or-later
0013  *
0014  * ============================================================ */
0015 
0016 #ifndef DIGIKAM_LOOKUP_ALTITUDE_GEONAMES_H
0017 #define DIGIKAM_LOOKUP_ALTITUDE_GEONAMES_H
0018 
0019 // Qt includes
0020 
0021 #include <QNetworkReply>
0022 
0023 // Local includes
0024 
0025 #include "lookupaltitude.h"
0026 #include "digikam_export.h"
0027 
0028 namespace Digikam
0029 {
0030 
0031 class DIGIKAM_EXPORT LookupAltitudeGeonames : public LookupAltitude
0032 {
0033     Q_OBJECT
0034 
0035 public:
0036 
0037     explicit LookupAltitudeGeonames(QObject* const parent);
0038     ~LookupAltitudeGeonames() override;
0039 
0040     QString backendName()                           const override;
0041     QString backendHumanName()                      const override;
0042 
0043     void addRequests(const Request::List& requests)       override;
0044     Request::List getRequests()                     const override;
0045     Request getRequest(const int index)             const override;
0046 
0047     void startLookup()                                    override;
0048     StatusAltitude getStatus()                      const override;
0049     QString errorMessage()                          const override;
0050     void cancel()                                         override;
0051 
0052 private Q_SLOTS:
0053 
0054     void slotFinished(QNetworkReply* reply);
0055 
0056 private:
0057 
0058     void startNextRequest();
0059 
0060 private:
0061 
0062     class Private;
0063     const QScopedPointer<Private> d;
0064 };
0065 
0066 } // namespace Digikam
0067 
0068 #endif // DIGIKAM_LOOKUP_ALTITUDE_GEONAMES_H