Sonnet

hunspelldict.h
1 /*
2  * kspell_aspelldict.h
3  *
4  * SPDX-FileCopyrightText: 2009 Montel Laurent <[email protected]>
5  *
6  * SPDX-License-Identifier: LGPL-2.1-or-later
7  */
8 #ifndef KSPELL_HUNSPELLDICT_H
9 #define KSPELL_HUNSPELLDICT_H
10 
11 #include "hunspell.hxx"
12 #include "spellerplugin_p.h"
13 
14 #include <memory>
15 
16 class QTextCodec;
17 
18 class HunspellDict : public Sonnet::SpellerPlugin
19 {
20 public:
21  explicit HunspellDict(const QString &name, const std::shared_ptr<Hunspell> &speller);
22  ~HunspellDict() override;
23  bool isCorrect(const QString &word) const override;
24 
25  QStringList suggest(const QString &word) const override;
26 
27  bool storeReplacement(const QString &bad, const QString &good) override;
28 
29  bool addToPersonal(const QString &word) override;
30  bool addToSession(const QString &word) override;
31 
32  static std::shared_ptr<Hunspell> createHunspell(const QString &lang, QString path);
33 
34 private:
35  QByteArray toDictEncoding(const QString &word) const;
36 
37  std::shared_ptr<Hunspell> m_speller;
38  QTextCodec *m_codec = nullptr;
39 };
40 
41 #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.