Kate
ontheflycheck.cpp
Go to the documentation of this file.
84 QPair<KTextEditor::Range, QString> KateOnTheFlyChecker::getMisspelledItem(const KTextEditor::Cursor &cursor) const
135 void KateOnTheFlyChecker::textInserted(KTextEditor::Document *document, const KTextEditor::Range &range)
230 void KateOnTheFlyChecker::textRemoved(KTextEditor::Document *document, const KTextEditor::Range &range)
310 for(QList<KTextEditor::Range>::iterator i = rangesToReCheck.begin(); i != rangesToReCheck.end(); ++i) {
320 //FIXME: there is no currently no way of doing this better as we only get notifications for removals of
397 if(text.isEmpty()) { // passing an empty string to Sonnet can lead to a bad allocation exception
496 void KateOnTheFlyChecker::mouseEnteredRange(KTextEditor::MovingRange *range, KTextEditor::View *view)
502 void KateOnTheFlyChecker::mouseExitedRange(KTextEditor::MovingRange *range, KTextEditor::View *view)
512 void KateOnTheFlyChecker::caretEnteredRange(KTextEditor::MovingRange *range, KTextEditor::View *view)
518 void KateOnTheFlyChecker::caretExitedRange(KTextEditor::MovingRange *range, KTextEditor::View *view)
549 const QRegExp boundaryQuoteRegExp("\\b\\w+'\\w*$"); // handle spell checking of "isn't", "doesn't", etc.
557 const KTextEditor::Range startLineRange(startLine, 0, startLine, m_document->lineLength(startLine));
569 boundaryStart.setColumn(m_document->computePositionWrtOffsets(decToEncOffsetList, qMax(0, match)));
652 QList<KTextEditor::MovingRange*> KateOnTheFlyChecker::installedMovingRanges(const KTextEditor::Range& range)
694 connect(view, SIGNAL(displayRangeChanged(KateView*)), this, SLOT(restartViewRefreshTimer(KateView*)));
770 void KateOnTheFlyChecker::queueSpellCheckVisibleRange(KateView *view, const KTextEditor::Range& range)
799 const KTextEditor::Range range = KTextEditor::Range(line, 0, line, kateDocument->lineLength(line));
819 void KateOnTheFlyChecker::queueLineSpellCheck(const KTextEditor::Range& range, const QString& dictionary)
832 void KateOnTheFlyChecker::addToSpellCheckQueue(const KTextEditor::Range& range, const QString& dictionary)
837 void KateOnTheFlyChecker::addToSpellCheckQueue(KTextEditor::MovingRange *range, const QString& dictionary)
907 for(ModificationList::iterator i = m_modificationList.begin(); i != m_modificationList.end();) {
void clear()
QString dictionaryForMisspelledRange(const KTextEditor::Range &range) const
Definition: ontheflycheck.cpp:95
QPair< KTextEditor::Range, QString > getMisspelledItem(const KTextEditor::Cursor &cursor) const
Definition: ontheflycheck.cpp:84
int computePositionWrtOffsets(const OffsetList &offsetList, int pos)
Definition: katedocument.cpp:5248
void textInserted(KTextEditor::Document *document, const KTextEditor::Range &range)
Definition: ontheflycheck.cpp:135
virtual KTextEditor::MovingRange * newMovingRange(const KTextEditor::Range &range, KTextEditor::MovingRange::InsertBehaviors insertBehaviors=KTextEditor::MovingRange::DoNotExpand, KTextEditor::MovingRange::EmptyBehavior emptyBehavior=KTextEditor::MovingRange::AllowEmpty)
Create a new moving range for this document.
Definition: katedocument.cpp:4741
virtual void removeRangeFromEverything(KTextEditor::MovingRange *range)
Definition: ontheflycheck.cpp:418
void push_back(const T &value)
const T & previous()
void misspelling(const QString &word, int start)
Definition: ontheflycheck.cpp:597
SpellCheckItem m_currentlyCheckedItem
Definition: ontheflycheck.h:78
KateDocument::OffsetList m_currentDecToEncOffsetList
Definition: ontheflycheck.h:82
void handleInsertedText(const KTextEditor::Range &range)
Definition: ontheflycheck.cpp:168
void removeView(KTextEditor::View *view)
Definition: ontheflycheck.cpp:705
void stopCurrentSpellCheck()
Definition: ontheflycheck.cpp:453
iterator erase(iterator pos)
void queueSpellCheckVisibleRange(const KTextEditor::Range &range)
Definition: ontheflycheck.cpp:762
int lastIndexOf(QChar ch, int from, Qt::CaseSensitivity cs) const
int matchedLength() const
int indexIn(const QString &str, int offset, CaretMode caretMode) const
Sonnet::BackgroundChecker * m_backgroundChecker
Definition: ontheflycheck.h:77
QString decodeCharacters(const KTextEditor::Range &range, KateDocument::OffsetList &decToEncOffsetList, KateDocument::OffsetList &encToDecOffsetList)
The first OffsetList is from decoded to encoded, and the second OffsetList from encoded to decoded...
Definition: katedocument.cpp:5260
KTextEditor::Range findWordBoundaries(const KTextEditor::Cursor &begin, const KTextEditor::Cursor &end)
Definition: ontheflycheck.cpp:543
void handleModifiedRanges()
Definition: ontheflycheck.cpp:888
void updateInstalledMovingRanges(KateView *view)
Definition: ontheflycheck.cpp:711
ModificationList m_modificationList
Definition: ontheflycheck.h:81
bool rangesAdjacent(const KTextEditor::Range &r1, const KTextEditor::Range &r2)
Definition: ontheflycheck.cpp:263
bool isEmpty() const
void addView(KTextEditor::Document *document, KTextEditor::View *view)
Definition: ontheflycheck.cpp:688
virtual KTextEditor::Cursor documentEnd() const
Definition: katedocument.cpp:4681
MovingRangeList installedMovingRanges(const KTextEditor::Range &range)
Definition: ontheflycheck.cpp:652
void handleRemovedText(const KTextEditor::Range &range)
Definition: ontheflycheck.cpp:268
void toBack()
void deleteMovingRanges(const QList< KTextEditor::MovingRange * > &list)
Definition: ontheflycheck.cpp:536
void deleteMovingRangeQuickly(KTextEditor::MovingRange *range)
Definition: ontheflycheck.cpp:879
virtual void mouseExitedRange(KTextEditor::MovingRange *range, KTextEditor::View *view)
Definition: ontheflycheck.cpp:502
T & first()
void caretEnteredMisspelledRange(KTextEditor::MovingRange *range)
Definition: spellingmenu.cpp:112
QList< SpellCheckItem > m_spellCheckQueue
Definition: ontheflycheck.h:76
Definition: kateview.h:77
QMap< KTextEditor::View *, KTextEditor::Range > m_displayRangeMap
Definition: ontheflycheck.h:83
void textRemoved(KTextEditor::Document *document, const KTextEditor::Range &range)
Definition: ontheflycheck.cpp:230
iterator end()
void refreshSpellCheck(const KTextEditor::Range &range=KTextEditor::Range::invalid())
Definition: ontheflycheck.cpp:677
Definition: katedocument.h:74
void restartViewRefreshTimer(KateView *view)
Definition: ontheflycheck.cpp:870
void mouseExitedMisspelledRange(KTextEditor::MovingRange *range)
Definition: spellingmenu.cpp:139
static const SpellCheckItem invalidSpellCheckQueueItem
Definition: ontheflycheck.h:79
virtual void caretExitedRange(KTextEditor::MovingRange *range, KTextEditor::View *view)
Definition: ontheflycheck.cpp:518
void handleRespellCheckBlock(int start, int end)
Definition: ontheflycheck.cpp:120
bool hasPrevious() const
QString mid(int position, int n) const
void caretExitedMisspelledRange(KTextEditor::MovingRange *range)
Definition: spellingmenu.cpp:122
void clearMisspellingForWord(const QString &word)
Definition: ontheflycheck.cpp:106
KateOnTheFlyChecker(KateDocument *document)
Definition: ontheflycheck.cpp:40
int length() const
virtual const QList< KTextEditor::View * > & views() const
Definition: katedocument.cpp:309
virtual QString text(const KTextEditor::Range &range, bool blockwise=false) const
Definition: katedocument.cpp:337
virtual void rangeInvalid(KTextEditor::MovingRange *range)
Definition: ontheflycheck.cpp:490
void queueLineSpellCheck(KateDocument *document, int line)
Definition: ontheflycheck.cpp:797
void start(int msec)
void mouseEnteredMisspelledRange(KTextEditor::MovingRange *range)
Definition: spellingmenu.cpp:131
QList< QPair< KTextEditor::Range, QString > > spellCheckRanges(KateDocument *doc, const KTextEditor::Range &range, bool singleLine=false)
Definition: spellcheck.cpp:226
bool removeRangeFromModificationList(KTextEditor::MovingRange *range)
Definition: ontheflycheck.cpp:904
void clearModificationList()
Definition: ontheflycheck.cpp:921
virtual void caretEnteredRange(KTextEditor::MovingRange *range, KTextEditor::View *view)
It is not enough to use 'caret/Entered/ExitedRange' only as the cursor doesn't move when some text ha...
Definition: ontheflycheck.cpp:512
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
void deleteMovingRange(KTextEditor::MovingRange *range)
Definition: ontheflycheck.cpp:524
void addToSpellCheckQueue(const KTextEditor::Range &range, const QString &dictionary)
Definition: ontheflycheck.cpp:832
virtual void rangeEmpty(KTextEditor::MovingRange *range)
Definition: ontheflycheck.cpp:484
iterator begin()
virtual void mouseEnteredRange(KTextEditor::MovingRange *range, KTextEditor::View *view)
Definition: ontheflycheck.cpp:496
void destroyed(QObject *obj)
bool removeRangeFromCurrentSpellCheck(KTextEditor::MovingRange *range)
Definition: ontheflycheck.cpp:443
int remove(const Key &key)
void setSingleShot(bool singleShot)
bool removeRangeFromSpellCheckQueue(KTextEditor::MovingRange *range)
Definition: ontheflycheck.cpp:462
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.