digiKam
dplugingeneric.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 : Generic digiKam plugin definition.
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_GENERIC_H
25 #define DIGIKAM_DPLUGIN_GENERIC_H
26 
27 // Qt includes
28 
29 #include <QWidget>
30 
31 // Local includes
32 
33 #include "dinfointerface.h"
34 #include "dplugin.h"
35 #include "dpluginaction.h"
36 #include "digikam_export.h"
37 
38 namespace Digikam
39 {
40 
41 class DIGIKAM_EXPORT DPluginGeneric : public DPlugin
42 {
43  Q_OBJECT
44 
45 public:
46 
50  explicit DPluginGeneric(QObject* const parent = nullptr);
51 
55  ~DPluginGeneric() override;
56 
57 public:
58 
62  void setVisible(bool b) override;
63 
67  QList<DPluginAction*> actions(QObject* const parent) const;
68 
72  int count() const override;
73 
77  DPluginAction* findActionByName(const QString& name, QObject* const parent) const;
78 
82  QStringList categories() const override;
83 
87  QString ifaceIid() const override { return QLatin1String(DIGIKAM_DPLUGIN_GENERIC_IID); };
88 
89 protected:
90 
91  void addAction(DPluginAction* const ac);
92 
96  DInfoInterface* infoIface(QObject* const ac) const;
97 
101  bool reactivateToolDialog(QWidget* const dlg) const;
102 
103 private:
104 
105  class Private;
106  Private* const d;
107 };
108 
109 } // namespace Digikam
110 
112 
113 #endif // DIGIKAM_DPLUGIN_GENERIC_H
Definition: dinfointerface.h:56
Definition: dpluginaction.h:40
Definition: dplugingeneric.h:42
QString ifaceIid() const override
Definition: dplugingeneric.h:87
Definition: dplugin.h:61
#define DIGIKAM_DPLUGIN_GENERIC_IID
Definition: dplugin.h:48
Definition: datefolderview.cpp:43