Sonnet

voikkodict.h
1 /*
2  * voikkodict.h
3  *
4  * SPDX-FileCopyrightText: 2015 Jesse Jaara <[email protected]>
5  *
6  * SPDX-License-Identifier: LGPL-2.1-or-later
7  */
8 
9 #ifndef SONNET_VOIKKODICT_H
10 #define SONNET_VOIKKODICT_H
11 
12 #include "spellerplugin_p.h"
13 #include <libvoikko/voikko.h>
14 
15 #include <QHash>
16 #include <QScopedPointer>
17 
18 class VoikkoClient;
19 class VoikkoDictPrivate;
20 
21 class VoikkoDict : public Sonnet::SpellerPlugin
22 {
23 public:
24  /**
25  * Declare VoikkoClient as friend so we can use the protected constructor.
26  */
27  friend class VoikkoClient;
28 
29  ~VoikkoDict();
30 
31  bool isCorrect(const QString &word) const override;
32  QStringList suggest(const QString &word) const override;
33 
34  bool storeReplacement(const QString &bad, const QString &good) override;
35  bool addToPersonal(const QString &word) override;
36  bool addToSession(const QString &word) override;
37 
38  /**
39  * @returns true if initializing Voikko backend failed.
40  */
41  bool initFailed() const Q_DECL_NOEXCEPT;
42 
43 protected:
44  /**
45  * Constructor is protected so that only spellers created
46  * and validated through VoikkoClient can be used.
47  */
48  explicit VoikkoDict(const QString &language) Q_DECL_NOEXCEPT;
49 
50 private:
51  QScopedPointer<VoikkoDictPrivate> d;
52 };
53 
54 #endif // SONNET_VOIKKODICT_H
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.