File indexing completed on 2022-11-22 13:01:10

0001 /*
0002     SPDX-FileCopyrightText: 2005, 2007 Peter Hedlund <peter.hedlund@kdemail.net>
0003     SPDX-FileCopyrightText: 2007 Frederik Gladhorn <frederik.gladhorn@kdemail.net>
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #ifndef PARLEYPREFS_H
0008 #define PARLEYPREFS_H
0009 
0010 #include <KConfigDialog>
0011 
0012 /**
0013  *@author Peter Hedlund
0014  */
0015 
0016 class GeneralOptions;
0017 class ViewOptions;
0018 class TranslationShellOptions;
0019 class KEduVocDocument;
0020 class KComboBox;
0021 class KConfigSkeleton;
0022 
0023 class ParleyPrefs : public KConfigDialog
0024 {
0025     Q_OBJECT
0026 
0027 public:
0028     /**
0029      * Creates a configuration dialog.
0030      */
0031     ParleyPrefs(KEduVocDocument *doc, QWidget *parent, const QString &name, KConfigSkeleton *config);
0032 
0033 protected Q_SLOTS:
0034     /**
0035      * Called when the user clicks Apply or OK.
0036      */
0037     void updateSettings() override;
0038     /**
0039      * Updates dialog widgets. Here only used after loading a profile.
0040      * Profiles only store the settings of the last three pages in the dialog.
0041      */
0042     void updateWidgets() override;
0043     /**
0044      * Called when the user clicks Default
0045      */
0046     void updateWidgetsDefault() override;
0047 
0048 protected:
0049     /**
0050      * Returns true if the current state of the dialog is different from the saved settings
0051      */
0052     bool hasChanged() override;
0053     /**
0054      * Returns true if the current state of the dialog represents the default settings.
0055      */
0056     bool isDefault() override;
0057 
0058 private:
0059     GeneralOptions *m_generalOptions{nullptr};
0060     ViewOptions *m_viewOptions{nullptr};
0061     TranslationShellOptions *m_translationShellOptions{nullptr};
0062 
0063     KConfigSkeleton *m_config{nullptr};
0064     KEduVocDocument *m_doc{nullptr};
0065     KComboBox *m_lessons{nullptr};
0066 };
0067 
0068 #endif