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

KDECore

  • kdecore
  • sonnet
spellerplugin.cpp
Go to the documentation of this file.
1// -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; -*-
21#include "spellerplugin_p.h"
22
23namespace Sonnet
24{
25
26class SpellerPlugin::Private
27{
28public:
29 QString language;
30};
31
32SpellerPlugin::SpellerPlugin(const QString &lang)
33 : d(new Private)
34{
35 d->language = lang;
36}
37
38SpellerPlugin::~SpellerPlugin()
39{
40 delete d;
41}
42
43QString SpellerPlugin::language() const
44{
45 return d->language;
46}
47
48bool SpellerPlugin::isMisspelled(const QString &word) const
49{
50 return !isCorrect(word);
51}
52
53bool SpellerPlugin::checkAndSuggest(const QString &word,
54 QStringList &suggestions) const
55{
56 bool c = isCorrect(word);
57 if (!c)
58 suggestions = suggest(word);
59 return c;
60}
61
62}
QStringList
QString
Sonnet::SpellerPlugin::checkAndSuggest
virtual bool checkAndSuggest(const QString &word, QStringList &suggestions) const
Convience method calling isCorrect() and suggest() if the word isn't correct.
Definition: spellerplugin.cpp:53
Sonnet::SpellerPlugin::SpellerPlugin
SpellerPlugin(const QString &lang)
Definition: spellerplugin.cpp:32
Sonnet::SpellerPlugin::suggest
virtual QStringList suggest(const QString &word) const =0
Fetches suggestions for the word.
Sonnet::SpellerPlugin::isMisspelled
bool isMisspelled(const QString &word) const
Checks the given word.
Definition: spellerplugin.cpp:48
Sonnet::SpellerPlugin::isCorrect
virtual bool isCorrect(const QString &word) const =0
Checks the given word.
Sonnet::SpellerPlugin::~SpellerPlugin
virtual ~SpellerPlugin()
Definition: spellerplugin.cpp:38
Sonnet::SpellerPlugin::language
QString language() const
Returns language supported by this dictionary.
Definition: spellerplugin.cpp:43
Sonnet
The sonnet namespace.
Definition: backgroundchecker.h:34
spellerplugin_p.h
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.

KDECore

Skip menu "KDECore"
  • 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