Marble

SearchRunnerPlugin.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
6#ifndef MARBLE_SEARCHRUNNERPLUGIN_H
7#define MARBLE_SEARCHRUNNERPLUGIN_H
8
9#include "PluginInterface.h"
10#include <QObject>
11
12namespace Marble
13{
14
15class SearchRunner;
16
17/**
18 * A plugin for Marble to execute a placemark search.
19 */
20class MARBLE_EXPORT SearchRunnerPlugin : public QObject, public PluginInterface
21{
22 Q_OBJECT
23
24public:
25 /** Constructor with optional parent object */
26 explicit SearchRunnerPlugin(QObject *parent = nullptr);
27
28 /** Destructor */
29 ~SearchRunnerPlugin() override;
30
31 /**
32 * @brief Returns the string that should appear in the user interface.
33 *
34 * For example, "Nominatim" should be returned for the Nominatim search plugin.
35 */
36 virtual QString guiString() const = 0;
37
38 /** Plugin factory method to create a new runner instance.
39 * Method caller gets ownership of the returned object
40 */
41 virtual SearchRunner *newRunner() const = 0;
42
43 /** True if the plugin supports its tasks on the given planet */
44 bool supportsCelestialBody(const QString &celestialBodyId) const;
45
46 /** True if the plugin can execute its tasks without network access */
47 bool canWorkOffline() const;
48
49 /**
50 * @brief Returns @code true @endcode if the plugin is able to perform its claimed task.
51 *
52 * The default implementation returns @code true @endcode. This method can be
53 * overridden for example to indicate an incomplete installation.
54 */
55 virtual bool canWork() const;
56
57 // Overridden methods with default implementations
58
59 QIcon icon() const override;
60
61protected:
62 void setSupportedCelestialBodies(const QStringList &celestialBodies);
63
64 void setCanWorkOffline(bool canWorkOffline);
65
66private:
67 class Private;
68 Private *const d;
69};
70
71}
72
73Q_DECLARE_INTERFACE(Marble::SearchRunnerPlugin, "org.kde.Marble.SearchRunnerPlugin/1.01")
74
75#endif // MARBLE_SEARCHRUNNERPLUGIN_H
This class specifies interface of a Marble plugin.
A plugin for Marble to execute a placemark search.
virtual QString guiString() const =0
Returns the string that should appear in the user interface.
virtual SearchRunner * 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 Mon Nov 18 2024 12:15:46 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.