File indexing completed on 2024-05-19 05:00:55

0001 /*
0002     This file is part of the KDE project.
0003 
0004     SPDX-FileCopyrightText: 2023 Stefano Crocco <stefano.crocco@alice.it>
0005 
0006     SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0007 */
0008 
0009 #ifndef TABSOPTIONS_H
0010 #define TABSOPTIONS_H
0011 
0012 #include <KCModule>
0013 #include <KSharedConfig>
0014 
0015 namespace Ui {
0016     class TabsOptions;
0017 }
0018 
0019 /**
0020  * @brief KCM to display tab-related options
0021  */
0022 class TabsOptions : public KCModule
0023 {
0024     Q_OBJECT
0025 
0026 public:
0027     //TODO KF6: when dropping compatibility with KF5, remove QVariantList argument
0028     /**
0029      * @brief Constructor
0030      *
0031      * @param parent the parent widget
0032      * @param md as in `KCModule` constructor
0033      * @param args as in `KCModule` constructor
0034      */
0035     TabsOptions(QObject *parent, const KPluginMetaData &md={}, const QVariantList &args={});
0036 
0037     /**
0038      * @brief Destructor
0039      */
0040     ~TabsOptions();
0041 
0042 #if QT_VERSION_MAJOR < 6
0043     void setNeedsSave(bool needs) {emit changed(needs);}
0044 #endif
0045 
0046 public slots:
0047 
0048     /**
0049      * @brief Loads the settings from the configuration files
0050      */
0051     void load() override;
0052 
0053     /**
0054      * @brief Resets the KCM to its default values
0055      */
0056     void defaults() override;
0057 
0058     /**
0059      * @brief Saves the user settings
0060      */
0061     void save() override;
0062 
0063 private:
0064 
0065     QScopedPointer<Ui::TabsOptions> m_ui; //!< The UI object
0066 
0067     KSharedConfig::Ptr m_config; //!< The configuration object
0068 };
0069 
0070 #endif //TABSOPTIONS_H