File indexing completed on 2024-05-05 05:53:50
0001 /* This file was part of the KDE libraries 0002 0003 SPDX-FileCopyrightText: 2021 Tomaz Canabrava <tcanabrava@kde.org> 0004 0005 SPDX-License-Identifier: GPL-2.0-or-later 0006 */ 0007 0008 #ifndef IKONSOLEPLUGIN_H 0009 #define IKONSOLEPLUGIN_H 0010 0011 #include <QList> 0012 #include <QObject> 0013 0014 #include <terminalDisplay/TerminalDisplay.h> 0015 0016 #include <KPluginFactory> 0017 0018 #include <memory> 0019 0020 #include "konsoleapp_export.h" 0021 0022 namespace Konsole 0023 { 0024 class MainWindow; 0025 0026 class KONSOLEAPP_EXPORT IKonsolePlugin : public QObject 0027 { 0028 Q_OBJECT 0029 public: 0030 IKonsolePlugin(QObject *parent, const QVariantList &args); 0031 ~IKonsolePlugin() override; 0032 0033 QString name() const; 0034 0035 // Usable only from PluginManager, please don't use. 0036 void addMainWindow(Konsole::MainWindow *mainWindow); 0037 void removeMainWindow(Konsole::MainWindow *mainWindow); 0038 0039 virtual void createWidgetsForMainWindow(Konsole::MainWindow *mainWindow) = 0; 0040 virtual void activeViewChanged(Konsole::SessionController *controller, Konsole::MainWindow *mainWindow) = 0; 0041 0042 virtual QList<QAction *> menuBarActions(Konsole::MainWindow *mainWindow) const 0043 { 0044 Q_UNUSED(mainWindow) 0045 return {}; 0046 } 0047 0048 protected: 0049 void setName(const QString &pluginName); 0050 0051 private: 0052 struct Private; 0053 std::unique_ptr<Private> d; 0054 }; 0055 0056 } 0057 #endif