File indexing completed on 2024-05-05 05:51: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/Plugin>
0009 #include <KXMLGUIClient>
0010 
0011 #include <QVariant>
0012 
0013 #include "cmakecompletion.h"
0014 
0015 /**
0016  * Plugin
0017  */
0018 class CMakeToolsPlugin : public KTextEditor::Plugin
0019 {
0020     Q_OBJECT
0021 
0022 public:
0023     explicit CMakeToolsPlugin(QObject *parent = nullptr, const QVariantList & = QVariantList());
0024 
0025     ~CMakeToolsPlugin() override;
0026 
0027     QObject *createView(KTextEditor::MainWindow *mainWindow) override;
0028 };
0029 
0030 /**
0031  * Plugin view
0032  */
0033 class CMakeToolsPluginView : public QObject, public KXMLGUIClient
0034 {
0035     Q_OBJECT
0036 
0037 public:
0038     CMakeToolsPluginView(CMakeToolsPlugin *plugin, KTextEditor::MainWindow *mainwindow);
0039 
0040     ~CMakeToolsPluginView() override;
0041 
0042 private Q_SLOTS:
0043     void onViewCreated(KTextEditor::View *v);
0044 
0045 private:
0046     KTextEditor::MainWindow *m_mainWindow;
0047     CMakeCompletion m_completion;
0048 };