File indexing completed on 2024-04-21 04:38:10

0001 /*
0002     SPDX-FileCopyrightText: 2018 Anton Anikin <anton@anikin.xyz>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #ifndef KDEVCLAZY_PLUGIN_H
0008 #define KDEVCLAZY_PLUGIN_H
0009 
0010 // KDevPlatform
0011 #include <interfaces/iplugin.h>
0012 // Qt
0013 #include <QSharedPointer>
0014 
0015 namespace Clazy
0016 {
0017 
0018 class ChecksDB;
0019 class Analyzer;
0020 class CheckSetSelectionManager;
0021 
0022 class Plugin : public KDevelop::IPlugin
0023 {
0024     Q_OBJECT
0025 
0026 public:
0027     explicit Plugin(QObject* parent, const QVariantList& = QVariantList());
0028     ~Plugin() override;
0029 
0030 public: // KDevelop::IPlugin API
0031     void unload() override;
0032     int configPages() const override { return 1; }
0033     KDevelop::ConfigPage* configPage(int number, QWidget* parent) override;
0034 
0035     int perProjectConfigPages() const override { return 1; }
0036     KDevelop::ConfigPage* perProjectConfigPage(int number, const KDevelop::ProjectConfigOptions& options, QWidget* parent) override;
0037 
0038     KDevelop::ContextMenuExtension contextMenuExtension(KDevelop::Context* context, QWidget* parent) override;
0039 
0040 public:
0041     QSharedPointer<const ChecksDB> checksDB() const;
0042     QSharedPointer<const ChecksDB> loadedChecksDB();
0043 
0044 private:
0045     void reloadDB();
0046 
0047 private:
0048     Analyzer* m_analyzer;
0049     QSharedPointer<ChecksDB> m_db;
0050     CheckSetSelectionManager* m_checkSetSelectionManager;
0051 };
0052 
0053 }
0054 
0055 #endif