| 1 | /* |
| 2 | * |
| 3 | * SPDX-FileCopyrightText: 2004 Zack Rusin <zack@kde.org> |
| 4 | * |
| 5 | * SPDX-License-Identifier: LGPL-2.1-or-later |
| 6 | */ |
| 7 | #ifndef SONNET_CONFIGWIDGET_H |
| 8 | #define SONNET_CONFIGWIDGET_H |
| 9 | |
| 10 | #include "sonnetui_export.h" |
| 11 | #include <QWidget> |
| 12 | |
| 13 | #include <memory> |
| 14 | |
| 15 | namespace Sonnet |
| 16 | { |
| 17 | class ConfigWidgetPrivate; |
| 18 | |
| 19 | /*! |
| 20 | * \class Sonnet::ConfigWidget |
| 21 | * \inheaderfile Sonnet/ConfigWidget |
| 22 | * \inmodule SonnetUi |
| 23 | * |
| 24 | * \brief The sonnet ConfigWidget. |
| 25 | */ |
| 26 | class SONNETUI_EXPORT ConfigWidget : public QWidget |
| 27 | { |
| 28 | Q_OBJECT |
| 29 | public: |
| 30 | /*! |
| 31 | */ |
| 32 | explicit ConfigWidget(QWidget *parent); |
| 33 | ~ConfigWidget() override; |
| 34 | |
| 35 | /*! |
| 36 | */ |
| 37 | bool backgroundCheckingButtonShown() const; |
| 38 | |
| 39 | /*! |
| 40 | * Sets the language/dictionary that will be selected by default |
| 41 | * in this config widget. |
| 42 | * This overrides the setting in the config file. |
| 43 | * |
| 44 | * \a language the language which will be selected by default. |
| 45 | * \since 4.1 |
| 46 | */ |
| 47 | void setLanguage(const QString &language); |
| 48 | |
| 49 | /*! |
| 50 | * Get the currently selected language for spell checking. Returns an empty string if |
| 51 | * Sonnet was built without any spellchecking plugins. |
| 52 | * |
| 53 | * Returns the language currently selected in the language combobox |
| 54 | * \since 4.1 |
| 55 | */ |
| 56 | QString language() const; |
| 57 | |
| 58 | public Q_SLOTS: |
| 59 | /*! |
| 60 | */ |
| 61 | void save(); |
| 62 | /*! |
| 63 | */ |
| 64 | void setBackgroundCheckingButtonShown(bool); |
| 65 | /*! |
| 66 | */ |
| 67 | void slotDefault(); |
| 68 | protected Q_SLOTS: |
| 69 | /*! |
| 70 | */ |
| 71 | void slotIgnoreWordRemoved(); |
| 72 | /*! |
| 73 | */ |
| 74 | void slotIgnoreWordAdded(); |
| 75 | private Q_SLOTS: |
| 76 | SONNETUI_NO_EXPORT void slotUpdateButton(const QString &text); |
| 77 | SONNETUI_NO_EXPORT void slotSelectionChanged(); |
| 78 | |
| 79 | Q_SIGNALS: |
| 80 | /*! |
| 81 | * Signal sends when config was changed |
| 82 | * \since 4.1 |
| 83 | */ |
| 84 | void configChanged(); |
| 85 | |
| 86 | private: |
| 87 | SONNETUI_NO_EXPORT void setFromGui(); |
| 88 | |
| 89 | private: |
| 90 | std::unique_ptr<ConfigWidgetPrivate> const d; |
| 91 | }; |
| 92 | } |
| 93 | |
| 94 | #endif |
| 95 | |