1 | /* |
2 | * configdialog.h |
3 | * |
4 | * SPDX-FileCopyrightText: 2004 Zack Rusin <zack@kde.org> |
5 | * |
6 | * SPDX-License-Identifier: LGPL-2.1-or-later |
7 | */ |
8 | #ifndef SONNET_CONFIGDIALOG_H |
9 | #define SONNET_CONFIGDIALOG_H |
10 | |
11 | #include "sonnetui_export.h" |
12 | #include <QDialog> |
13 | |
14 | #include <memory> |
15 | |
16 | namespace Sonnet |
17 | { |
18 | class ConfigDialogPrivate; |
19 | /// The sonnet ConfigDialog |
20 | class SONNETUI_EXPORT ConfigDialog : public QDialog |
21 | { |
22 | Q_OBJECT |
23 | public: |
24 | explicit ConfigDialog(QWidget *parent); |
25 | ~ConfigDialog() override; |
26 | |
27 | /** |
28 | * Sets the language/dictionary that will be selected by default |
29 | * in this config dialog. |
30 | * This overrides the setting in the config file. |
31 | * |
32 | * @param language the language which will be selected by default. |
33 | * @since 4.1 |
34 | */ |
35 | void setLanguage(const QString &language); |
36 | /** |
37 | * return selected language |
38 | * @since 4.8.1 |
39 | */ |
40 | QString language() const; |
41 | |
42 | protected Q_SLOTS: |
43 | virtual void slotOk(); |
44 | virtual void slotApply(); |
45 | |
46 | Q_SIGNALS: |
47 | |
48 | /** |
49 | * This is emitted all the time when we change config and not just language |
50 | * |
51 | * @param language the language which the user has selected |
52 | * @since 4.1 |
53 | */ |
54 | |
55 | void languageChanged(const QString &language); |
56 | |
57 | /** |
58 | * This is emitted when configChanged |
59 | * @since 4.8.1 |
60 | */ |
61 | void configChanged(); |
62 | |
63 | private: |
64 | std::unique_ptr<ConfigDialogPrivate> const d; |
65 | Q_DISABLE_COPY(ConfigDialog) |
66 | Q_PRIVATE_SLOT(d, void slotConfigChanged()) |
67 | }; |
68 | } |
69 | |
70 | #endif |
71 | |