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 
19 class QIcon;
20 
21 namespace Marble
22 {
23 
24 struct MARBLE_EXPORT PluginAuthor
25 {
Q_DECLARE_TR_FUNCTIONSPluginAuthor26     Q_DECLARE_TR_FUNCTIONS(PluginAuthor)
27 public:
28     PluginAuthor()
29     {}
30 
31     PluginAuthor( const QString &name_, const QString &email_, const QString &task_ = PluginAuthor::tr( "Developer" ) ) :
namePluginAuthor32         name( name_ ),
33         task( task_ ),
34         email( email_ )
35     {}
36 
37     QString name;
38     QString task;
39     QString email;
40 };
41 
42 /**
43  * @short This class specifies interface of a Marble plugin.
44  */
45 
46 class 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      */
86     virtual QVector<PluginAuthor> pluginAuthors() const = 0;
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 
99 Q_DECLARE_TYPEINFO(Marble::PluginAuthor, Q_MOVABLE_TYPE);
100 
101 Q_DECLARE_INTERFACE( Marble::PluginInterface, "org.kde.Marble.PluginInterface/1.1" )
102 
103 #endif
104