File indexing completed on 2024-06-16 04:33:42

0001 /*
0002     SPDX-FileCopyrightText: 1998-2009 Sebastian Trueg <trueg@k3b.org>
0003     SPDX-License-Identifier: GPL-2.0-or-later
0004 */
0005 #ifndef _K3B_PLUGIN_MANAGER_H_
0006 #define _K3B_PLUGIN_MANAGER_H_
0007 
0008 #include "k3b_export.h"
0009 
0010 #include <QList>
0011 #include <QObject>
0012 #include <QStringList>
0013 
0014 class QWidget;
0015 
0016 
0017 namespace K3b {
0018     class Plugin;
0019 
0020 
0021     /**
0022      * Use this class to access all K3b plugins (this does not include the
0023      * KParts Plugins!).
0024      * Like the Core the single instance (which has to be created manually)
0025      * can be obtained with the k3bpluginmanager macro.
0026      */
0027     class LIBK3B_EXPORT PluginManager : public QObject
0028     {
0029         Q_OBJECT
0030 
0031     public:
0032         explicit PluginManager( QObject* parent = 0 );
0033         ~PluginManager() override;
0034 
0035         /**
0036          * if group is empty all plugins are returned
0037          */
0038         QList<Plugin*> plugins( const QString& category = QString() ) const;
0039 
0040         /**
0041          * Returns a list of the available categories.
0042          */
0043         QStringList categories() const;
0044 
0045         int pluginSystemVersion() const;
0046         
0047         bool hasPluginDialog( Plugin* plugin ) const;
0048 
0049     public Q_SLOTS:
0050         void loadAll();
0051 
0052         int execPluginDialog( Plugin* plugin, QWidget* parent = 0 );
0053 
0054     private:
0055         class Private;
0056         Private* d;
0057     };
0058 }
0059 
0060 #endif