Marble

ReverseGeocodingRunnerPlugin.h
1 // SPDX-License-Identifier: LGPL-2.1-or-later
2 //
3 // SPDX-FileCopyrightText: 2010 Dennis Nienhüser <[email protected]>
4 // SPDX-FileCopyrightText: 2011 Thibaut Gridel <[email protected]>
5 // SPDX-FileCopyrightText: 2012 Bernhard Beschow <[email protected]>
6 //
7 
8 #ifndef MARBLE_REVERSEGEOCODINGRUNNERPLUGIN_H
9 #define MARBLE_REVERSEGEOCODINGRUNNERPLUGIN_H
10 
11 #include <QObject>
12 #include "PluginInterface.h"
13 
14 namespace Marble
15 {
16 
17 class ReverseGeocodingRunner;
18 
19 /**
20  * A plugin for Marble to execute a reverse geocoding task.
21  */
22 class MARBLE_EXPORT ReverseGeocodingRunnerPlugin : public QObject, public PluginInterface
23 {
24  Q_OBJECT
25 
26 public:
27  /** Constructor with optional parent object */
28  explicit ReverseGeocodingRunnerPlugin( QObject* parent = nullptr );
29 
30  /** Destructor */
31  ~ReverseGeocodingRunnerPlugin() override;
32 
33  /**
34  * @brief Returns the string that should appear in the user interface.
35  *
36  * For example, "Nominatim" should be returned for the Nominatim reverse geocoding plugin.
37  */
38  virtual QString guiString() const = 0;
39 
40  /** Plugin factory method to create a new runner instance.
41  * Method caller gets ownership of the returned object
42  */
43  virtual ReverseGeocodingRunner *newRunner() const = 0;
44 
45  /** True if the plugin supports its tasks on the given planet */
46  bool supportsCelestialBody( const QString &celestialBodyId ) const;
47 
48  /** True if the plugin can execute its tasks without network access */
49  bool canWorkOffline() const;
50 
51  /**
52  * @brief Returns @code true @endcode if the plugin is able to perform its claimed task.
53  *
54  * The default implementation returns @code true @endcode. This method can be
55  * overridden for example to indicate an incomplete installation.
56  */
57  virtual bool canWork() const;
58 
59  // Overridden methods with default implementations
60 
61  QIcon icon() const override;
62 
63 protected:
64  void setSupportedCelestialBodies( const QStringList &celestialBodies );
65 
66  void setCanWorkOffline( bool canWorkOffline );
67 
68 private:
69  class Private;
70  Private * const d;
71 };
72 
73 }
74 
75 Q_DECLARE_INTERFACE( Marble::ReverseGeocodingRunnerPlugin, "org.kde.Marble.ReverseGeocodingRunnerPlugin/1.01" )
76 
77 #endif // MARBLE_REVERSEGEOCODINGRUNNERPLUGIN_H
This class specifies interface of a Marble plugin.
Binds a QML item to a specific geodetic location in screen coordinates.
A plugin for Marble to execute a reverse geocoding task.
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.