Marble

ReverseGeocodingRunnerManager.h
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2008 Henry de Valence <hdevalence@gmail.com>
4// SPDX-FileCopyrightText: 2010 Dennis Nienhüser <nienhueser@kde.org>
5// SPDX-FileCopyrightText: 2010-2013 Bernhard Beschow <bbeschow@cs.tu-berlin.de>
6// SPDX-FileCopyrightText: 2011 Thibaut Gridel <tgridel@free.fr>
7
8#ifndef MARBLE_REVERSEGEOCODINGRUNNERMANAGER_H
9#define MARBLE_REVERSEGEOCODINGRUNNERMANAGER_H
10
11#include <QObject>
12
13#include "marble_export.h"
14
16
17namespace Marble
18{
19
20class GeoDataCoordinates;
21class GeoDataPlacemark;
22class MarbleModel;
23class ReverseGeocodingTask;
24
25class MARBLE_EXPORT ReverseGeocodingRunnerManager : public QObject
26{
27 Q_OBJECT
28
29public:
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
49Q_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
64private:
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-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:18:17 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.