File indexing completed on 2024-05-05 15:58:11

0001 /*
0002     This program is free software; you can redistribute it and/or
0003     modify it under the terms of the GNU General Public License
0004     as published by the Free Software Foundation; either version 2
0005     of the License, or (at your option) any later version.
0006 
0007     This program is distributed in the hope that it will be useful,
0008     but WITHOUT ANY WARRANTY; without even the implied warranty of
0009     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0010     GNU General Public License for more details.
0011 
0012     You should have received a copy of the GNU General Public License
0013     along with this program; if not, write to the Free Software
0014     Foundation, Inc., 51 Franklin Street, Fifth Floor,
0015     Boston, MA  02110-1301, USA.
0016 
0017     ---
0018     Copyright (C) 2010 Alexander Rieder <alexanderrieder@gmail.com>
0019  */
0020 
0021 #ifndef _PANELPLUGINHANDLER_H
0022 #define _PANELPLUGINHANDLER_H
0023 
0024 #include <QObject>
0025 #include <cantor/cantor_export.h>
0026 
0027 namespace Cantor
0028 {
0029 class PanelPluginHandlerPrivate;
0030 class PanelPlugin;
0031 class Session;
0032 
0033 /**
0034  * Simple interface that exports a list of known PanelPlugins.
0035  * Needed as the Panel must be handled by the Shell while plugins
0036  * belong to the Part.
0037  */
0038 
0039 class CANTOR_EXPORT PanelPluginHandler : public QObject
0040 {
0041   Q_OBJECT
0042   public:
0043     explicit PanelPluginHandler(QObject* parent);
0044     ~PanelPluginHandler() override;
0045 
0046     QList<PanelPlugin*> plugins();
0047 
0048     void addPlugin(PanelPlugin* plugin);
0049 
0050     void setSession(Session* session);
0051 
0052   Q_SIGNALS:
0053     void pluginsChanged();
0054 
0055   private:
0056     void loadPlugins();
0057 
0058   private:
0059     PanelPluginHandlerPrivate* d;
0060 
0061 };
0062 
0063 }
0064 
0065 #endif /* _PANELPLUGINHANDLER_H */