• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • applications API Reference
  • KDE Home
  • Contact Us
 

Kate

  • kde-4.14
  • applications
  • kate
  • part
  • spellcheck
spellcheck.h
Go to the documentation of this file.
1 /* This file is part of the KDE libraries and the Kate part.
2  *
3  * Copyright (C) 2008-2009 by Michel Ludwig <michel.ludwig@kdemail.net>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU Library General Public License
16  * along with this library; see the file COPYING.LIB. If not, write to
17  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  * Boston, MA 02110-1301, USA.
19  */
20 
21 #ifndef SPELLCHECK_H
22 #define SPELLCHECK_H
23 
24 #include <QList>
25 #include <QObject>
26 #include <QPair>
27 #include <QString>
28 
29 #include <ktexteditor/document.h>
30 #include <sonnet/backgroundchecker.h>
31 #include <sonnet/speller.h>
32 
33 class KateDocument;
34 class KateView;
35 
36 class KateSpellCheckManager : public QObject {
37  Q_OBJECT
38 
39  typedef QPair<KTextEditor::Range, QString> RangeDictionaryPair;
40 
41  public:
42  KateSpellCheckManager(QObject* parent = NULL);
43  virtual ~KateSpellCheckManager();
44 
45  QStringList suggestions(const QString& word, const QString& dictionary);
46 
47  void ignoreWord(const QString& word, const QString& dictionary);
48  void addToDictionary(const QString& word, const QString& dictionary);
49 
53  static QList<KTextEditor::Range> rangeDifference(const KTextEditor::Range& r1, const KTextEditor::Range& r2);
54 
55  public:
56  QList<QPair<KTextEditor::Range, QString> > spellCheckLanguageRanges(KateDocument *doc, const KTextEditor::Range& range);
57 
58  QList<QPair<KTextEditor::Range, QString> > spellCheckWrtHighlightingRanges(KateDocument *doc, const KTextEditor::Range& range,
59  const QString& dictionary = QString(),
60  bool singleLine = false,
61  bool returnSingleRange = false);
62  QList<QPair<KTextEditor::Range, QString> > spellCheckRanges(KateDocument *doc, const KTextEditor::Range& range,
63  bool singleLine = false);
64 
65  void replaceCharactersEncodedIfNecessary(const QString& newWord, KateDocument *doc, const KTextEditor::Range& replacementRange);
66 
67  private:
68  void trimRange(KateDocument *doc, KTextEditor::Range &r);
69 };
70 
71 #endif
72 
73 // kate: space-indent on; indent-width 2; replace-tabs on;
KateSpellCheckManager::~KateSpellCheckManager
virtual ~KateSpellCheckManager()
Definition: spellcheck.cpp:43
KateSpellCheckManager::rangeDifference
static QList< KTextEditor::Range > rangeDifference(const KTextEditor::Range &r1, const KTextEditor::Range &r2)
'r2' is a subrange of 'r1', which is extracted from 'r1' and the remaining ranges are returned ...
Definition: spellcheck.cpp:68
KateSpellCheckManager::spellCheckLanguageRanges
QList< QPair< KTextEditor::Range, QString > > spellCheckLanguageRanges(KateDocument *doc, const KTextEditor::Range &range)
Definition: spellcheck.cpp:92
QObject
KateSpellCheckManager::addToDictionary
void addToDictionary(const QString &word, const QString &dictionary)
Definition: spellcheck.cpp:61
KateSpellCheckManager
Definition: spellcheck.h:36
QString
QList
KateSpellCheckManager::suggestions
QStringList suggestions(const QString &word, const QString &dictionary)
Definition: spellcheck.cpp:47
QStringList
QPair
KateView
Definition: kateview.h:77
KateDocument
Definition: katedocument.h:74
KateSpellCheckManager::ignoreWord
void ignoreWord(const QString &word, const QString &dictionary)
Definition: spellcheck.cpp:54
KateSpellCheckManager::KateSpellCheckManager
KateSpellCheckManager(QObject *parent=NULL)
Definition: spellcheck.cpp:38
KateSpellCheckManager::spellCheckRanges
QList< QPair< KTextEditor::Range, QString > > spellCheckRanges(KateDocument *doc, const KTextEditor::Range &range, bool singleLine=false)
Definition: spellcheck.cpp:226
KateSpellCheckManager::spellCheckWrtHighlightingRanges
QList< QPair< KTextEditor::Range, QString > > spellCheckWrtHighlightingRanges(KateDocument *doc, const KTextEditor::Range &range, const QString &dictionary=QString(), bool singleLine=false, bool returnSingleRange=false)
Definition: spellcheck.cpp:129
QObject::parent
QObject * parent() const
KateSpellCheckManager::replaceCharactersEncodedIfNecessary
void replaceCharactersEncodedIfNecessary(const QString &newWord, KateDocument *doc, const KTextEditor::Range &replacementRange)
Definition: spellcheck.cpp:239
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

KDE's Doxygen guidelines are available online.

Kate

Skip menu "Kate"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

applications API Reference

Skip menu "applications API Reference"
  •   kate
  •       kate
  •   KTextEditor
  •   Kate
  • Konsole

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal