Kate
ontheflycheck.cpp
Go to the documentation of this file.
84 QPair<KTextEditor::Range, QString> KateOnTheFlyChecker::getMisspelledItem(const KTextEditor::Cursor &cursor) const
120 void KateOnTheFlyChecker::handleRespellCheckBlock(KateDocument *kateDocument, int start, int end)
138 void KateOnTheFlyChecker::textInserted(KTextEditor::Document *document, const KTextEditor::Range &range)
233 void KateOnTheFlyChecker::textRemoved(KTextEditor::Document *document, const KTextEditor::Range &range)
313 for(QList<KTextEditor::Range>::iterator i = rangesToReCheck.begin(); i != rangesToReCheck.end(); ++i) {
323 //FIXME: there is no currently no way of doing this better as we only get notifications for removals of
400 if(text.isEmpty()) { // passing an empty string to Sonnet can lead to a bad allocation exception
499 void KateOnTheFlyChecker::mouseEnteredRange(KTextEditor::MovingRange *range, KTextEditor::View *view)
505 void KateOnTheFlyChecker::mouseExitedRange(KTextEditor::MovingRange *range, KTextEditor::View *view)
515 void KateOnTheFlyChecker::caretEnteredRange(KTextEditor::MovingRange *range, KTextEditor::View *view)
521 void KateOnTheFlyChecker::caretExitedRange(KTextEditor::MovingRange *range, KTextEditor::View *view)
552 const QRegExp boundaryQuoteRegExp("\\b\\w+'\\w*$"); // handle spell checking of "isn't", "doesn't", etc.
560 const KTextEditor::Range startLineRange(startLine, 0, startLine, m_document->lineLength(startLine));
572 boundaryStart.setColumn(m_document->computePositionWrtOffsets(decToEncOffsetList, qMax(0, match)));
655 QList<KTextEditor::MovingRange*> KateOnTheFlyChecker::installedMovingRanges(const KTextEditor::Range& range)
697 connect(view, SIGNAL(displayRangeChanged(KateView*)), this, SLOT(restartViewRefreshTimer(KateView*)));
773 void KateOnTheFlyChecker::queueSpellCheckVisibleRange(KateView *view, const KTextEditor::Range& range)
802 const KTextEditor::Range range = KTextEditor::Range(line, 0, line, kateDocument->lineLength(line));
822 void KateOnTheFlyChecker::queueLineSpellCheck(const KTextEditor::Range& range, const QString& dictionary)
835 void KateOnTheFlyChecker::addToSpellCheckQueue(const KTextEditor::Range& range, const QString& dictionary)
840 void KateOnTheFlyChecker::addToSpellCheckQueue(KTextEditor::MovingRange *range, const QString& dictionary)
910 for(ModificationList::iterator i = m_modificationList.begin(); i != m_modificationList.end();) {
virtual void setFeedback(MovingRangeFeedback *feedback)=0
Cursor & start()
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:5254
void textInserted(KTextEditor::Document *document, const KTextEditor::Range &range)
Definition: ontheflycheck.cpp:138
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:4742
virtual int column() const =0
virtual void removeRangeFromEverything(KTextEditor::MovingRange *range)
Definition: ontheflycheck.cpp:421
virtual bool isValid() const
void setText(const QString &text)
void misspelling(const QString &word, int start)
Definition: ontheflycheck.cpp:600
int timeout
SpellCheckItem m_currentlyCheckedItem
Definition: ontheflycheck.h:78
KateDocument::OffsetList m_currentDecToEncOffsetList
Definition: ontheflycheck.h:82
void handleInsertedText(const KTextEditor::Range &range)
Definition: ontheflycheck.cpp:171
void removeView(KTextEditor::View *view)
Definition: ontheflycheck.cpp:708
void stopCurrentSpellCheck()
Definition: ontheflycheck.cpp:456
virtual void continueChecking()
void queueSpellCheckVisibleRange(const KTextEditor::Range &range)
Definition: ontheflycheck.cpp:765
KSharedConfigPtr config()
virtual void setAttributeOnlyForViews(bool onlyForViews)=0
virtual void stop()
bool contains(const Range &range) 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:5266
KTextEditor::Range findWordBoundaries(const KTextEditor::Cursor &begin, const KTextEditor::Cursor &end)
Definition: ontheflycheck.cpp:546
void handleModifiedRanges()
Definition: ontheflycheck.cpp:891
void updateInstalledMovingRanges(KateView *view)
Definition: ontheflycheck.cpp:714
ModificationList m_modificationList
Definition: ontheflycheck.h:81
bool rangesAdjacent(const KTextEditor::Range &r1, const KTextEditor::Range &r2)
Definition: ontheflycheck.cpp:266
static Range invalid()
void restore(KConfig *config)
void setSpeller(const Speller &speller)
static int registerArea(const QByteArray &areaName, bool enabled=true)
void addView(KTextEditor::Document *document, KTextEditor::View *view)
Definition: ontheflycheck.cpp:691
virtual KTextEditor::Cursor documentEnd() const
Definition: katedocument.cpp:4682
bool isEmpty() const
virtual Document * document() const =0
MovingRangeList installedMovingRanges(const KTextEditor::Range &range)
Definition: ontheflycheck.cpp:655
void handleRemovedText(const KTextEditor::Range &range)
Definition: ontheflycheck.cpp:271
virtual void setAttribute(Attribute::Ptr attribute)=0
void deleteMovingRanges(const QList< KTextEditor::MovingRange * > &list)
Definition: ontheflycheck.cpp:539
void deleteMovingRangeQuickly(KTextEditor::MovingRange *range)
Definition: ontheflycheck.cpp:882
virtual void mouseExitedRange(KTextEditor::MovingRange *range, KTextEditor::View *view)
Definition: ontheflycheck.cpp:505
void caretEnteredMisspelledRange(KTextEditor::MovingRange *range)
Definition: spellingmenu.cpp:112
Range documentRange() const
QList< SpellCheckItem > m_spellCheckQueue
Definition: ontheflycheck.h:76
Definition: kateview.h:78
QMap< KTextEditor::View *, KTextEditor::Range > m_displayRangeMap
Definition: ontheflycheck.h:83
void textRemoved(KTextEditor::Document *document, const KTextEditor::Range &range)
Definition: ontheflycheck.cpp:233
void refreshSpellCheck(const KTextEditor::Range &range=KTextEditor::Range::invalid())
Definition: ontheflycheck.cpp:680
Definition: katedocument.h:74
void restartViewRefreshTimer(KateView *view)
Definition: ontheflycheck.cpp:873
virtual bool expandToRange(const Range &range)
void mouseExitedMisspelledRange(KTextEditor::MovingRange *range)
Definition: spellingmenu.cpp:139
void handleRespellCheckBlock(KateDocument *document, int start, int end)
Definition: ontheflycheck.cpp:120
static const SpellCheckItem invalidSpellCheckQueueItem
Definition: ontheflycheck.h:79
virtual void caretExitedRange(KTextEditor::MovingRange *range, KTextEditor::View *view)
Definition: ontheflycheck.cpp:521
virtual int line() const
virtual const MovingCursor & start() const =0
virtual int line() const =0
virtual void setLine(int line)
void restore(KConfig *config)
void caretExitedMisspelledRange(KTextEditor::MovingRange *range)
Definition: spellingmenu.cpp:122
Cursor & end()
void clearMisspellingForWord(const QString &word)
Definition: ontheflycheck.cpp:106
KateOnTheFlyChecker(KateDocument *document)
Definition: ontheflycheck.cpp:40
bool containsLine(int line) 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:493
Range intersect(const Range &range) const
void queueLineSpellCheck(KateDocument *document, int line)
Definition: ontheflycheck.cpp:800
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:907
QString language() const
bool contains(const Range &range) const
virtual const MovingCursor & end() const =0
void clearModificationList()
Definition: ontheflycheck.cpp:924
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:515
bool isEmpty() const
void deleteMovingRange(KTextEditor::MovingRange *range)
Definition: ontheflycheck.cpp:527
void addToSpellCheckQueue(const KTextEditor::Range &range, const QString &dictionary)
Definition: ontheflycheck.cpp:835
virtual void rangeEmpty(KTextEditor::MovingRange *range)
Definition: ontheflycheck.cpp:487
virtual void setColumn(int column)
int column() const
void setLanguage(const QString &lang)
bool overlaps(const Range &range) const
virtual void mouseEnteredRange(KTextEditor::MovingRange *range, KTextEditor::View *view)
Definition: ontheflycheck.cpp:499
bool overlaps(const Range &range) const
bool removeRangeFromCurrentSpellCheck(KTextEditor::MovingRange *range)
Definition: ontheflycheck.cpp:446
bool removeRangeFromSpellCheckQueue(KTextEditor::MovingRange *range)
Definition: ontheflycheck.cpp:465
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:31:54 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:31:54 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.