Changeset View
Changeset View
Standalone View
Standalone View
kdevplatform/language/codecompletion/codecompletionmodel.h
Show First 20 Lines • Show All 79 Lines • ▼ Show 20 Line(s) | 54 | public: | |||
---|---|---|---|---|---|
80 | ///Convenience-storage for use by the inherited completion model | 80 | ///Convenience-storage for use by the inherited completion model | ||
81 | void setCompletionContext(QExplicitlySharedDataPointer<CodeCompletionContext> completionContext); | 81 | void setCompletionContext(QExplicitlySharedDataPointer<CodeCompletionContext> completionContext); | ||
82 | QExplicitlySharedDataPointer<CodeCompletionContext> completionContext() const; | 82 | QExplicitlySharedDataPointer<CodeCompletionContext> completionContext() const; | ||
83 | 83 | | |||
84 | ///Convenience-storage for use by the inherited completion model | 84 | ///Convenience-storage for use by the inherited completion model | ||
85 | KDevelop::TopDUContextPointer currentTopContext() const; | 85 | KDevelop::TopDUContextPointer currentTopContext() const; | ||
86 | void setCurrentTopContext(const KDevelop::TopDUContextPointer& topContext); | 86 | void setCurrentTopContext(const KDevelop::TopDUContextPointer& topContext); | ||
87 | 87 | | |||
88 | ///Tracks navigation widget so they can be interactive with through the keyboard later on | | |||
89 | void addNavigationWidget(const CompletionTreeElement* element, QWidget* widget) const; | | |||
90 | | ||||
91 | ///Whether the completion should be fully detailed. If false, it should be simplifed, so no argument-hints, | 88 | ///Whether the completion should be fully detailed. If false, it should be simplifed, so no argument-hints, | ||
92 | ///no expanding information, no type-information, etc. | 89 | ///no expanding information, no type-information, etc. | ||
93 | bool fullCompletion() const; | 90 | bool fullCompletion() const; | ||
94 | 91 | | |||
95 | MatchReaction matchingItem(const QModelIndex& matched) override; | 92 | MatchReaction matchingItem(const QModelIndex& matched) override; | ||
96 | 93 | | |||
97 | QString filterString(KTextEditor::View* view, const KTextEditor::Range& range, const KTextEditor::Cursor& position) override; | 94 | QString filterString(KTextEditor::View* view, const KTextEditor::Range& range, const KTextEditor::Cursor& position) override; | ||
98 | 95 | | |||
Show All 19 Lines | 113 | protected: | |||
118 | ///The default-implementation does this completely, so if you don't need to do anything special, you can just leave it. | 115 | ///The default-implementation does this completely, so if you don't need to do anything special, you can just leave it. | ||
119 | virtual void completionInvokedInternal(KTextEditor::View* view, const KTextEditor::Range& range, KTextEditor::CodeCompletionModel::InvocationType invocationType, const QUrl& url); | 116 | virtual void completionInvokedInternal(KTextEditor::View* view, const KTextEditor::Range& range, KTextEditor::CodeCompletionModel::InvocationType invocationType, const QUrl& url); | ||
120 | 117 | | |||
121 | void executeCompletionItem(KTextEditor::View* view, const KTextEditor::Range& word, const QModelIndex& index) const override; | 118 | void executeCompletionItem(KTextEditor::View* view, const KTextEditor::Range& word, const QModelIndex& index) const override; | ||
122 | 119 | | |||
123 | QExplicitlySharedDataPointer<CodeCompletionContext> m_completionContext; | 120 | QExplicitlySharedDataPointer<CodeCompletionContext> m_completionContext; | ||
124 | typedef QPair<KDevelop::DeclarationPointer, QExplicitlySharedDataPointer<CodeCompletionContext> > DeclarationContextPair; | 121 | typedef QPair<KDevelop::DeclarationPointer, QExplicitlySharedDataPointer<CodeCompletionContext> > DeclarationContextPair; | ||
125 | 122 | | |||
126 | mutable QMap<const CompletionTreeElement*, QPointer<QWidget> > m_navigationWidgets; | | |||
127 | QList< QExplicitlySharedDataPointer<CompletionTreeElement> > m_completionItems; | 123 | QList< QExplicitlySharedDataPointer<CompletionTreeElement> > m_completionItems; | ||
128 | 124 | | |||
129 | /// Should create a completion-worker. The worker must have no parent object, | 125 | /// Should create a completion-worker. The worker must have no parent object, | ||
130 | /// because else its thread-affinity can not be changed. | 126 | /// because else its thread-affinity can not be changed. | ||
131 | virtual CodeCompletionWorker* createCompletionWorker() = 0; | 127 | virtual CodeCompletionWorker* createCompletionWorker() = 0; | ||
132 | friend class CompletionWorkerThread; | 128 | friend class CompletionWorkerThread; | ||
133 | 129 | | |||
134 | CodeCompletionWorker* worker() const; | 130 | CodeCompletionWorker* worker() const; | ||
Show All 14 Lines |