Kate
spellcheck.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef SPELLCHECK_H
00021 #define SPELLCHECK_H
00022
00023 #include <QList>
00024 #include <QObject>
00025 #include <QPair>
00026 #include <QString>
00027
00028 #include <ktexteditor/document.h>
00029 #include <sonnet/backgroundchecker.h>
00030 #include <sonnet/speller.h>
00031
00032 class KateDocument;
00033 class KateView;
00034
00035 class KateSpellCheckManager : public QObject {
00036 Q_OBJECT
00037
00038 typedef QPair<KTextEditor::Range, QString> RangeDictionaryPair;
00039
00040 public:
00041 KateSpellCheckManager(QObject* parent = NULL);
00042 virtual ~KateSpellCheckManager();
00043
00044 QStringList suggestions(const QString& word, const QString& dictionary);
00045
00046 void ignoreWord(const QString& word, const QString& dictionary);
00047 void addToDictionary(const QString& word, const QString& dictionary);
00048
00052 static QList<KTextEditor::Range> rangeDifference(const KTextEditor::Range& r1, const KTextEditor::Range& r2);
00053
00054 public:
00055 QList<QPair<KTextEditor::Range, QString> > spellCheckLanguageRanges(KateDocument *doc, const KTextEditor::Range& range);
00056
00057 QList<QPair<KTextEditor::Range, QString> > spellCheckWrtHighlightingRanges(KateDocument *doc, const KTextEditor::Range& range,
00058 const QString& dictionary = QString(),
00059 bool singleLine = false,
00060 bool returnSingleRange = false);
00061 QList<QPair<KTextEditor::Range, QString> > spellCheckRanges(KateDocument *doc, const KTextEditor::Range& range,
00062 bool singleLine = false);
00063
00064 void replaceCharactersEncodedIfNecessary(const QString& newWord, KateDocument *doc, const KTextEditor::Range& replacementRange);
00065 };
00066
00067 #endif
00068
00069