Changeset View
Changeset View
Standalone View
Standalone View
plugins/clazy/job_parameters.h
- This file was added.
1 | /* This file is part of KDevelop | ||||
---|---|---|---|---|---|
2 | | ||||
3 | Copyright 2018 Anton Anikin <anton@anikin.xyz> | ||||
4 | | ||||
5 | This program is free software; you can redistribute it and/or | ||||
6 | modify it under the terms of the GNU General Public | ||||
7 | License as published by the Free Software Foundation; either | ||||
8 | version 2 of the License, or (at your option) any later version. | ||||
9 | | ||||
10 | This program is distributed in the hope that it will be useful, | ||||
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||||
13 | General Public License for more details. | ||||
14 | | ||||
15 | You should have received a copy of the GNU General Public License | ||||
16 | along with this program; see the file COPYING. If not, write to | ||||
17 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||||
18 | Boston, MA 02110-1301, USA. | ||||
19 | */ | ||||
20 | | ||||
21 | #ifndef KDEVCLAZY_JOB_PARAMETERS_H | ||||
22 | #define KDEVCLAZY_JOB_PARAMETERS_H | ||||
23 | | ||||
24 | #include <QObject> | ||||
25 | #include <QStringList> | ||||
26 | #include <QUrl> | ||||
27 | | ||||
28 | namespace KDevelop | ||||
29 | { | ||||
30 | | ||||
31 | class IProject; | ||||
32 | | ||||
33 | } | ||||
34 | | ||||
35 | namespace Clazy | ||||
36 | { | ||||
37 | | ||||
38 | class JobGlobalParameters : public QObject | ||||
39 | { | ||||
40 | Q_OBJECT | ||||
41 | | ||||
42 | public: | ||||
43 | JobGlobalParameters(const QUrl& executablePath, const QUrl& docsPath); | ||||
44 | ~JobGlobalParameters() override; | ||||
45 | | ||||
46 | static QUrl defaultExecutablePath(); | ||||
47 | static QUrl defaultDocsPath(); | ||||
48 | | ||||
49 | bool isValid() const; | ||||
50 | QString error() const; | ||||
51 | | ||||
52 | Q_SIGNALS: | ||||
53 | void changed(); | ||||
54 | | ||||
55 | protected: | ||||
56 | JobGlobalParameters(); | ||||
57 | | ||||
58 | QString m_executablePath; | ||||
59 | QString m_docsPath; | ||||
60 | | ||||
61 | QString m_error; | ||||
62 | }; | ||||
63 | | ||||
64 | class JobParameters : public JobGlobalParameters | ||||
65 | { | ||||
66 | Q_OBJECT | ||||
67 | | ||||
68 | public: | ||||
69 | JobParameters(KDevelop::IProject* project); | ||||
70 | JobParameters(KDevelop::IProject* project, const QString& checkPath); | ||||
71 | ~JobParameters() override; | ||||
72 | | ||||
73 | static QString defaultChecks(); | ||||
74 | | ||||
75 | QString checkPath() const; | ||||
76 | const QStringList& sources() const; | ||||
77 | | ||||
78 | QString projectBuildPath() const; | ||||
79 | | ||||
80 | QStringList commandLine() const; | ||||
81 | | ||||
82 | void setChecks(const QString& checks); | ||||
83 | | ||||
84 | void setOnlyQt(bool onlyQt); | ||||
85 | void setQtDeveloper(bool qtDeveloper); | ||||
86 | void setQt4Compat(bool qt4Compat); | ||||
87 | void setVisitImplicitCode(bool visitImplicitCode); | ||||
88 | | ||||
89 | void setIgnoreIncludedFiles(bool ignoreIncludedFiles); | ||||
90 | void setHeaderFilter(const QString& headerFilter); | ||||
91 | | ||||
92 | void setEnableAllFixits(bool enableAllFixits); | ||||
93 | void setNoInplaceFixits(bool noInplaceFixits); | ||||
94 | | ||||
95 | void setExtraAppend(const QString& extraAppend); | ||||
96 | void setExtraPrepend(const QString& extraPrepend); | ||||
97 | void setExtraClazy(const QString& extraClazy); | ||||
98 | | ||||
99 | protected: | ||||
100 | template<typename T> | ||||
101 | void setValue(T& currentValue, const T& newValue); | ||||
102 | | ||||
103 | QString m_checkPath; | ||||
104 | QStringList m_sources; | ||||
105 | | ||||
106 | QString m_projectBuildPath; | ||||
107 | | ||||
108 | QString m_checks; | ||||
109 | | ||||
110 | bool m_onlyQt; | ||||
111 | bool m_qtDeveloper; | ||||
112 | bool m_qt4Compat; | ||||
113 | bool m_visitImplicitCode; | ||||
114 | | ||||
115 | bool m_ignoreIncludedFiles; | ||||
116 | QString m_headerFilter; | ||||
117 | | ||||
118 | bool m_enableAllFixits; | ||||
119 | bool m_noInplaceFixits; | ||||
120 | | ||||
121 | QString m_extraAppend; | ||||
122 | QString m_extraPrepend; | ||||
123 | QString m_extraClazy; | ||||
124 | }; | ||||
125 | | ||||
126 | } | ||||
127 | #endif |