kdevplatform/language/duchain
abstractnavigationcontext.cpp
Go to the documentation of this file.
41 QVector<NavigationContextPointer> m_children; //Used to keep alive all children until this is deleted
93 void AbstractNavigationContext::makeLink(const QString& name, const DeclarationPointer& declaration,
100 QString AbstractNavigationContext::createLink(const QString& name, const QString&, const NavigationAction& action)
125 str = QLatin1String("<font style=\"background-color:#f1f1f1;\" color=\"#880088\">") + str + QLatin1String(
141 void AbstractNavigationContext::makeLink(const QString& name, const QString& targetId, const NavigationAction& action)
185 if (!action.decl && (action.type != NavigationAction::JumpToSource || action.document.isEmpty())) {
235 QMetaObject::invokeMethod(ICore::self()->documentController(), "openDocument", Qt::QueuedConnection,
240 auto doc = ICore::self()->documentationController()->documentationForDeclaration(action.decl.data());
242 // which can happen e.g. due to focus change events resulting in tooltip destruction and thus this object
267 NavigationContextPointer AbstractNavigationContext::registerChild(AbstractNavigationContext* context)
275 NavigationContextPointer AbstractNavigationContext::registerChild(const DeclarationPointer& declaration)
318 for (int newSelectedLink = d->m_selectedLink + 1; newSelectedLink < d->m_linkCount; ++newSelectedLink) {
319 if (d->m_linkLines[newSelectedLink] > fromLine && d->m_linkLines[newSelectedLink] - fromLine <= lineJump) {
366 if (d->m_linkLines[newSelectedLink] < fromLine && fromLine - d->m_linkLines[newSelectedLink] <= lineJump) {
470 NavigationAction action(DeclarationPointer(decl.data()), NavigationAction::NavigateDeclaration);
581 "<font color=\"#880088\"> <a name = \"currentPosition\" ><-></a> </font>"); // ><-> is <->
596 QString ret = QLatin1String("<font color=\"#") + m_color + QLatin1String("\">") + str + QLatin1String("</font>");
617 const Colorizer AbstractNavigationContext::nameHighlight(QStringLiteral("000000"), Colorizer::Bold);
Customized read locker for the definition-use chain.
Definition: duchainlock.h:114
static DUChainLock * lock()
Retrieve the read write lock for the entire definition-use chain.
Definition: duchain.cpp:1283
A type is declared, like a class-declaration or function-declaration, or a typedef("class MyClass {};...
Definition: declaration.h:64
virtual AbstractNavigationWidget * createNavigationWidget(Declaration *decl=nullptr, TopDUContext *topContext=nullptr, AbstractNavigationWidget::DisplayHints hints=AbstractNavigationWidget::NoHints) const
Can be specialized by languages to create a navigation/information-widget.
Definition: ducontext.cpp:1504
int matchedLength() const
bool isTypeAlias() const
Determine if this declaration is a type-alias (in c++ typedef).
Definition: declaration.cpp:538
static QStringList splitAndKeep(QString str, const QRegExp ®Exp)
Splits the string by the given regular expression, but keeps the split-matches at the end of each lin...
Definition: abstractnavigationcontext.cpp:556
Represents a declaration only by its global indices.
Definition: indexeddeclaration.h:33
bool isEmpty() const
An instance of a type is declared("MyClass m;")
Definition: declaration.h:65
int indexIn(const QString &str, int offset, CaretMode caretMode) const
TypePtr< T > type() const
Convenience function to return this declaration's type dynamically casted to T.
Definition: declaration.h:305
A helper-class for elegant colorization of html-strings .
Definition: abstractnavigationcontext.h:36
DUContext * context() const
Access the parent context of this declaration.
Definition: declaration.cpp:279
QExplicitlySharedDataPointer< AbstractNavigationContext > NavigationContextPointer
Definition: abstractnavigationcontext.h:62
KTextEditor::Range rangeInCurrentRevision() const
Returns the range assigned to this object, transformed into the current revision of the document.
Definition: duchainbase.cpp:157
QString & remove(int position, int n)
virtual bool isForwardDeclaration() const
Determine whether this declaration is a forward declaration.
Definition: declaration.cpp:650
QString operator()(const QString &str) const
Definition: abstractnavigationcontext.cpp:594
QString left(int n) const
bool invokeMethod(QObject *obj, const char *member, Qt::ConnectionType type, QGenericReturnArgument ret, QGenericArgument val0, QGenericArgument val1, QGenericArgument val2, QGenericArgument val3, QGenericArgument val4, QGenericArgument val5, QGenericArgument val6, QGenericArgument val7, QGenericArgument val8, QGenericArgument val9)
DUChainPointer< TopDUContext > TopDUContextPointer
Definition: duchainpointer.h:199
Definition: abstractfunctiondeclaration.cpp:27
virtual void activateSpecialization()
Signalized that among multiple possible specializations, this one should be used in the UI from now o...
Definition: declaration.cpp:555
QString arg(qlonglong a, int fieldWidth, int base, const QChar &fillChar) const
DUChainPointer< Declaration > DeclarationPointer
Definition: duchainpointer.h:200
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Wed Mar 3 2021 00:37:28 by doxygen 1.8.16 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2021 The KDE developers.
Generated on Wed Mar 3 2021 00:37:28 by doxygen 1.8.16 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.