1/*
2 * SPDX-FileCopyrightText: 2003 Zack Rusin <zack@kde.org>
3 *
4 * SPDX-License-Identifier: LGPL-2.1-or-later
5 */
6#ifndef SONNET_SETTINGS_IMPL_P_H
7#define SONNET_SETTINGS_IMPL_P_H
8
9#include "sonnetcore_export.h"
10
11#include <QString>
12#include <QStringList>
13
14#include <memory>
15
16namespace Sonnet
17{
18class Loader;
19class SettingsImplPrivate;
20/**
21 * SettingsImpl class
22 */
23class SONNETCORE_EXPORT SettingsImpl
24{
25public:
26 ~SettingsImpl();
27
28 SettingsImpl(const SettingsImpl &) = delete;
29 SettingsImpl &operator=(const SettingsImpl &) = delete;
30
31 bool modified() const;
32 void setModified(bool modified);
33
34 bool setDefaultLanguage(const QString &lang);
35 QString defaultLanguage() const;
36
37 bool setPreferredLanguages(const QStringList &lang);
38 QStringList preferredLanguages() const;
39
40 bool setDefaultClient(const QString &client);
41 QString defaultClient() const;
42
43 bool setCheckUppercase(bool);
44 bool checkUppercase() const;
45
46 bool setAutodetectLanguage(bool);
47 bool autodetectLanguage() const;
48
49 bool setSkipRunTogether(bool);
50 bool skipRunTogether() const;
51
52 bool setBackgroundCheckerEnabled(bool);
53 bool backgroundCheckerEnabled() const;
54
55 bool setCheckerEnabledByDefault(bool);
56 bool checkerEnabledByDefault() const;
57
58 bool setCurrentIgnoreList(const QStringList &ignores);
59 bool addWordToIgnore(const QString &word);
60 QStringList currentIgnoreList() const;
61 bool ignore(const QString &word);
62
63 void save();
64 void restore();
65
66 int disablePercentageWordError() const;
67 int disableWordErrorCount() const;
68
69private:
70 SONNETCORE_NO_EXPORT bool setQuietIgnoreList(const QStringList &ignores);
71
72private:
73 friend class Loader;
74 SONNETCORE_NO_EXPORT explicit SettingsImpl(Loader *loader);
75
76private:
77 std::unique_ptr<SettingsImplPrivate> const d;
78};
79}
80
81#endif // SONNET_SETTINGS_IMPL_P_H
82

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