File indexing completed on 2025-03-09 04:54:44

0001 /*
0002   SPDX-FileCopyrightText: 2009 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.net
0003   SPDX-FileCopyrightText: 2009 Andras Mantia <andras@kdab.net>
0004 
0005   SPDX-License-Identifier: GPL-2.0-or-later
0006 */
0007 
0008 #pragma once
0009 
0010 #include "messageviewer_export.h"
0011 
0012 #include <QWidget>
0013 
0014 class KConfigDialogManager;
0015 
0016 namespace MessageViewer
0017 {
0018 class ConfigureWidgetPrivate;
0019 /**
0020  * Configure widget that can be used in a KConfigDialog.
0021  *
0022  * @author Andras Mantia <andras@kdab.net>
0023  */
0024 class MESSAGEVIEWER_EXPORT ConfigureWidget : public QWidget
0025 {
0026     Q_OBJECT
0027 public:
0028     explicit ConfigureWidget(QWidget *parent = nullptr);
0029 
0030     ~ConfigureWidget() override;
0031 
0032     //
0033     // Read and write config settings to the GlobalSettings.
0034     // Note that this does not deal with all settings, some of those settings need to saved and read
0035     // with a KConfigDialogManager, since this widgets correctly sets the objectname to the pattern
0036     // required by KConfigDialogManager.
0037     //
0038 
0039     void writeConfig();
0040     void readConfig();
0041 
0042 Q_SIGNALS:
0043 
0044     /**
0045      * Emitted when the user changes the setting in some widget. Useful to enable the "Apply"
0046      * button after this has been emitted.
0047      */
0048     void settingsChanged();
0049 
0050 private:
0051     MESSAGEVIEWER_NO_EXPORT void readCurrentOverrideCodec();
0052     std::unique_ptr<ConfigureWidgetPrivate> const d;
0053 };
0054 }