File indexing completed on 2024-04-28 05:48:20
0001 /* 0002 SPDX-FileCopyrightText: 2021 Waqar Ahmed <waqar.17a@gmail.com> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 #pragma once 0007 0008 #include <KTextEditor/MainWindow> 0009 #include <KTextEditor/Plugin> 0010 #include <KTextEditor/View> 0011 0012 class CEPlugin : public KTextEditor::Plugin 0013 { 0014 Q_OBJECT 0015 0016 public: 0017 /** 0018 * Plugin constructor. 0019 */ 0020 explicit CEPlugin(QObject *parent = nullptr, const QVariantList & = QVariantList()); 0021 0022 ~CEPlugin() override; 0023 0024 QObject *createView(KTextEditor::MainWindow *mainWindow) override; 0025 }; 0026 0027 /** 0028 * Plugin view to merge the actions into the UI 0029 */ 0030 class CEPluginView : public QObject, public KXMLGUIClient 0031 { 0032 Q_OBJECT 0033 0034 public: 0035 /** 0036 * Construct plugin view 0037 * @param plugin our plugin 0038 * @param mainwindows the mainwindow for this view 0039 */ 0040 explicit CEPluginView(CEPlugin *plugin, KTextEditor::MainWindow *mainwindow); 0041 0042 /** 0043 * Our Destructor 0044 */ 0045 ~CEPluginView() override; 0046 0047 private Q_SLOTS: 0048 void openANewTab(); 0049 0050 private: 0051 /** 0052 * the main window we belong to 0053 */ 0054 KTextEditor::MainWindow *m_mainWindow; 0055 class CEWidget *m_mainWidget; 0056 };