File indexing completed on 2024-06-16 03:42:07

0001 /*
0002     SPDX-License-Identifier: GPL-2.0-or-later
0003 
0004     SPDX-FileCopyrightText: 2010 Alexander Rieder <alexanderrieder@gmail.com>
0005 */
0006 
0007 #ifndef _PANELPLUGINHANDLER_H
0008 #define _PANELPLUGINHANDLER_H
0009 
0010 #include <QObject>
0011 #include <cantor/cantor_export.h>
0012 
0013 namespace Cantor
0014 {
0015 class PanelPluginHandlerPrivate;
0016 class PanelPlugin;
0017 class Session;
0018 
0019 /**
0020  * Simple interface that exports a list of known PanelPlugins.
0021  * Needed as the Panel must be handled by the Shell while plugins
0022  * belong to the Part.
0023  */
0024 
0025 class CANTOR_EXPORT PanelPluginHandler : public QObject
0026 {
0027   Q_OBJECT
0028   public:
0029     explicit PanelPluginHandler(QObject* parent);
0030     ~PanelPluginHandler() override;
0031 
0032     QList<PanelPlugin*> plugins();
0033 
0034     void addPlugin(PanelPlugin* plugin);
0035 
0036     void setSession(Session* session);
0037 
0038   Q_SIGNALS:
0039     void pluginsChanged();
0040 
0041   private:
0042     void loadPlugins();
0043 
0044   private:
0045     PanelPluginHandlerPrivate* d;
0046 
0047 };
0048 
0049 }
0050 
0051 #endif /* _PANELPLUGINHANDLER_H */