File indexing completed on 2024-04-28 15:34:20

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 <QDialog>
0012 class ConfigDialogPrivate;
0013 #include "sonnetui_export.h"
0014 
0015 namespace Sonnet
0016 {
0017 /// The sonnet ConfigDialog
0018 class SONNETUI_EXPORT ConfigDialog : public QDialog
0019 {
0020     Q_OBJECT
0021 public:
0022     explicit ConfigDialog(QWidget *parent);
0023     ~ConfigDialog() override;
0024 
0025     /**
0026      * Sets the language/dictionary that will be selected by default
0027      * in this config dialog.
0028      * This overrides the setting in the config file.
0029      *
0030      * @param language the language which will be selected by default.
0031      * @since 4.1
0032      */
0033     void setLanguage(const QString &language);
0034     /**
0035      * return selected language
0036      * @since 4.8.1
0037      */
0038     QString language() const;
0039 
0040 protected Q_SLOTS:
0041     virtual void slotOk();
0042     virtual void slotApply();
0043 
0044 Q_SIGNALS:
0045 
0046     /**
0047      * This is emitted all the time when we change config and not just language
0048      *
0049      * @param language the language which the user has selected
0050      * @since 4.1
0051      */
0052 
0053     void languageChanged(const QString &language);
0054 
0055     /**
0056      * This is emitted when configChanged
0057      * @since 4.8.1
0058      */
0059     void configChanged();
0060 
0061 private:
0062     ConfigDialogPrivate *const d;
0063     Q_DISABLE_COPY(ConfigDialog)
0064     Q_PRIVATE_SLOT(d, void slotConfigChanged())
0065 };
0066 }
0067 
0068 #endif