1/*
2 * SPDX-FileCopyrightText: 2003 Zack Rusin <zack@kde.org>
3 *
4 * SPDX-License-Identifier: LGPL-2.1-or-later
5 */
6#ifndef SONNET_CLIENT_P_H
7#define SONNET_CLIENT_P_H
8
9#include <QObject>
10#include <QString>
11#include <QStringList>
12
13#include "sonnetcore_export.h"
14/*
15 * The fact that this class inherits from QObject makes me
16 * hugely unhappy. The reason for as of this writing is that
17 * I don't really feel like writing my own KLibFactory
18 * that would load anything else then QObject derivatives.
19 */
20namespace Sonnet
21{
22class SpellerPlugin;
23
24/**
25 * \internal
26 * Client
27 */
28class SONNETCORE_EXPORT Client : public QObject
29{
30 Q_OBJECT
31public:
32 explicit Client(QObject *parent = nullptr);
33
34 /**
35 * @returns how reliable the answer is (higher is better).
36 */
37 virtual int reliability() const = 0;
38
39 /**
40 * Returns a dictionary for the given language.
41 *
42 * @param language specifies the language of the dictionary. If an
43 * empty string is passed the default language will be
44 * used. Has to be one of the values returned by
45 * languages()
46 *
47 * @returns a dictionary for the language or 0 if there was an error.
48 */
49 virtual SpellerPlugin *createSpeller(const QString &language) = 0;
50
51 /**
52 * @returns a list of supported languages.
53 */
54 virtual QStringList languages() const = 0;
55
56 /**
57 * @returns the name of the implementing class.
58 */
59 virtual QString name() const = 0;
60};
61}
62
63Q_DECLARE_INTERFACE(Sonnet::Client, "org.kde.sonnet.Client")
64
65#endif // SONNET_CLIENT_P_H
66

source code of sonnet/src/core/client_p.h