Sonnet

voikkodict.h
1/*
2 * voikkodict.h
3 *
4 * SPDX-FileCopyrightText: 2015 Jesse Jaara <jesse.jaara@gmail.com>
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
18class VoikkoClient;
19class VoikkoDictPrivate;
20
21class VoikkoDict : public Sonnet::SpellerPlugin
22{
23public:
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
43protected:
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
50private:
51 QScopedPointer<VoikkoDictPrivate> d;
52};
53
54#endif // SONNET_VOIKKODICT_H
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:15:10 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.