File indexing completed on 2024-05-12 04:39:13
0001 /* 0002 SPDX-FileCopyrightText: 2007 David Nolden <david.nolden.kdevelop@art-master.de> 0003 SPDX-FileCopyrightText: 2014 Kevin Funk <kfunk@kde.org> 0004 0005 SPDX-License-Identifier: LGPL-2.0-only 0006 */ 0007 0008 #ifndef MACRONAVIGATIONCONTEXT_H 0009 #define MACRONAVIGATIONCONTEXT_H 0010 0011 #include "clangprivateexport.h" 0012 0013 #include "macrodefinition.h" 0014 0015 #include <language/editor/documentcursor.h> 0016 #include <language/duchain/navigation/abstractnavigationcontext.h> 0017 0018 #include <QPointer> 0019 0020 class KDEVCLANGPRIVATE_EXPORT MacroNavigationContext : public KDevelop::AbstractNavigationContext 0021 { 0022 Q_OBJECT 0023 public: 0024 explicit MacroNavigationContext(const MacroDefinition::Ptr& macro, 0025 const KDevelop::DocumentCursor& expansionLocation = KDevelop::DocumentCursor::invalid()); 0026 ~MacroNavigationContext() override; 0027 0028 QString html(bool shorten) override; 0029 QString name() const override; 0030 0031 private: 0032 QString retrievePreprocessedBody(const KDevelop::DocumentCursor& expansionLocation) const; 0033 0034 const MacroDefinition::Ptr m_macro; 0035 QString m_body; 0036 QPointer<QWidget> m_widget; 0037 }; 0038 0039 #endif