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
15namespace Sonnet
16{
17class ConfigWidgetPrivate;
18
19/// The sonnet ConfigWidget
20class SONNETUI_EXPORT ConfigWidget : public QWidget
21{
22 Q_OBJECT
23public:
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
47public Q_SLOTS:
48 void save();
49 void setBackgroundCheckingButtonShown(bool);
50 void slotDefault();
51protected Q_SLOTS:
52 void slotIgnoreWordRemoved();
53 void slotIgnoreWordAdded();
54private Q_SLOTS:
55 SONNETUI_NO_EXPORT void slotUpdateButton(const QString &text);
56 SONNETUI_NO_EXPORT void slotSelectionChanged();
57
58Q_SIGNALS:
59 /**
60 * Signal sends when config was changed
61 * @since 4.1
62 */
63 void configChanged();
64
65private:
66 SONNETUI_NO_EXPORT void setFromGui();
67
68private:
69 std::unique_ptr<ConfigWidgetPrivate> const d;
70};
71}
72
73#endif
74

source code of sonnet/src/ui/configwidget.h