Kate
#include <katewordcompletion.h>
Public Member Functions | |
KateWordCompletionModel (QObject *parent) | |
~KateWordCompletionModel () | |
QStringList | allMatches (KTextEditor::View *view, const KTextEditor::Range &range) const |
void | completionInvoked (KTextEditor::View *view, const KTextEditor::Range &range, InvocationType invocationType) |
virtual KTextEditor::Range | completionRange (KTextEditor::View *view, const KTextEditor::Cursor &position) |
QVariant | data (const QModelIndex &index, int role) const |
virtual void | executeCompletionItem2 (KTextEditor::Document *document, const KTextEditor::Range &word, const QModelIndex &index) const |
virtual QModelIndex | index (int row, int column, const QModelIndex &parent=QModelIndex()) const |
virtual MatchReaction | matchingItem (const QModelIndex &matched) |
virtual QModelIndex | parent (const QModelIndex &index) const |
int | rowCount (const QModelIndex &parent) const |
void | saveMatches (KTextEditor::View *view, const KTextEditor::Range &range) |
bool | shouldAbortCompletion (KTextEditor::View *view, const KTextEditor::Range &range, const QString ¤tCompletion) |
virtual bool | shouldHideItemsWithEqualNames () const |
bool | shouldStartCompletion (KTextEditor::View *view, const QString &insertedText, bool userInsertion, const KTextEditor::Cursor &position) |
Detailed Description
Definition at line 39 of file katewordcompletion.h.
Constructor & Destructor Documentation
KateWordCompletionModel::KateWordCompletionModel | ( | QObject * | parent | ) |
Definition at line 68 of file katewordcompletion.cpp.
KateWordCompletionModel::~KateWordCompletionModel | ( | ) |
Definition at line 74 of file katewordcompletion.cpp.
Member Function Documentation
QStringList KateWordCompletionModel::allMatches | ( | KTextEditor::View * | view, |
const KTextEditor::Range & | range | ||
) | const |
Scan throughout the entire document for possible completions, ignoring any dublets and words shorter than configured and/or reasonable minimum length.
Definition at line 205 of file katewordcompletion.cpp.
void KateWordCompletionModel::completionInvoked | ( | KTextEditor::View * | view, |
const KTextEditor::Range & | range, | ||
InvocationType | invocationType | ||
) |
This function is responsible to generating / updating the list of current completions.
The default implementation does nothing.
When implementing this function, remember to call setRowCount() (or implement rowCount()), and to generate the appropriate change notifications (for instance by calling QAbstractItemModel::reset()).
- Parameters
-
view The view to generate completions for range The range of text to generate completions for
Definition at line 193 of file katewordcompletion.cpp.
|
virtual |
Definition at line 288 of file katewordcompletion.cpp.
QVariant KateWordCompletionModel::data | ( | const QModelIndex & | index, |
int | role | ||
) | const |
Definition at line 85 of file katewordcompletion.cpp.
|
virtual |
- Todo:
- Introduce configurable word-separators??
Definition at line 233 of file katewordcompletion.cpp.
|
virtual |
Definition at line 122 of file katewordcompletion.cpp.
|
virtual |
Definition at line 275 of file katewordcompletion.cpp.
|
virtual |
Definition at line 114 of file katewordcompletion.cpp.
int KateWordCompletionModel::rowCount | ( | const QModelIndex & | parent | ) | const |
Definition at line 140 of file katewordcompletion.cpp.
void KateWordCompletionModel::saveMatches | ( | KTextEditor::View * | view, |
const KTextEditor::Range & | range | ||
) |
Definition at line 78 of file katewordcompletion.cpp.
bool KateWordCompletionModel::shouldAbortCompletion | ( | KTextEditor::View * | view, |
const KTextEditor::Range & | range, | ||
const QString & | currentCompletion | ||
) |
Definition at line 181 of file katewordcompletion.cpp.
|
virtual |
When multiple completion models are used at the same time, it may happen that multiple models add items with the same name to the list.
This option allows to hide items from this completion model when another model with higher priority contains items with the same name.
- Returns
- Whether items of this completion model should be hidden if another completion model has items with the same name
Reimplemented from KTextEditor::CodeCompletionModelControllerInterface4.
Definition at line 280 of file katewordcompletion.cpp.
bool KateWordCompletionModel::shouldStartCompletion | ( | KTextEditor::View * | view, |
const QString & | insertedText, | ||
bool | userInsertion, | ||
const KTextEditor::Cursor & | position | ||
) |
Definition at line 151 of file katewordcompletion.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat May 9 2020 03:57:02 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.