18#include <sonnet/speller.h>
20#include "katedocument.h"
24class BackgroundChecker;
29 enum ModificationType { TEXT_INSERTED = 0, TEXT_REMOVED };
31 typedef QPair<KTextEditor::MovingRange *, QString> SpellCheckItem;
33 typedef QPair<KTextEditor::MovingRange *, QString> MisspelledItem;
36 typedef QPair<ModificationType, KTextEditor::MovingRange *> ModificationItem;
40 explicit KateOnTheFlyChecker(KTextEditor::DocumentPrivate *document);
41 ~KateOnTheFlyChecker()
override;
43 QPair<KTextEditor::Range, QString> getMisspelledItem(
const KTextEditor::Cursor cursor)
const;
47 void clearMisspellingForWord(
const QString &word);
56 void updateInstalledMovingRanges(KTextEditor::ViewPrivate *view);
59 KTextEditor::DocumentPrivate *
const m_document;
63 SpellCheckItem m_currentlyCheckedItem;
64 MisspelledList m_misspelledList;
65 ModificationList m_modificationList;
66 KTextEditor::DocumentPrivate::OffsetList m_currentDecToEncOffsetList;
67 std::map<KTextEditor::View *, KTextEditor::Range> m_displayRangeMap;
71 void queueLineSpellCheck(KTextEditor::DocumentPrivate *document,
int line);
77 void queueSpellCheckVisibleRange(KTextEditor::ViewPrivate *view,
KTextEditor::Range range);
82 QTimer *m_viewRefreshTimer;
98 void stopCurrentSpellCheck();
101 void performSpellCheck();
102 void addToDictionary(
const QString &word);
103 void addToSession(
const QString &word);
105 void spellCheckDone();
107 void viewDestroyed(
QObject *obj);
111 void restartViewRefreshTimer(KTextEditor::ViewPrivate *view);
112 void viewRefreshTimeout();
114 void handleModifiedRanges();
117 void handleRespellCheckBlock(
int start,
int end);
119 void clearModificationList();
The Cursor represents a position in a Document.
A KParts derived class representing a text document.
A class which provides notifications of state changes to a MovingRange.
A range that is bound to a specific Document, and maintains its position.
An object representing a section of text, from one Cursor to another.
static constexpr Range invalid() noexcept
Returns an invalid range.
A text widget with KXMLGUIClient that represents a Document.
Q_SCRIPTABLE Q_NOREPLY void start()