digiKam
dpluginloader.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 : manager to load external plugins at run-time
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_LOADER_H
25 #define DIGIKAM_DPLUGIN_LOADER_H
26 
27 // Qt includes
28 
29 #include <QObject>
30 #include <QList>
31 
32 // Local includes
33 
34 #include "digikam_export.h"
35 #include "dinfointerface.h"
36 #include "dplugin.h"
37 #include "dpluginaction.h"
38 
39 namespace Digikam
40 {
41 
52 class DIGIKAM_EXPORT DPluginLoader : public QObject
53 {
54  Q_OBJECT
55 
56  public:
57 
62  static DPluginLoader* instance();
63 
67  QString configGroupName() const;
68 
72  void registerGenericPlugins(QObject* const parent);
73 
77  void registerEditorPlugins(QObject* const parent);
78 
82  void registerRawImportPlugins(QObject* const parent);
83 
87  void init();
88 
92  void cleanUp();
93 
97  QList<DPlugin*> allPlugins() const;
98 
103  QList<DPluginAction*> pluginsActions(DPluginAction::ActionType type, QObject* const parent) const;
104 
109  QList<DPluginAction*> pluginsActions(DPluginAction::ActionCategory cat, QObject* const parent) const;
110 
115  QList<DPluginAction*> pluginActions(const QString& pluginIID, QObject* const parent) const;
116 
121  DPluginAction* pluginAction(const QString& actionName, QObject* const parent) const;
122 
126  QString pluginXmlSections(DPluginAction::ActionCategory cat, QObject* const parent) const;
127 
133  void appendPluginToBlackList(const QString& filename);
134 
142  void appendPluginToWhiteList(const QString& filename);
143 
144 private:
145 
146  // Disable constructor and destructor
147  DPluginLoader();
148  explicit DPluginLoader(QObject*);
149  ~DPluginLoader() override;
150 
151  Q_DISABLE_COPY(DPluginLoader)
152 
153  class Private;
154  Private* const d;
155 
156  friend class DPluginLoaderCreator;
157 };
158 
159 } // namespace Digikam
160 
161 #endif // DIGIKAM_DPLUGIN_LOADER_H
Definition: dpluginaction.h:40
ActionCategory
Plugin action categories.
Definition: dpluginaction.h:56
ActionType
Plugin action types to resume where they can be used.
Definition: dpluginaction.h:47
Definition: dpluginloader_p.h:38
The class that handles digiKam's external plugins.
Definition: dpluginloader.h:53
Definition: piwigotalker.h:48
Definition: datefolderview.cpp:43