Sonnet

hspelldict.h
1 /*
2  * kspell_hspelldict.h
3  *
4  * SPDX-FileCopyrightText: 2003 Zack Rusin <[email protected]>
5  * SPDX-FileCopyrightText: 2005 Mashrab Kuvatov <[email protected]>
6  *
7  * SPDX-License-Identifier: LGPL-2.1-or-later
8  */
9 #ifndef KSPELL_HSPELLDICT_H
10 #define KSPELL_HSPELLDICT_H
11 
12 #include <QSet>
13 
14 #include "spellerplugin_p.h"
15 /* libhspell is a C library and it does not have #ifdef __cplusplus */
16 extern "C" {
17 #include "hspell.h"
18 }
19 
20 class QTextCodec;
21 
22 class HSpellDict : public Sonnet::SpellerPlugin
23 {
24 public:
25  explicit HSpellDict(const QString &lang);
26  ~HSpellDict();
27  bool isCorrect(const QString &word) const override;
28 
29  QStringList suggest(const QString &word) const override;
30 
31  bool storeReplacement(const QString &bad, const QString &good) override;
32 
33  bool addToPersonal(const QString &word) override;
34  bool addToSession(const QString &word) override;
35  inline bool isInitialized() const
36  {
37  return initialized;
38  }
39 
40 private:
41  void storePersonalWords();
42 
43  struct dict_radix *m_speller;
44  QTextCodec *codec;
45  bool initialized;
46  QSet<QString> m_sessionWords;
47  QSet<QString> m_personalWords;
48  QHash<QString, QString> m_replacements;
49 };
50 
51 #endif
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Sun Sep 25 2022 04:14:52 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.