Sonnet

hspelldict.h
1/*
2 * kspell_hspelldict.h
3 *
4 * SPDX-FileCopyrightText: 2003 Zack Rusin <zack@kde.org>
5 * SPDX-FileCopyrightText: 2005 Mashrab Kuvatov <kmashrab@uni-bremen.de>
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#include <QStringDecoder>
14#include <QStringEncoder>
15
16#include "spellerplugin_p.h"
17/* libhspell is a C library and it does not have #ifdef __cplusplus */
18extern "C" {
19#include "hspell.h"
20}
21
22class HSpellDict : public Sonnet::SpellerPlugin
23{
24public:
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
40private:
41 void storePersonalWords();
42
43 struct dict_radix *m_speller;
44 mutable QStringDecoder m_decoder;
45 mutable QStringEncoder m_encoder;
46 bool initialized;
47 QSet<QString> m_sessionWords;
48 QSet<QString> m_personalWords;
49 QHash<QString, QString> m_replacements;
50};
51
52#endif
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 29 2024 11:46:56 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.