• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KDEUI

  • kdeui
  • sonnet
highlighter.h
Go to the documentation of this file.
1/*
2 * highlighter.h
3 *
4 * Copyright (C) 2004 Zack Rusin <zack@kde.org>
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19 * 02110-1301 USA
20 */
21#ifndef SONNET_HIGHLIGHTER_H
22#define SONNET_HIGHLIGHTER_H
23
24#include <QtGui/QSyntaxHighlighter>
25#include <QtCore/QStringList>
26#include <kdemacros.h>
27#include <kdeui_export.h>
28
29class QTextEdit;
30
31namespace Sonnet
32{
34 class KDEUI_EXPORT Highlighter : public QSyntaxHighlighter
35 {
36 Q_OBJECT
37 public:
38 explicit Highlighter(QTextEdit *textEdit,
39 const QString &configFile = QString(),
40 const QColor &col=QColor());
41 ~Highlighter();
42
43 bool spellCheckerFound() const;
44
45 QString currentLanguage() const;
46 void setCurrentLanguage(const QString &lang);
47
48 static QStringList personalWords();
49
63 void setActive(bool active);
64
72 bool isActive() const;
73
74 bool automatic() const;
75
76 void setAutomatic(bool automatic);
77
85 void addWordToDictionary(const QString &word);
86
95 void ignoreWord(const QString &word);
96
108 QStringList suggestionsForWord(const QString &word, int max = 10 );
109
117 bool isWordMisspelled(const QString &word);
118
123 void setMisspelledColor(const QColor &color);
124
129 bool checkerEnabledByDefault() const;
130
131 Q_SIGNALS:
132
139 void activeChanged(const QString &description);
140
149 QT_MOC_COMPAT void newSuggestions(const QString &originalWord, const QStringList &suggestions);
150
151 protected:
152
153 virtual void highlightBlock(const QString &text);
154 virtual void setMisspelled(int start, int count);
155 virtual void unsetMisspelled(int start, int count);
156
157 bool eventFilter(QObject *o, QEvent *e);
158 bool intraWordEditing() const;
159 void setIntraWordEditing(bool editing);
160
161 public Q_SLOTS:
162 void slotAutoDetection();
163 void slotRehighlight();
164 private:
165 virtual void connectNotify(const char* signal);
166 virtual void disconnectNotify(const char* signal);
167 class Private;
168 Private *const d;
169 Q_DISABLE_COPY( Highlighter )
170 };
171
172}
173
174#endif
QObject
QSyntaxHighlighter
QTextEdit
Sonnet::Highlighter
The Sonnet Highlighter.
Definition: highlighter.h:35
Sonnet::Highlighter::activeChanged
void activeChanged(const QString &description)
Emitted when as-you-type spell checking is enabled or disabled.
Sonnet::Highlighter::newSuggestions
QT_MOC_COMPAT void newSuggestions(const QString &originalWord, const QStringList &suggestions)
kdeui_export.h
Sonnet
dialog.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDEUI

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

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
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