File indexing completed on 2025-03-09 03:58:49

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2018-07-30
0007  * Description : Batch Queue Manager digiKam plugin definition.
0008  *
0009  * SPDX-FileCopyrightText: 2018-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
0010  *
0011  * SPDX-License-Identifier: GPL-2.0-or-later
0012  *
0013  * ============================================================ */
0014 
0015 #ifndef DIGIKAM_DPLUGIN_BQM_H
0016 #define DIGIKAM_DPLUGIN_BQM_H
0017 
0018 // Qt includes
0019 
0020 #include <QWidget>
0021 
0022 // Local includes
0023 
0024 #include "dplugin.h"
0025 #include "dpluginloader.h"
0026 #include "batchtool.h"
0027 #include "digikam_export.h"
0028 
0029 namespace Digikam
0030 {
0031 
0032 class DIGIKAM_GUI_EXPORT DPluginBqm : public DPlugin
0033 {
0034     Q_OBJECT
0035 
0036 public:
0037 
0038     /**
0039      * Constructor with optional parent object
0040      */
0041     explicit DPluginBqm(QObject* const parent = nullptr);
0042 
0043     /**
0044      * Destructor
0045      */
0046     ~DPluginBqm()                                             override;
0047 
0048 public:
0049 
0050     bool hasVisibilityProperty()                        const override;
0051 
0052     /**
0053      * Holds whether the plugin can be seen in parent view.
0054      */
0055     void setVisible(bool b)                                   override;
0056 
0057     /**
0058      * Return all plugin tools registered in setup() method with addTool() for a given parent.
0059      */
0060     QList<BatchTool*> tools(QObject* const parent)      const;
0061 
0062     /**
0063      * Return the amount of tools registered.
0064      */
0065     int count()                                         const override;
0066 
0067     /**
0068      * Return a plugin tool instance found by name in plugin tools list for a given parent.
0069      */
0070     BatchTool* findToolByName(const QString& name,
0071                               QObject* const parent)    const;
0072 
0073     /**
0074      * Return a list of batch tool group categories as strings registered in this plugin.
0075      */
0076     QStringList categories()                            const override;
0077 
0078     /**
0079      * Return the plugin interface identifier.
0080      */
0081     QString ifaceIid()                                  const override
0082     {
0083         return QLatin1String(DIGIKAM_DPLUGIN_BQM_IID);
0084     };
0085 
0086 Q_SIGNALS:
0087 
0088     void signalVisible(bool);
0089 
0090 protected:
0091 
0092     void addTool(BatchTool* const t);
0093 
0094 public:
0095 
0096     /**
0097      * Return the info interface instance.
0098      */
0099     DInfoInterface* infoIface() const;
0100 
0101 private:
0102 
0103     class Private;
0104     Private* const d;
0105 };
0106 
0107 } // namespace Digikam
0108 
0109 Q_DECLARE_INTERFACE(Digikam::DPluginBqm, DIGIKAM_DPLUGIN_BQM_IID)
0110 
0111 #endif // DIGIKAM_DPLUGIN_BQM_H