Marble

ReverseGeocodingRunnerManager.h
1 // SPDX-License-Identifier: LGPL-2.1-or-later
2 //
3 // SPDX-FileCopyrightText: 2008 Henry de Valence <[email protected]>
4 // SPDX-FileCopyrightText: 2010 Dennis Nienhüser <[email protected]>
5 // SPDX-FileCopyrightText: 2010-2013 Bernhard Beschow <[email protected]>
6 // SPDX-FileCopyrightText: 2011 Thibaut Gridel <[email protected]>
7 
8 #ifndef MARBLE_REVERSEGEOCODINGRUNNERMANAGER_H
9 #define MARBLE_REVERSEGEOCODINGRUNNERMANAGER_H
10 
11 #include <QObject>
12 
13 #include "marble_export.h"
14 
15 class QAbstractItemModel;
16 
17 namespace Marble
18 {
19 
20 class GeoDataCoordinates;
21 class GeoDataPlacemark;
22 class MarbleModel;
23 class ReverseGeocodingTask;
24 
25 class MARBLE_EXPORT ReverseGeocodingRunnerManager : public QObject
26 {
27  Q_OBJECT
28 
29 public:
30  /**
31  * Constructor.
32  * @param pluginManager The plugin manager that gives access to RunnerPlugins
33  * @param parent Optional parent object
34  */
35  explicit ReverseGeocodingRunnerManager( const MarbleModel *marbleModel, QObject *parent = nullptr );
36 
37  ~ReverseGeocodingRunnerManager() override;
38 
39  /**
40  * Find the address and other meta information for a given geoposition.
41  * @see reverseGeocoding is asynchronous with currently one result
42  * returned using the @see reverseGeocodingFinished signal.
43  * @see searchReverseGeocoding is blocking.
44  * @see reverseGeocodingFinished signal indicates all runners are finished.
45  */
46  void reverseGeocoding( const GeoDataCoordinates &coordinates );
47  QString searchReverseGeocoding( const GeoDataCoordinates &coordinates, int timeout = 30000 );
48 
49 Q_SIGNALS:
50  /**
51  * The reverse geocoding request is finished, the result is stored
52  * in the given placemark. This signal is emitted when the first
53  * runner found a result, subsequent results are discarded and do not
54  * emit further signals. If no result is found, this signal is emitted
55  * with an empty (default constructed) placemark.
56  */
57  void reverseGeocodingFinished( const GeoDataCoordinates &coordinates, const GeoDataPlacemark &placemark );
58 
59  /**
60  * Emitted whenever all runners are finished for the query
61  */
62  void reverseGeocodingFinished();
63 
64 private:
65  Q_PRIVATE_SLOT( d, void addReverseGeocodingResult( const GeoDataCoordinates &coordinates, const GeoDataPlacemark &placemark ) )
66  Q_PRIVATE_SLOT( d, void cleanupReverseGeocodingTask( ReverseGeocodingTask *task ) )
67 
68  class Private;
69  friend class Private;
70  Private *const d;
71 };
72 
73 }
74 
75 #endif
Binds a QML item to a specific geodetic location in screen coordinates.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Thu Sep 21 2023 04:12:28 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.