Marble

ReverseGeocodingRunnerPlugin.h
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2010 Dennis Nienhüser <nienhueser@kde.org>
4// SPDX-FileCopyrightText: 2011 Thibaut Gridel <tgridel@free.fr>
5// SPDX-FileCopyrightText: 2012 Bernhard Beschow <bbeschow@cs.tu-berlin.de>
6//
7
8#ifndef MARBLE_REVERSEGEOCODINGRUNNERPLUGIN_H
9#define MARBLE_REVERSEGEOCODINGRUNNERPLUGIN_H
10
11#include "PluginInterface.h"
12#include <QObject>
13
14namespace Marble
15{
16
17class ReverseGeocodingRunner;
18
19/**
20 * A plugin for Marble to execute a reverse geocoding task.
21 */
22class MARBLE_EXPORT ReverseGeocodingRunnerPlugin : public QObject, public PluginInterface
23{
24 Q_OBJECT
25
26public:
27 /** Constructor with optional parent object */
28 explicit ReverseGeocodingRunnerPlugin(QObject *parent = nullptr);
29
30 /** Destructor */
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
63protected:
64 void setSupportedCelestialBodies(const QStringList &celestialBodies);
65
66 void setCanWorkOffline(bool canWorkOffline);
67
68private:
69 class Private;
70 Private *const d;
71};
72
73}
74
75Q_DECLARE_INTERFACE(Marble::ReverseGeocodingRunnerPlugin, "org.kde.Marble.ReverseGeocodingRunnerPlugin/1.01")
76
77#endif // MARBLE_REVERSEGEOCODINGRUNNERPLUGIN_H
This class specifies interface of a Marble plugin.
A plugin for Marble to execute a reverse geocoding task.
virtual QString guiString() const =0
Returns the string that should appear in the user interface.
virtual ReverseGeocodingRunner * newRunner() const =0
Plugin factory method to create a new runner instance.
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 Sat Dec 21 2024 17:04:14 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.