File indexing completed on 2024-05-12 04:39:22
0001 /* 0002 SPDX-FileCopyrightText: 2018 Friedrich W. H. Kossebau <kossebau@kde.org> 0003 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #ifndef CLANGTIDY_PROJECTCONFIGPAGE_H 0008 #define CLANGTIDY_PROJECTCONFIGPAGE_H 0009 0010 // plugin 0011 #include "ui_clangtidyprojectconfigpage.h" 0012 #include "checksetselection.h" 0013 // KDevPlatform 0014 #include <interfaces/configpage.h> 0015 // Qt 0016 #include <QVector> 0017 0018 0019 namespace KDevelop 0020 { 0021 class IProject; 0022 } 0023 0024 class ClangTidyProjectSettings; 0025 0026 namespace ClangTidy 0027 { 0028 class CheckSetSelectionManager; 0029 class CheckSet; 0030 0031 /** 0032 * \class 0033 * \brief Implements the clang-tidy's configuration project for the current 0034 * project. 0035 */ 0036 class ProjectConfigPage : public KDevelop::ConfigPage 0037 { 0038 Q_OBJECT 0039 0040 public: 0041 ProjectConfigPage(KDevelop::IPlugin* plugin, 0042 KDevelop::IProject* project, 0043 CheckSetSelectionManager* checkSetSelectionManager, 0044 const CheckSet* checkSet, 0045 QWidget* parent); 0046 ~ProjectConfigPage() override; 0047 0048 public: // KDevelop::ConfigPage API 0049 ConfigPageType configPageType() const override; 0050 QString name() const override; 0051 QIcon icon() const override; 0052 0053 void apply() override; 0054 void defaults() override; 0055 void reset() override; 0056 0057 private Q_SLOTS: 0058 void onSelectionChanged(const QString& selection); 0059 void onChecksChanged(const QString& checks); 0060 0061 private: 0062 Ui::ProjectConfigPage m_ui; 0063 0064 ClangTidyProjectSettings* m_settings; 0065 KDevelop::IProject* m_project; 0066 const QVector<CheckSetSelection> m_checkSetSelections; 0067 const QString m_defaultCheckSetSelectionId; 0068 }; 0069 0070 } 0071 0072 #endif /* CLANGTIDY_PROJECTCONFIGPAGE_H_ */