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 <QVector>
13#include <QCoreApplication> // for Q_DECLARE_TR_FUNCTIONS
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{
26 Q_DECLARE_TR_FUNCTIONS(PluginAuthor)
27public:
28 PluginAuthor()
29 {}
30
31 PluginAuthor( const QString &name_, const QString &email_, const QString &task_ = PluginAuthor::tr( "Developer" ) ) :
32 name( name_ ),
33 task( task_ ),
34 email( email_ )
35 {}
36
39 QString email;
40};
41
42/**
43 * @short This class specifies interface of a Marble plugin.
44 */
45
46class MARBLE_EXPORT PluginInterface
47{
48 public:
49 virtual ~PluginInterface();
50
51 /**
52 * @brief Returns the user-visible name of the plugin.
53 *
54 * The user-visible name should be context free, i.e. the name should
55 * provide enough information as to what the plugin is about in the context
56 * of Marble.
57 *
58 * Example: "Starry Sky Background", "OpenRouteService Routing"
59 */
60 virtual QString name() const = 0;
61
62 /**
63 * @brief Returns the unique name of the plugin.
64 *
65 * Examples: "starrysky", "openrouteservice"
66 */
67 virtual QString nameId() const = 0;
68
69 virtual QString version() const = 0;
70
71 /**
72 * @brief Returns a user description of the plugin.
73 */
74 virtual QString description() const = 0;
75
76 /**
77 * @brief Returns an icon for the plugin.
78 */
79 virtual QIcon icon() const = 0;
80
81 virtual QString copyrightYears() const = 0;
82
83 /**
84 * @since 0.26.0
85 */
87
88 /**
89 * @brief Returns about text (credits) for external data the plugin uses.
90 *
91 * The default implementation returns the empty string. Please override
92 * this method to give credits for all data from 3rd-partys.
93 */
94 virtual QString aboutDataText() const;
95};
96
97}
98
99Q_DECLARE_TYPEINFO(Marble::PluginAuthor, Q_MOVABLE_TYPE);
100
101Q_DECLARE_INTERFACE( Marble::PluginInterface, "org.kde.Marble.PluginInterface/1.1" )
102
103#endif
This class specifies interface of a Marble plugin.
virtual QString nameId() const =0
Returns the unique name of the plugin.
virtual QVector< PluginAuthor > pluginAuthors() const =0
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(StandardAction 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 Fri Jun 21 2024 12:00:07 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.