File indexing completed on 2024-04-28 07:50:12

0001 /*
0002  * configdialog.h
0003  *
0004  * SPDX-FileCopyrightText: 2004 Zack Rusin <zack@kde.org>
0005  *
0006  * SPDX-License-Identifier: LGPL-2.1-or-later
0007  */
0008 #ifndef SONNET_CONFIGDIALOG_H
0009 #define SONNET_CONFIGDIALOG_H
0010 
0011 #include "sonnetui_export.h"
0012 #include <QDialog>
0013 
0014 #include <memory>
0015 
0016 namespace Sonnet
0017 {
0018 class ConfigDialogPrivate;
0019 /// The sonnet ConfigDialog
0020 class SONNETUI_EXPORT ConfigDialog : public QDialog
0021 {
0022     Q_OBJECT
0023 public:
0024     explicit ConfigDialog(QWidget *parent);
0025     ~ConfigDialog() override;
0026 
0027     /**
0028      * Sets the language/dictionary that will be selected by default
0029      * in this config dialog.
0030      * This overrides the setting in the config file.
0031      *
0032      * @param language the language which will be selected by default.
0033      * @since 4.1
0034      */
0035     void setLanguage(const QString &language);
0036     /**
0037      * return selected language
0038      * @since 4.8.1
0039      */
0040     QString language() const;
0041 
0042 protected Q_SLOTS:
0043     virtual void slotOk();
0044     virtual void slotApply();
0045 
0046 Q_SIGNALS:
0047 
0048     /**
0049      * This is emitted all the time when we change config and not just language
0050      *
0051      * @param language the language which the user has selected
0052      * @since 4.1
0053      */
0054 
0055     void languageChanged(const QString &language);
0056 
0057     /**
0058      * This is emitted when configChanged
0059      * @since 4.8.1
0060      */
0061     void configChanged();
0062 
0063 private:
0064     std::unique_ptr<ConfigDialogPrivate> const d;
0065     Q_DISABLE_COPY(ConfigDialog)
0066     Q_PRIVATE_SLOT(d, void slotConfigChanged())
0067 };
0068 }
0069 
0070 #endif