Changeset View
Changeset View
Standalone View
Standalone View
languages/clang/codegen/clangrefactoring.h
Show All 22 Lines | |||||
23 | 23 | | |||
24 | #ifndef SIMPLEREFACTORING_H | 24 | #ifndef SIMPLEREFACTORING_H | ||
25 | #define SIMPLEREFACTORING_H | 25 | #define SIMPLEREFACTORING_H | ||
26 | 26 | | |||
27 | #include "clangprivateexport.h" | 27 | #include "clangprivateexport.h" | ||
28 | 28 | | |||
29 | #include <language/codegen/basicrefactoring.h> | 29 | #include <language/codegen/basicrefactoring.h> | ||
30 | 30 | | |||
31 | class TestRefactoring; | ||||
32 | | ||||
31 | namespace KDevelop | 33 | namespace KDevelop | ||
32 | { | 34 | { | ||
33 | class Context; | 35 | class Context; | ||
34 | class ContextMenuExtension; | 36 | class ContextMenuExtension; | ||
35 | class Declaration; | 37 | class Declaration; | ||
36 | } | 38 | } | ||
37 | 39 | | |||
38 | class KDEVCLANGPRIVATE_EXPORT ClangRefactoring : public KDevelop::BasicRefactoring | 40 | class KDEVCLANGPRIVATE_EXPORT ClangRefactoring : public KDevelop::BasicRefactoring | ||
39 | { | 41 | { | ||
40 | Q_OBJECT | 42 | Q_OBJECT | ||
41 | 43 | | |||
42 | public: | 44 | public: | ||
43 | explicit ClangRefactoring(QObject* parent = nullptr); | 45 | explicit ClangRefactoring(QObject* parent = nullptr); | ||
44 | 46 | | |||
45 | void fillContextMenu(KDevelop::ContextMenuExtension& extension, KDevelop::Context* context) override; | 47 | void fillContextMenu(KDevelop::ContextMenuExtension& extension, KDevelop::Context* context) override; | ||
46 | 48 | | |||
47 | QString moveIntoSource(const KDevelop::IndexedDeclaration& iDecl); | 49 | QString moveIntoSource(const KDevelop::IndexedDeclaration& iDecl); | ||
48 | 50 | | |||
49 | public slots: | 51 | public slots: | ||
50 | void executeMoveIntoSourceAction(); | 52 | void executeMoveIntoSourceAction(); | ||
51 | 53 | | |||
54 | protected: | ||||
55 | KDevelop::DocumentChangeSet::ChangeResult applyChangesToDeclarations(const QString& oldName, const QString& newName, KDevelop::DocumentChangeSet& changes, const QList<KDevelop::IndexedDeclaration>& declarations) override; | ||||
56 | | ||||
52 | private: | 57 | private: | ||
58 | friend TestRefactoring; | ||||
59 | | ||||
53 | bool validCandidateToMoveIntoSource(KDevelop::Declaration* decl); | 60 | bool validCandidateToMoveIntoSource(KDevelop::Declaration* decl); | ||
54 | }; | 61 | }; | ||
55 | 62 | | |||
56 | #endif | 63 | #endif |