Marble

PluginInterface.h
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// Most of the code is taken from MarbleRenderPluginInterface.h
4// by Torsten Rahn and Inge Wallin.
5//
6// SPDX-FileCopyrightText: 2009 Jens-Michael Hoffmann <jensmh@gmx.de>
7// SPDX-FileCopyrightText: 2012 Bernhard Beschow <bbeschow@cs.tu-berlin.de>
8//
9#ifndef MARBLE_PLUGININTERFACE_H
10#define MARBLE_PLUGININTERFACE_H
11
12#include <QCoreApplication> // for Q_DECLARE_TR_FUNCTIONS
13#include <QList>
14#include <QString>
15#include <QtPlugin>
16
17#include "marble_export.h"
18
19class QIcon;
20
21namespace Marble
22{
23
24struct MARBLE_EXPORT PluginAuthor {
25 Q_DECLARE_TR_FUNCTIONS(PluginAuthor)
26public:
27 PluginAuthor() = default;
28
29 PluginAuthor(const QString &name_, const QString &email_, const QString &task_ = PluginAuthor::tr("Developer"))
30 : name(name_)
31 , task(task_)
32 , email(email_)
33 {
34 }
35
38 QString email;
39};
40
41/**
42 * @short This class specifies interface of a Marble plugin.
43 */
44
45class MARBLE_EXPORT PluginInterface
46{
47public:
48 virtual ~PluginInterface();
49
50 /**
51 * @brief Returns the user-visible name of the plugin.
52 *
53 * The user-visible name should be context free, i.e. the name should
54 * provide enough information as to what the plugin is about in the context
55 * of Marble.
56 *
57 * Example: "Starry Sky Background", "OpenRouteService Routing"
58 */
59 virtual QString name() const = 0;
60
61 /**
62 * @brief Returns the unique name of the plugin.
63 *
64 * Examples: "starrysky", "openrouteservice"
65 */
66 virtual QString nameId() const = 0;
67
68 virtual QString version() const = 0;
69
70 /**
71 * @brief Returns a user description of the plugin.
72 */
73 virtual QString description() const = 0;
74
75 /**
76 * @brief Returns an icon for the plugin.
77 */
78 virtual QIcon icon() const = 0;
79
80 virtual QString copyrightYears() const = 0;
81
82 /**
83 * @since 0.26.0
84 */
86
87 /**
88 * @brief Returns about text (credits) for external data the plugin uses.
89 *
90 * The default implementation returns the empty string. Please override
91 * this method to give credits for all data from 3rd-partys.
92 */
93 virtual QString aboutDataText() const;
94};
95
96}
97
98Q_DECLARE_TYPEINFO(Marble::PluginAuthor, Q_MOVABLE_TYPE);
99
100Q_DECLARE_INTERFACE(Marble::PluginInterface, "org.kde.Marble.PluginInterface/1.1")
101
102#endif
This class specifies interface of a Marble plugin.
virtual QList< PluginAuthor > pluginAuthors() const =0
virtual QString nameId() const =0
Returns the unique name of the plugin.
virtual QString description() const =0
Returns a user description of the plugin.
virtual QString name() const =0
Returns the user-visible name of the plugin.
virtual QIcon icon() const =0
Returns an icon for the plugin.
QString name(GameStandardAction id)
Binds a QML item to a specific geodetic location in screen coordinates.
QTaskBuilder< Task > task(Task &&task)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:37:03 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.