1 /* 2 SPDX-FileCopyrightText: 2018 Friedrich W. H. Kossebau <kossebau@kde.org> 3 4 SPDX-License-Identifier: GPL-2.0-or-later 5 */ 6 7 #ifndef CLANGTIDY_PROJECTCONFIGPAGE_H 8 #define CLANGTIDY_PROJECTCONFIGPAGE_H 9 10 // plugin 11 #include "ui_clangtidyprojectconfigpage.h" 12 #include "checksetselection.h" 13 // KDevPlatform 14 #include <interfaces/configpage.h> 15 // Qt 16 #include <QVector> 17 18 19 namespace KDevelop 20 { 21 class IProject; 22 } 23 24 class ClangTidyProjectSettings; 25 26 namespace ClangTidy 27 { 28 class CheckSetSelectionManager; 29 class CheckSet; 30 31 /** 32 * \class 33 * \brief Implements the clang-tidy's configuration project for the current 34 * project. 35 */ 36 class ProjectConfigPage : public KDevelop::ConfigPage 37 { 38 Q_OBJECT 39 40 public: 41 ProjectConfigPage(KDevelop::IPlugin* plugin, 42 KDevelop::IProject* project, 43 CheckSetSelectionManager* checkSetSelectionManager, 44 const CheckSet* checkSet, 45 QWidget* parent); 46 ~ProjectConfigPage() override; 47 48 public: // KDevelop::ConfigPage API 49 ConfigPageType configPageType() const override; 50 QString name() const override; 51 QIcon icon() const override; 52 53 void apply() override; 54 void defaults() override; 55 void reset() override; 56 57 private Q_SLOTS: 58 void onSelectionChanged(const QString& selection); 59 void onChecksChanged(const QString& checks); 60 61 private: 62 Ui::ProjectConfigPage m_ui; 63 64 ClangTidyProjectSettings* m_settings; 65 KDevelop::IProject* m_project; 66 const QVector<CheckSetSelection> m_checkSetSelections; 67 const QString m_defaultCheckSetSelectionId; 68 }; 69 70 } 71 72 #endif /* CLANGTIDY_PROJECTCONFIGPAGE_H_ */ 73