digiKam
dplugin.h
Go to the documentation of this file.
1 /* ============================================================
2  *
3  * This file is a part of digiKam project
4  * https://www.digikam.org
5  *
6  * Date : 2018-07-30
7  * Description : abstract class to define digiKam plugin
8  *
9  * Copyright (C) 2018-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
10  *
11  * This program is free software; you can redistribute it
12  * and/or modify it under the terms of the GNU General
13  * Public License as published by the Free Software Foundation;
14  * either version 2, or (at your option)
15  * any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * ============================================================ */
23 
24 #ifndef DIGIKAM_DPLUGIN_H
25 #define DIGIKAM_DPLUGIN_H
26 
27 // Qt includes
28 
29 #include <QMap>
30 #include <QList>
31 #include <QCoreApplication>
32 #include <QString>
33 #include <QStringList>
34 #include <QtPlugin>
35 #include <QObject>
36 #include <QIcon>
37 #include <QPointer>
38 
39 // Local includes
40 
41 #include "dpluginauthor.h"
42 #include "digikam_export.h"
43 
48 #define DIGIKAM_DPLUGIN_GENERIC_IID "org.kde.digikam.DPluginGeneric/1.1.0"
49 #define DIGIKAM_DPLUGIN_EDITOR_IID "org.kde.digikam.DPluginEditor/1.1.0"
50 #define DIGIKAM_DPLUGIN_BQM_IID "org.kde.digikam.DPluginBqm/1.1.0"
51 #define DIGIKAM_DPLUGIN_RAWIMPORT_IID "org.kde.digikam.DPluginRawImport/1.1.0"
52 #define DIGIKAM_DPLUGIN_DIMG_IID "org.kde.digikam.DPluginDImg/1.1.0"
53 
54 namespace Digikam
55 {
56 
60 class DIGIKAM_EXPORT DPlugin : public QObject
61 {
62  Q_OBJECT
63 
64 public:
65 
69  explicit DPlugin(QObject* const parent = nullptr);
70 
74  ~DPlugin() override;
75 
76 public:
77 
81  QStringList pluginAuthors() const;
82 
87  QString version() const;
88 
93  bool shouldLoaded() const;
94 
99  void setShouldLoaded(bool b);
100 
105  QString libraryFileName() const;
106 
111  void setLibraryFileName(const QString&);
112 
113 public:
114 
119  virtual void cleanUp() {};
120 
125  virtual bool hasVisibilityProperty() const;
126 
130  virtual void setVisible(bool b) = 0;
131 
135  virtual int count() const = 0;
136 
140  virtual QStringList categories() const = 0;
141 
145  virtual void setup(QObject* const parent) = 0;
146 
154  virtual QString name() const = 0;
155 
163  virtual QString iid() const = 0;
164 
172  virtual QString ifaceIid() const = 0;
173 
177  virtual QString description() const = 0;
178 
183  virtual QIcon icon() const;
184 
188  virtual QList<DPluginAuthor> authors() const = 0;
189 
193  virtual QString details() const = 0;
194 
198  virtual QMap<QString, QString> extraAboutData() const { return QMap<QString, QString>(); };
199 
203  virtual QString extraAboutDataTitle() const { return QString(); };
204 
205 private:
206 
207  class Private;
208  Private* const d;
209 };
210 
211 } // namespace Digikam
212 
214 
215 #endif // DIGIKAM_DPLUGIN_H
Definition: dpluginauthor.h:39
Definition: dplugin.h:61
virtual int count() const =0
virtual QString name() const =0
Returns the user-visible name of the plugin.
virtual QMap< QString, QString > extraAboutData() const
Returns a list of extra data to show in plugin about dialog.
Definition: dplugin.h:198
virtual QString ifaceIid() const =0
Returns the unique top level internal identification property of the plugin interface....
virtual void cleanUp()
Definition: dplugin.h:119
virtual QString extraAboutDataTitle() const
Returns the title of data returned by extraAboiutData().
Definition: dplugin.h:203
virtual void setVisible(bool b)=0
virtual QList< DPluginAuthor > authors() const =0
Returns authors list for the plugin.
virtual QString description() const =0
Returns a short description about the plugin.
virtual QString details() const =0
Returns a long description about the plugin.
virtual QStringList categories() const =0
virtual QString iid() const =0
Returns the unique internal identification property of the plugin. Must be formatted as "org....
virtual void setup(QObject *const parent)=0
Definition: piwigotalker.h:48
Q_DECLARE_TYPEINFO(Digikam::DPluginAuthor, Q_MOVABLE_TYPE)
Definition: datefolderview.cpp:43