Changeset View
Changeset View
Standalone View
Standalone View
plugins/contextbrowser/contextbrowserview.h
Show All 23 Lines | |||||
24 | 24 | | |||
25 | #include <QWidget> | 25 | #include <QWidget> | ||
26 | #include <QVector> | 26 | #include <QVector> | ||
27 | #include <QPointer> | 27 | #include <QPointer> | ||
28 | 28 | | |||
29 | #include <language/duchain/topducontext.h> | 29 | #include <language/duchain/topducontext.h> | ||
30 | #include <language/editor/documentcursor.h> | 30 | #include <language/editor/documentcursor.h> | ||
31 | #include <serialization/indexedstring.h> | 31 | #include <serialization/indexedstring.h> | ||
32 | #include <interfaces/itoolviewactionlistener.h> | ||||
32 | 33 | | |||
33 | class ContextBrowserPlugin; | 34 | class ContextBrowserPlugin; | ||
34 | class QVBoxLayout; | 35 | class QVBoxLayout; | ||
35 | class QHBoxLayout; | 36 | class QHBoxLayout; | ||
36 | class QAction; | 37 | class QAction; | ||
37 | class QCheckBox; | 38 | class QCheckBox; | ||
38 | class QMenu; | 39 | class QMenu; | ||
39 | class KComboBox; | 40 | class KComboBox; | ||
40 | 41 | | |||
41 | namespace KDevelop { | 42 | namespace KDevelop { | ||
42 | class IDocument; | 43 | class IDocument; | ||
43 | } | 44 | } | ||
44 | 45 | | |||
45 | class ContextBrowserView : public QWidget { | 46 | class ContextBrowserView : public QWidget, public KDevelop::IToolViewActionListener { | ||
46 | Q_OBJECT | 47 | Q_OBJECT | ||
48 | Q_INTERFACES(KDevelop::IToolViewActionListener) | ||||
47 | public: | 49 | public: | ||
48 | ContextBrowserView( ContextBrowserPlugin*, QWidget* parent ); | 50 | ContextBrowserView( ContextBrowserPlugin*, QWidget* parent ); | ||
49 | ~ContextBrowserView() override; | 51 | ~ContextBrowserView() override; | ||
50 | 52 | | |||
51 | //duchain must be locked | 53 | //duchain must be locked | ||
52 | void setContext(KDevelop::DUContext* context); | 54 | void setContext(KDevelop::DUContext* context); | ||
53 | void setDeclaration(KDevelop::Declaration* decl, KDevelop::TopDUContext* topContext, bool force = false); | 55 | void setDeclaration(KDevelop::Declaration* decl, KDevelop::TopDUContext* topContext, bool force = false); | ||
54 | void setSpecialNavigationWidget(QWidget*); | 56 | void setSpecialNavigationWidget(QWidget*); | ||
Show All 22 Lines | |||||
77 | 79 | | |||
78 | ///Returns whether the view is currently locked | 80 | ///Returns whether the view is currently locked | ||
79 | bool isLocked() const; | 81 | bool isLocked() const; | ||
80 | 82 | | |||
81 | private Q_SLOTS: | 83 | private Q_SLOTS: | ||
82 | void updateLockIcon(bool); | 84 | void updateLockIcon(bool); | ||
83 | void declarationMenu(); | 85 | void declarationMenu(); | ||
84 | void navigationContextChanged(bool wasInitial, bool isInitial); | 86 | void navigationContextChanged(bool wasInitial, bool isInitial); | ||
87 | void selectNextItem() override; | ||||
88 | void selectPreviousItem() override; | ||||
85 | 89 | | |||
86 | private: | 90 | private: | ||
87 | void showEvent(QShowEvent* event) override; | 91 | void showEvent(QShowEvent* event) override; | ||
88 | bool event(QEvent* event) override; | 92 | bool event(QEvent* event) override; | ||
89 | 93 | | |||
90 | void focusInEvent(QFocusEvent* event) override; | 94 | void focusInEvent(QFocusEvent* event) override; | ||
91 | void focusOutEvent(QFocusEvent* event) override; | 95 | void focusOutEvent(QFocusEvent* event) override; | ||
92 | void resetWidget(); | 96 | void resetWidget(); | ||
93 | 97 | | |||
mwolff: const | |||||
94 | private: | 98 | private: | ||
const& the arg and move out of the class into a free function in an anon namespace in the .cpp file mwolff: const& the arg and move out of the class into a free function in an anon namespace in the .cpp… | |||||
95 | 99 | | |||
96 | KDevelop::IndexedDeclaration m_declaration; | 100 | KDevelop::IndexedDeclaration m_declaration; | ||
97 | 101 | | |||
98 | ContextBrowserPlugin* m_plugin; | 102 | ContextBrowserPlugin* m_plugin; | ||
99 | QVBoxLayout* m_layout; | 103 | QVBoxLayout* m_layout; | ||
100 | QAction* m_lockAction; | 104 | QAction* m_lockAction; | ||
101 | QAction* m_declarationMenuAction; | 105 | QAction* m_declarationMenuAction; | ||
102 | QHBoxLayout* m_buttons; | 106 | QHBoxLayout* m_buttons; | ||
Show All 12 Lines |
const