File indexing completed on 2024-05-19 04:55:50

0001 /**
0002  * \file kdeconfigdialog.h
0003  * KDE configuration dialog.
0004  *
0005  * \b Project: Kid3
0006  * \author Urs Fleisch
0007  * \date 17 Sep 2003
0008  *
0009  * Copyright (C) 2003-2024  Urs Fleisch
0010  *
0011  * This file is part of Kid3.
0012  *
0013  * Kid3 is free software; you can redistribute it and/or modify
0014  * it under the terms of the GNU General Public License as published by
0015  * the Free Software Foundation; either version 2 of the License, or
0016  * (at your option) any later version.
0017  *
0018  * Kid3 is distributed in the hope that it will be useful,
0019  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0020  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0021  * GNU General Public License for more details.
0022  *
0023  * You should have received a copy of the GNU General Public License
0024  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
0025  */
0026 
0027 #pragma once
0028 
0029 #include <QtGlobal>
0030 #include <KConfigDialog>
0031 
0032 class QString;
0033 class QWidget;
0034 class QComboBox;
0035 class KConfigSkeleton;
0036 class ConfigDialogPages;
0037 class IPlatformTools;
0038 
0039 /**
0040  * KDE configuration dialog.
0041  */
0042 class KdeConfigDialog : public KConfigDialog {
0043   Q_OBJECT
0044 public:
0045   /**
0046    * Constructor.
0047    *
0048    * @param platformTools platform specific tools
0049    * @param parent  parent widget
0050    * @param caption dialog title
0051    * @param configSkeleton configuration skeleton
0052    */
0053   KdeConfigDialog(IPlatformTools* platformTools, QWidget* parent, const QString& caption,
0054                   KConfigSkeleton* configSkeleton);
0055 
0056   /**
0057    * Destructor.
0058    */
0059   ~KdeConfigDialog() override = default;
0060 
0061   /**
0062    * Set values in dialog from current configuration.
0063    */
0064   void setConfig();
0065 
0066   /**
0067    * Get values from dialog and store them in the current configuration.
0068    */
0069   void getConfig() const;
0070 
0071 protected slots:
0072   /**
0073    * Show help.
0074    */
0075   void slotHelp();
0076 
0077 protected:
0078   /**
0079    * Returns whether the current state of the dialog is
0080    * the same as the default configuration.
0081    * @return false
0082    */
0083   bool isDefault() override;
0084 
0085 private:
0086   ConfigDialogPages* m_pages;
0087 };