File indexing completed on 2024-04-28 15:53:09
0001 /* 0002 SPDX-FileCopyrightText: 2012 Sven Brauch <svenbrauch@googlemail.com> 0003 SPDX-FileCopyrightText: 2014 Miquel Sabaté <mikisabate@gmail.com> 0004 0005 SPDX-License-Identifier: LGPL-2.0-or-later 0006 */ 0007 0008 #ifndef REFACTORING_H_ 0009 #define REFACTORING_H_ 0010 0011 0012 #include <interfaces/context.h> 0013 #include <language/codegen/basicrefactoring.h> 0014 0015 namespace KDevelop { 0016 class Declaration; 0017 } 0018 0019 0020 namespace Python { 0021 0022 class RefactoringCollector : public KDevelop::BasicRefactoringCollector 0023 { 0024 Q_OBJECT 0025 0026 public: 0027 RefactoringCollector(const KDevelop::IndexedDeclaration &decl); 0028 0029 protected: 0030 void processUses(KDevelop::ReferencedTopDUContext topContext) override; 0031 }; 0032 0033 class Refactoring : public KDevelop::BasicRefactoring 0034 { 0035 Q_OBJECT 0036 0037 public: 0038 explicit Refactoring(QObject *parent = nullptr); 0039 0040 protected: 0041 bool acceptForContextMenu(const KDevelop::Declaration *decl) override; 0042 }; 0043 0044 } 0045 0046 #endif // REFACTORING_H_