KTextEditor

katekeywordcompletion.h
1 /*
2  SPDX-FileCopyrightText: 2014 Sven Brauch <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #ifndef KATEKEYWORDCOMPLETIONMODEL_H
8 #define KATEKEYWORDCOMPLETIONMODEL_H
9 
10 #include "codecompletionmodelcontrollerinterface.h"
11 #include "ktexteditor/codecompletionmodel.h"
12 
22 {
23  Q_OBJECT
25 
26 public:
28  QVariant data(const QModelIndex &index, int role) const override;
29  int rowCount(const QModelIndex &parent = QModelIndex()) const override;
30  QModelIndex parent(const QModelIndex &index) const override;
31  QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override;
32  void completionInvoked(KTextEditor::View *view, const KTextEditor::Range &range, InvocationType invocationType) override;
34  bool shouldAbortCompletion(KTextEditor::View *view, const KTextEditor::Range &range, const QString &currentCompletion) override;
35  bool shouldStartCompletion(KTextEditor::View *view, const QString &insertedText, bool userInsertion, const KTextEditor::Cursor &position) override;
36  MatchReaction matchingItem(const QModelIndex &matched) override;
37  bool shouldHideItemsWithEqualNames() const override;
38 
39 private:
40  QList<QString> m_items;
41 };
42 
43 #endif // KATEKEYWORDCOMPLETIONMODEL_H
44 
45 // kate: indent-width 4; replace-tabs on
KTextEditor::Range completionRange(KTextEditor::View *view, const KTextEditor::Cursor &position) override
This function returns the completion range that will be used for the current completion.
bool shouldHideItemsWithEqualNames() const override
When multiple completion models are used at the same time, it may happen that multiple models add ite...
The Cursor represents a position in a Document.
Definition: cursor.h:71
void completionInvoked(KTextEditor::View *view, const KTextEditor::Range &range, InvocationType invocationType) override
This function is responsible to generating / updating the list of current completions.
Q_OBJECTQ_OBJECT
bool shouldAbortCompletion(KTextEditor::View *view, const KTextEditor::Range &range, const QString &currentCompletion) override
This function decides if the completion should be aborted.
MatchReaction matchingItem(const QModelIndex &matched) override
Called whenever an item in the completion-list perfectly matches the current filter text...
bool shouldStartCompletion(KTextEditor::View *view, const QString &insertedText, bool userInsertion, const KTextEditor::Cursor &position) override
This function decides if the automatic completion should be started when the user entered some text...
An object representing a section of text, from one Cursor to another.
Q_INTERFACES(...)
Highlighting-file based keyword completion for the editor.
A text widget with KXMLGUIClient that represents a Document.
Definition: view.h:143
QObject * parent() const const
An item model for providing code completion, and meta information for enhanced presentation.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Tue Sep 29 2020 23:05:10 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.