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 | /*! |
20 | * \class Sonnet::ConfigDialog |
21 | * \inheaderfile Sonnet/ConfigDialog |
22 | * \inmodule SonnetUi |
23 | * |
24 | * \brief The sonnet ConfigDialog. |
25 | */ |
26 | class SONNETUI_EXPORT ConfigDialog : public QDialog |
27 | { |
28 | Q_OBJECT |
29 | public: |
30 | /*! |
31 | */ |
32 | explicit ConfigDialog(QWidget *parent); |
33 | ~ConfigDialog() override; |
34 | |
35 | /*! |
36 | * Sets the language/dictionary that will be selected by default |
37 | * in this config dialog. |
38 | * This overrides the setting in the config file. |
39 | * |
40 | * \a language the language which will be selected by default. |
41 | * \since 4.1 |
42 | */ |
43 | void setLanguage(const QString &language); |
44 | /*! |
45 | * return selected language |
46 | * \since 4.8.1 |
47 | */ |
48 | QString language() const; |
49 | |
50 | protected Q_SLOTS: |
51 | /*! |
52 | * |
53 | */ |
54 | virtual void slotOk(); |
55 | |
56 | /*! |
57 | * |
58 | */ |
59 | virtual void slotApply(); |
60 | |
61 | Q_SIGNALS: |
62 | |
63 | /*! |
64 | * This is emitted all the time when we change config and not just language |
65 | * |
66 | * \a language the language which the user has selected |
67 | * \since 4.1 |
68 | */ |
69 | void languageChanged(const QString &language); |
70 | |
71 | /*! |
72 | * This is emitted when configChanged |
73 | * \since 4.8.1 |
74 | */ |
75 | void configChanged(); |
76 | |
77 | private: |
78 | std::unique_ptr<ConfigDialogPrivate> const d; |
79 | Q_DISABLE_COPY(ConfigDialog) |
80 | Q_PRIVATE_SLOT(d, void slotConfigChanged()) |
81 | }; |
82 | } |
83 | |
84 | #endif |
85 | |