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 | /// The sonnet ConfigWidget |
20 | class SONNETUI_EXPORT ConfigWidget : public QWidget |
21 | { |
22 | Q_OBJECT |
23 | public: |
24 | explicit ConfigWidget(QWidget *parent); |
25 | ~ConfigWidget() override; |
26 | |
27 | bool backgroundCheckingButtonShown() const; |
28 | |
29 | /** |
30 | * Sets the language/dictionary that will be selected by default |
31 | * in this config widget. |
32 | * This overrides the setting in the config file. |
33 | * |
34 | * @param language the language which will be selected by default. |
35 | * @since 4.1 |
36 | */ |
37 | void setLanguage(const QString &language); |
38 | |
39 | /** |
40 | * Get the currently selected language for spell checking. Returns an empty string if |
41 | * Sonnet was built without any spellchecking plugins. |
42 | * @return the language currently selected in the language combobox |
43 | * @since 4.1 |
44 | */ |
45 | QString language() const; |
46 | |
47 | public Q_SLOTS: |
48 | void save(); |
49 | void setBackgroundCheckingButtonShown(bool); |
50 | void slotDefault(); |
51 | protected Q_SLOTS: |
52 | void slotIgnoreWordRemoved(); |
53 | void slotIgnoreWordAdded(); |
54 | private Q_SLOTS: |
55 | SONNETUI_NO_EXPORT void slotUpdateButton(const QString &text); |
56 | SONNETUI_NO_EXPORT void slotSelectionChanged(); |
57 | |
58 | Q_SIGNALS: |
59 | /** |
60 | * Signal sends when config was changed |
61 | * @since 4.1 |
62 | */ |
63 | void configChanged(); |
64 | |
65 | private: |
66 | SONNETUI_NO_EXPORT void setFromGui(); |
67 | |
68 | private: |
69 | std::unique_ptr<ConfigWidgetPrivate> const d; |
70 | }; |
71 | } |
72 | |
73 | #endif |
74 | |