digiKam
searchbackend.h
Go to the documentation of this file.
1 /* ============================================================
2  *
3  * This file is a part of digiKam project
4  * https://www.digikam.org
5  *
6  * Date : 2010-06-01
7  * Description : A simple backend to search OSM and Geonames.org.
8  *
9  * Copyright (C) 2010-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
10  * Copyright (C) 2010-2011 by Michael G. Hansen <mike at mghansen dot de>
11  *
12  * This program is free software; you can redistribute it
13  * and/or modify it under the terms of the GNU General
14  * Public License as published by the Free Software Foundation;
15  * either version 2, or (at your option)
16  * any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * ============================================================ */
24 
25 #ifndef DIGIKAM_SEARCH_BACKEND_H
26 #define DIGIKAM_SEARCH_BACKEND_H
27 
28 // Qt includes
29 
30 #include <QObject>
31 #include <QNetworkReply>
32 
33 // Local includes
34 
35 #include "geoifacetypes.h"
36 #include "rgwidget.h"
37 
38 using namespace Digikam;
39 
41 {
42 
43 class SearchBackend : public QObject
44 {
45  Q_OBJECT
46 
47 public:
48 
50  {
51  public:
52 
53  explicit SearchResult()
54  {
55  }
56 
59  QString name;
61  QString internalId;
62  };
63 
64 public:
65 
66  explicit SearchBackend(QObject* const parent);
67  ~SearchBackend() override;
68 
69  bool search(const QString& backendName, const QString& searchTerm);
70  SearchResult::List getResults() const;
71  QString getErrorMessage() const;
72  QList<QPair<QString, QString> > getBackends() const;
73 
74 Q_SIGNALS:
75 
77 
78 private Q_SLOTS:
79 
80  void slotFinished(QNetworkReply* reply);
81 
82 private:
83 
84  class Private;
85  Private* const d;
86 };
87 
88 } // namespace DigikamGenericGeolocationEditPlugin
89 
90 #endif // DIGIKAM_SEARCH_BACKEND_H
GeoCoordinates::Pair boundingBox
Definition: searchbackend.h:60
QList< SearchResult > List
Definition: searchbackend.h:57
GeoCoordinates coordinates
Definition: searchbackend.h:58
Definition: geocoordinates.h:49
QPair< GeoCoordinates, GeoCoordinates > Pair
Definition: geocoordinates.h:64
Definition: geolocationedit.cpp:97
Definition: datefolderview.cpp:43