File indexing completed on 2024-04-28 04:38:10
0001 /* 0002 SPDX-FileCopyrightText: 2006 Adam Treat <treat@kde.org> 0003 SPDX-FileCopyrightText: 2006-2008 Hamish Rodda <rodda@kde.org> 0004 SPDX-FileCopyrightText: 2009 Lior Mualem <lior.m.kde@gmail.com> 0005 0006 SPDX-License-Identifier: LGPL-2.0-or-later 0007 */ 0008 0009 #ifndef KDEVPLATFORM_PLUGIN_CLASSBROWSERPLUGIN_H 0010 #define KDEVPLATFORM_PLUGIN_CLASSBROWSERPLUGIN_H 0011 0012 #include <interfaces/iplugin.h> 0013 #include <QVariant> 0014 #include <language/duchain/duchainpointer.h> 0015 0016 class ClassTree; 0017 0018 namespace KDevelop { 0019 class Declaration; 0020 } 0021 0022 class ClassBrowserPlugin 0023 : public KDevelop::IPlugin 0024 { 0025 Q_OBJECT 0026 0027 public: 0028 explicit ClassBrowserPlugin(QObject* parent, const QVariantList& = QVariantList()); 0029 ~ClassBrowserPlugin() override; 0030 0031 void setActiveClassTree(ClassTree* a_classTree) { m_activeClassTree = a_classTree; } 0032 0033 public: // KDevelop::Plugin overrides 0034 void unload() override; 0035 KDevelop::ContextMenuExtension contextMenuExtension(KDevelop::Context* context, QWidget* parent) override; 0036 0037 // The duchain must not be locked when this is called! 0038 void showDefinition(const KDevelop::DeclarationPointer& declaration); 0039 0040 private Q_SLOTS: 0041 void findInClassBrowser(); 0042 0043 private: 0044 class ClassBrowserFactory* m_factory; 0045 ClassTree* m_activeClassTree; 0046 QAction* m_findInBrowser; 0047 }; 0048 0049 #endif // KDEVPLATFORM_PLUGIN_CLASSBROWSERPLUGIN_H