File indexing completed on 2025-03-09 03:57:14

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2010-05-12
0007  * Description : Backend for reverse geocoding using geonames.org (non-US)
0008  *
0009  * SPDX-FileCopyrightText: 2010-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
0010  * SPDX-FileCopyrightText: 2010      by Michael G. Hansen <mike at mghansen dot de>
0011  * SPDX-FileCopyrightText: 2010      by Gabriel Voicu <ping dot gabi at gmail dot com>
0012  *
0013  * SPDX-License-Identifier: GPL-2.0-or-later
0014  *
0015  * ============================================================ */
0016 
0017 #ifndef DIGIKAM_BACKEND_GEONAMES_RG_H
0018 #define DIGIKAM_BACKEND_GEONAMES_RG_H
0019 
0020 // Qt includes
0021 
0022 #include <QNetworkReply>
0023 #include <QString>
0024 #include <QList>
0025 #include <QUrl>
0026 #include <QMap>
0027 
0028 // Local includes
0029 
0030 #include "backend-rg.h"
0031 #include "digikam_export.h"
0032 
0033 namespace Digikam
0034 {
0035 
0036 class DIGIKAM_EXPORT BackendGeonamesRG : public RGBackend
0037 {
0038     Q_OBJECT
0039 
0040 public:
0041 
0042     explicit BackendGeonamesRG(QObject* const parent);
0043     ~BackendGeonamesRG()                                                     override;
0044 
0045     QMap<QString, QString> makeQMapFromXML(const QString& xmlData);
0046 
0047     void callRGBackend(const QList<RGInfo>& rgList, const QString& language) override;
0048     QString getErrorMessage()                                                override;
0049     QString backendName()                                                    override;
0050     void cancelRequests()                                                    override;
0051 
0052 private Q_SLOTS:
0053 
0054     void nextPhoto();
0055     void slotFinished(QNetworkReply* reply);
0056 
0057 private:
0058 
0059     class Private;
0060     Private* const d;
0061 };
0062 
0063 } // namespace Digikam
0064 
0065 #endif // DIGIKAM_BACKEND_GEONAMES_RG_H