File indexing completed on 2024-04-28 15:34:19

0001 /*
0002  * SPDX-FileCopyrightText: 2003 Zack Rusin <zack@kde.org>
0003  *
0004  * SPDX-License-Identifier: LGPL-2.1-or-later
0005  */
0006 #ifndef SONNET_SETTINGS_IMPL_P_H
0007 #define SONNET_SETTINGS_IMPL_P_H
0008 
0009 #include "sonnetcore_export.h"
0010 
0011 #include <QString>
0012 #include <QStringList>
0013 
0014 namespace Sonnet
0015 {
0016 class Loader;
0017 class SettingsImplPrivate;
0018 /**
0019  * SettingsImpl class
0020  */
0021 class SONNETCORE_EXPORT SettingsImpl
0022 {
0023 public:
0024     ~SettingsImpl();
0025 
0026     SettingsImpl(const SettingsImpl &) = delete;
0027     SettingsImpl &operator=(const SettingsImpl &) = delete;
0028 
0029     bool modified() const;
0030     void setModified(bool modified);
0031 
0032     bool setDefaultLanguage(const QString &lang);
0033     QString defaultLanguage() const;
0034 
0035     bool setPreferredLanguages(const QStringList &lang);
0036     QStringList preferredLanguages() const;
0037 
0038     bool setDefaultClient(const QString &client);
0039     QString defaultClient() const;
0040 
0041     bool setCheckUppercase(bool);
0042     bool checkUppercase() const;
0043 
0044     bool setAutodetectLanguage(bool);
0045     bool autodetectLanguage() const;
0046 
0047     bool setSkipRunTogether(bool);
0048     bool skipRunTogether() const;
0049 
0050     bool setBackgroundCheckerEnabled(bool);
0051     bool backgroundCheckerEnabled() const;
0052 
0053     bool setCheckerEnabledByDefault(bool);
0054     bool checkerEnabledByDefault() const;
0055 
0056     bool setCurrentIgnoreList(const QStringList &ignores);
0057     bool addWordToIgnore(const QString &word);
0058     QStringList currentIgnoreList() const;
0059     bool ignore(const QString &word);
0060 
0061     void save();
0062     void restore();
0063 
0064     int disablePercentageWordError() const;
0065     int disableWordErrorCount() const;
0066 
0067 private:
0068     SONNETCORE_NO_EXPORT bool setQuietIgnoreList(const QStringList &ignores);
0069 
0070 private:
0071     friend class Loader;
0072     SONNETCORE_NO_EXPORT explicit SettingsImpl(Loader *loader);
0073 
0074 private:
0075     SettingsImplPrivate *const d;
0076 };
0077 }
0078 
0079 #endif // SONNET_SETTINGS_IMPL_P_H