Kate
katewordcompletion.cpp
Go to the documentation of this file.
122 QModelIndex KateWordCompletionModel::index(int row, int column, const QModelIndex& parent) const
151 bool KateWordCompletionModel::shouldStartCompletion(KTextEditor::View* view, const QString &insertedText, bool userInsertion, const KTextEditor::Cursor &position)
181 bool KateWordCompletionModel::shouldAbortCompletion(KTextEditor::View* view, const KTextEditor::Range &range, const QString ¤tCompletion) {
188 return CodeCompletionModelControllerInterface4::shouldAbortCompletion(view,range,currentCompletion);
193 void KateWordCompletionModel::completionInvoked(KTextEditor::View* view, const KTextEditor::Range& range, InvocationType it)
205 QStringList KateWordCompletionModel::allMatches( KTextEditor::View *view, const KTextEditor::Range &range ) const
208 const int minWordSize = qMax(2, qobject_cast<KateView*>(view)->config()->wordCompletionMinimalWordLength());
219 if ( offset - wordBegin > minWordSize && ( line != range.end().line() || offset != range.end().column() ) ) {
255 int sizeDiff = m_matches.at(index.row()).size() - (word.end().column() - word.start().column());
275 KTextEditor::CodeCompletionModelControllerInterface3::MatchReaction KateWordCompletionModel::matchingItem(const QModelIndex& /*matched*/)
288 KTextEditor::Range KateWordCompletionModel::completionRange(KTextEditor::View* view, const KTextEditor::Cursor &position)
322 KateWordCompletionView::KateWordCompletionView( KTextEditor::View *view, KActionCollection* ac )
331 d->liRange = static_cast<KateDocument*>(m_view->document())->newMovingRange(KTextEditor::Range::invalid(), KTextEditor::MovingRange::DoNotExpand);
339 KTextEditor::CodeCompletionInterface *cci = qobject_cast<KTextEditor::CodeCompletionInterface *>(view);
366 KTextEditor::CodeCompletionInterface *cci = qobject_cast<KTextEditor::CodeCompletionInterface *>(m_view);
389 KTextEditor::CodeCompletionInterface *cci = qobject_cast<KTextEditor::CodeCompletionInterface *>( m_view );
422 connect( m_view, SIGNAL(cursorPositionChanged(KTextEditor::View*,KTextEditor::Cursor)), this, SLOT(slotCursorMoved()) );
472 connect( m_view, SIGNAL(cursorPositionChanged(KTextEditor::View*,KTextEditor::Cursor)), this, SLOT(slotCursorMoved()) );
491 if ( m != doc->text( *d->liRange ) && (d->dcCursor.line() != d->dcRange.start().line() || pos != d->dcRange.start().column() ) )
562 disconnect( m_view, SIGNAL(cursorPositionChanged(KTextEditor::View*,KTextEditor::Cursor)), this, SLOT(slotCursorMoved()) );
~KateWordCompletionModel()
Definition: katewordcompletion.cpp:74
bool isMark() const
static const int autoInvocationMaxFilesize
Amount of characters the document may have to enable automatic invocation (1MB)
Definition: katewordcompletion.cpp:65
QScriptValue i18n(QScriptContext *context, QScriptEngine *engine)
i18n("text", arguments [optional])
Definition: katescripthelpers.cpp:186
virtual void executeCompletionItem2(KTextEditor::Document *document, const KTextEditor::Range &word, const QModelIndex &index) const
Definition: katewordcompletion.cpp:233
QStringList allMatches(KTextEditor::View *view, const KTextEditor::Range &range) const
Scan throughout the entire document for possible completions, ignoring any dublets and words shorter ...
Definition: katewordcompletion.cpp:205
int wordCompletionMinimalWordLength() const
Definition: kateconfig.cpp:1936
const T & at(int i) const
int size() const
virtual KTextEditor::Range completionRange(KTextEditor::View *view, const KTextEditor::Cursor &position)
Definition: katewordcompletion.cpp:288
const_iterator insert(const T &value)
QString & remove(int position, int n)
qint64 internalId() const
bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *method)
KateWordCompletionModel(QObject *parent)
Definition: katewordcompletion.cpp:68
int size() const
~KateWordCompletionView()
Definition: katewordcompletion.cpp:364
bool isLetter() const
bool wordCompletionRemoveTail() const
Definition: kateconfig.cpp:1957
bool isValid() const
int count(const T &value) const
bool isSpace() const
QList< T > values() const
int rowCount(const QModelIndex &parent) const
Definition: katewordcompletion.cpp:140
bool isEmpty() const
bool isEmpty() const
int row() const
bool startsWith(const QString &s, Qt::CaseSensitivity cs) const
bool shouldStartCompletion(KTextEditor::View *view, const QString &insertedText, bool userInsertion, const KTextEditor::Cursor &position)
Definition: katewordcompletion.cpp:151
void completionInvoked(KTextEditor::View *view, const KTextEditor::Range &range, InvocationType invocationType)
This function is responsible to generating / updating the list of current completions.
Definition: katewordcompletion.cpp:193
T & first()
QModelIndex parent() const
Definition: kateview.h:77
void saveMatches(KTextEditor::View *view, const KTextEditor::Range &range)
Definition: katewordcompletion.cpp:78
Definition: katedocument.h:74
virtual QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const
Definition: katewordcompletion.cpp:122
QVariant data(const QModelIndex &index, int role) const
Definition: katewordcompletion.cpp:85
QString mid(int position, int n) const
const QChar at(int position) const
virtual bool shouldHideItemsWithEqualNames() const
When multiple completion models are used at the same time, it may happen that multiple models add ite...
Definition: katewordcompletion.cpp:280
int column() const
int length() const
KateGlobal One instance of this class is hold alive during a kate part session, as long as any factor...
Definition: kateglobal.h:71
void sort()
void editStart()
Enclose editor actions with editStart() and editEnd() to group them.
Definition: katedocument.cpp:776
virtual QModelIndex parent(const QModelIndex &index) const
Definition: katewordcompletion.cpp:114
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
virtual MatchReaction matchingItem(const QModelIndex &matched)
Definition: katewordcompletion.cpp:275
bool isNumber() const
KateWordCompletionView(KTextEditor::View *view, KActionCollection *ac)
Definition: katewordcompletion.cpp:322
bool shouldAbortCompletion(KTextEditor::View *view, const KTextEditor::Range &range, const QString ¤tCompletion)
Definition: katewordcompletion.cpp:181
bool isLetterOrNumber() const
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat May 9 2020 03:56:59 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat May 9 2020 03:56:59 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.