Changeset View
Changeset View
Standalone View
Standalone View
languages/clang/duchain/clangproblem.h
Show All 17 Lines | |||||
18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
19 | * | 19 | * | ||
20 | */ | 20 | */ | ||
21 | 21 | | |||
22 | 22 | | |||
23 | #ifndef CLANGPROBLEM_H | 23 | #ifndef CLANGPROBLEM_H | ||
24 | #define CLANGPROBLEM_H | 24 | #define CLANGPROBLEM_H | ||
25 | 25 | | |||
26 | #include <duchain/clangduchainexport.h> | 26 | #include "clangprivateexport.h" | ||
27 | 27 | | |||
28 | #include <language/duchain/problem.h> | 28 | #include <language/duchain/problem.h> | ||
29 | #include <interfaces/iassistant.h> | 29 | #include <interfaces/iassistant.h> | ||
30 | 30 | | |||
31 | #include <clang-c/Index.h> | 31 | #include <clang-c/Index.h> | ||
32 | 32 | | |||
33 | struct KDEVCLANGDUCHAIN_EXPORT ClangFixit | 33 | struct KDEVCLANGPRIVATE_EXPORT ClangFixit | ||
34 | { | 34 | { | ||
35 | QString replacementText; | 35 | QString replacementText; | ||
36 | KDevelop::DocumentRange range; | 36 | KDevelop::DocumentRange range; | ||
37 | QString description; | 37 | QString description; | ||
38 | 38 | | |||
39 | bool operator==(const ClangFixit& other) const | 39 | bool operator==(const ClangFixit& other) const | ||
40 | { | 40 | { | ||
41 | return replacementText == other.replacementText | 41 | return replacementText == other.replacementText | ||
42 | && range == other.range | 42 | && range == other.range | ||
43 | && description == other.description; | 43 | && description == other.description; | ||
44 | } | 44 | } | ||
45 | }; | 45 | }; | ||
46 | 46 | | |||
47 | QDebug KDEVCLANGDUCHAIN_EXPORT operator<<(QDebug debug, const ClangFixit& fixit); | 47 | QDebug KDEVCLANGPRIVATE_EXPORT operator<<(QDebug debug, const ClangFixit& fixit); | ||
48 | 48 | | |||
49 | using ClangFixits = QVector<ClangFixit>; | 49 | using ClangFixits = QVector<ClangFixit>; | ||
50 | 50 | | |||
51 | class KDEVCLANGDUCHAIN_EXPORT ClangProblem : public KDevelop::Problem | 51 | class KDEVCLANGPRIVATE_EXPORT ClangProblem : public KDevelop::Problem | ||
52 | { | 52 | { | ||
53 | public: | 53 | public: | ||
54 | using Ptr = QExplicitlySharedDataPointer<ClangProblem>; | 54 | using Ptr = QExplicitlySharedDataPointer<ClangProblem>; | ||
55 | using ConstPtr = QExplicitlySharedDataPointer<const ClangProblem>; | 55 | using ConstPtr = QExplicitlySharedDataPointer<const ClangProblem>; | ||
56 | 56 | | |||
57 | /** | 57 | /** | ||
58 | * Import @p diagnostic into a ClangProblem object | 58 | * Import @p diagnostic into a ClangProblem object | ||
59 | * | 59 | * | ||
Show All 13 Lines | |||||
73 | */ | 73 | */ | ||
74 | ClangFixits allFixits() const; | 74 | ClangFixits allFixits() const; | ||
75 | 75 | | |||
76 | private: | 76 | private: | ||
77 | ClangFixits m_fixits; | 77 | ClangFixits m_fixits; | ||
78 | }; | 78 | }; | ||
79 | 79 | | |||
80 | 80 | | |||
81 | class KDEVCLANGDUCHAIN_EXPORT ClangFixitAssistant : public KDevelop::IAssistant | 81 | class KDEVCLANGPRIVATE_EXPORT ClangFixitAssistant : public KDevelop::IAssistant | ||
82 | { | 82 | { | ||
83 | Q_OBJECT | 83 | Q_OBJECT | ||
84 | 84 | | |||
85 | public: | 85 | public: | ||
86 | ClangFixitAssistant(const ClangFixits& fixits); | 86 | ClangFixitAssistant(const ClangFixits& fixits); | ||
87 | ClangFixitAssistant(const QString& title, const ClangFixits& fixits); | 87 | ClangFixitAssistant(const QString& title, const ClangFixits& fixits); | ||
88 | 88 | | |||
89 | QString title() const override; | 89 | QString title() const override; | ||
90 | 90 | | |||
91 | void createActions() override; | 91 | void createActions() override; | ||
92 | 92 | | |||
93 | ClangFixits fixits() const; | 93 | ClangFixits fixits() const; | ||
94 | 94 | | |||
95 | private: | 95 | private: | ||
96 | QString m_title; | 96 | QString m_title; | ||
97 | ClangFixits m_fixits; | 97 | ClangFixits m_fixits; | ||
98 | }; | 98 | }; | ||
99 | 99 | | |||
100 | class KDEVCLANGDUCHAIN_EXPORT ClangFixitAction : public KDevelop::IAssistantAction | 100 | class KDEVCLANGPRIVATE_EXPORT ClangFixitAction : public KDevelop::IAssistantAction | ||
101 | { | 101 | { | ||
102 | Q_OBJECT | 102 | Q_OBJECT | ||
103 | 103 | | |||
104 | public: | 104 | public: | ||
105 | ClangFixitAction(const ClangFixit& fixit); | 105 | ClangFixitAction(const ClangFixit& fixit); | ||
106 | 106 | | |||
107 | QString description() const override; | 107 | QString description() const override; | ||
108 | 108 | | |||
109 | public Q_SLOTS: | 109 | public Q_SLOTS: | ||
110 | void execute() override; | 110 | void execute() override; | ||
111 | 111 | | |||
112 | private: | 112 | private: | ||
113 | ClangFixit m_fixit; | 113 | ClangFixit m_fixit; | ||
114 | }; | 114 | }; | ||
115 | 115 | | |||
116 | #endif // CLANGPROBLEM_H | 116 | #endif // CLANGPROBLEM_H |