• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdevelop API Reference
  • KDE Home
  • Contact Us
 

kdevplatform/language/duchain

  • sources
  • kfour-appscomplete
  • kdevelop
  • kdevplatform
  • language
  • duchain
  • navigation
navigationaction.h
Go to the documentation of this file.
1 /*
2  Copyright 2007 David Nolden <[email protected]>
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Library General Public
6  License version 2 as published by the Free Software Foundation.
7 
8  This library is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  Library General Public License for more details.
12 
13  You should have received a copy of the GNU Library General Public License
14  along with this library; see the file COPYING.LIB. If not, write to
15  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16  Boston, MA 02110-1301, USA.
17  */
18 
19 #ifndef KDEVPLATFORM_NAVIGATIONACTION_H
20 #define KDEVPLATFORM_NAVIGATIONACTION_H
21 
22 #include <QUrl>
23 
24 #include "../duchainpointer.h"
25 
26 #include <KTextEditor/Cursor>
27 
28 namespace KDevelop {
29 class AbstractNavigationContext;
30 
31 struct NavigationAction
32 {
33  enum Type {
34  None,
35  NavigateDeclaration,
36  NavigateUses,
37  ShowUses,
38  JumpToSource, //If this is set, the action jumps to document and cursor if they are valid, else to the declaration-position of decl
39  ExecuteKey, //This is used to do changes within one single navigation-context. executeKey(key) will be called in the current context,
40  //and the context has the chance to react in an arbitrary way.
41  ShowDocumentation
42  };
43 
45  explicit NavigationAction(const QString& _key) : type(ExecuteKey)
46  , key(_key)
47  {
48  }
49 
50  NavigationAction()
51  {
52  }
53 
54  NavigationAction(const DeclarationPointer& decl_, Type type_) : decl(decl_)
55  , type(type_)
56  {
57  }
58 
59  NavigationAction(const QUrl& _document, const KTextEditor::Cursor& _cursor) : type(JumpToSource)
60  , document(_document)
61  , cursor(_cursor)
62  {
63  }
64 
65  explicit NavigationAction(AbstractNavigationContext* _targetContext) : targetContext(_targetContext)
66  {
67  }
68 
69  AbstractNavigationContext* targetContext = nullptr; //If this is set, this action does nothing else than jumping to that context
70 
71  DeclarationPointer decl;
72  Type type = None;
73 
74  QUrl document;
75  KTextEditor::Cursor cursor;
76  QString key;
77 };
78 }
79 
80 Q_DECLARE_TYPEINFO(KDevelop::NavigationAction, Q_MOVABLE_TYPE);
81 
82 #endif
KDevelop::NavigationAction::cursor
KTextEditor::Cursor cursor
Definition: navigationaction.h:75
KDevelop::NavigationAction::NavigateUses
Definition: navigationaction.h:36
KDevelop::NavigationAction::type
Type type
Definition: navigationaction.h:72
KDevelop::NavigationAction::NavigationAction
NavigationAction(AbstractNavigationContext *_targetContext)
Definition: navigationaction.h:65
QUrl
KDevelop::NavigationAction::ExecuteKey
Definition: navigationaction.h:39
KDevelop::NavigationAction::targetContext
AbstractNavigationContext * targetContext
Definition: navigationaction.h:69
KDevelop::NavigationAction::NavigationAction
NavigationAction(const QString &_key)
When executed, this navigation-action calls the "executeKeyAction(QString) function in its navigation...
Definition: navigationaction.h:45
KDevelop::NavigationAction::NavigationAction
NavigationAction(const DeclarationPointer &decl_, Type type_)
Definition: navigationaction.h:54
KDevelop::DUChainPointer< Declaration >
Q_DECLARE_TYPEINFO
Q_DECLARE_TYPEINFO(KDevelop::NavigationAction, Q_MOVABLE_TYPE)
KDevelop::NavigationAction
Definition: navigationaction.h:31
KDevelop::NavigationAction::Type
Type
Definition: navigationaction.h:33
QString
KDevelop::NavigationAction::None
Definition: navigationaction.h:34
KDevelop::NavigationAction::key
QString key
Definition: navigationaction.h:76
KDevelop::NavigationAction::document
QUrl document
Definition: navigationaction.h:74
KDevelop::NavigationAction::NavigationAction
NavigationAction()
Definition: navigationaction.h:50
KDevelop::NavigationAction::NavigateDeclaration
Definition: navigationaction.h:35
KDevelop::AbstractNavigationContext
Definition: abstractnavigationcontext.h:64
KDevelop::NavigationAction::NavigationAction
NavigationAction(const QUrl &_document, const KTextEditor::Cursor &_cursor)
Definition: navigationaction.h:59
KDevelop
Definition: abstractfunctiondeclaration.cpp:27
KDevelop::NavigationAction::ShowUses
Definition: navigationaction.h:37
KDevelop::NavigationAction::decl
DeclarationPointer decl
Definition: navigationaction.h:71
KDevelop::NavigationAction::JumpToSource
Definition: navigationaction.h:38
KDevelop::NavigationAction::ShowDocumentation
Definition: navigationaction.h:41
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

KDE's Doxygen guidelines are available online.

kdevplatform/language/duchain

Skip menu "kdevplatform/language/duchain"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdevelop API Reference

Skip menu "kdevelop API Reference"
  • kdevplatform
  •   debugger
  •   documentation
  •   interfaces
  •   language
  •     assistant
  •     backgroundparser
  •     checks
  •     classmodel
  •     codecompletion
  •     codegen
  •     duchain
  •     editor
  •     highlighting
  •     interfaces
  •     util
  •   outputview
  •   project
  •   serialization
  •   shell
  •   sublime
  •   tests
  •   util
  •   vcs

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal