File indexing completed on 2024-04-14 03:48:02

0001 // SPDX-License-Identifier: LGPL-2.1-or-later
0002 //
0003 // SPDX-FileCopyrightText: 2010 Dennis Nienhüser <nienhueser@kde.org>
0004 // SPDX-FileCopyrightText: 2011 Thibaut Gridel <tgridel@free.fr>
0005 // SPDX-FileCopyrightText: 2012, 2013 Bernhard Beschow <bbeschow@cs.tu-berlin.de>
0006 
0007 #ifndef MARBLE_REVERSEGEOCODINGRUNNER_H
0008 #define MARBLE_REVERSEGEOCODINGRUNNER_H
0009 
0010 #include <QObject>
0011 #include "marble_export.h"
0012 
0013 namespace Marble
0014 {
0015 
0016 class GeoDataCoordinates;
0017 class GeoDataPlacemark;
0018 class MarbleModel;
0019 
0020 class MARBLE_EXPORT ReverseGeocodingRunner : public QObject
0021 {
0022     Q_OBJECT
0023 
0024 public:
0025     explicit ReverseGeocodingRunner( QObject *parent );
0026 
0027     /**
0028      * Stores a pointer to the currently used model
0029      */
0030     void setModel( const MarbleModel *model );
0031 
0032     /**
0033      * Start a reverse geocoding request. Called by MarbleRunnerManager, runners
0034      * are expected to return the result via the reverseGeocodingFinished signal.
0035      * If implemented in a plugin, make sure to include ReverseGeocoding in the
0036      * plugin capabilities, otherwise MarbleRunnerManager will ignore the plugin
0037      */
0038     virtual void reverseGeocoding( const GeoDataCoordinates &coordinates ) = 0;
0039 
0040 Q_SIGNALS:
0041     /**
0042      * Reverse geocoding is finished, result in the given placemark.
0043      * To be emitted by runners after a @see reverseGeocoding call.
0044      */
0045     void reverseGeocodingFinished( const GeoDataCoordinates &coordinates, const GeoDataPlacemark &placemark );
0046 
0047 protected:
0048     /**
0049      * Access to the currently used model, or null if no was set with @see setModel
0050      */
0051     const MarbleModel *model() const;
0052 
0053 private:
0054     const MarbleModel *m_model;
0055 };
0056 
0057 }
0058 
0059 #endif