File indexing completed on 2024-09-08 05:00:58
0001 0002 /* 0003 * SPDX-FileCopyrightText: 2022 Devin Lin <devin@kde.org> 0004 * 0005 * SPDX-License-Identifier: GPL-2.0-or-later 0006 */ 0007 0008 #pragma once 0009 0010 #include <KConfigGroup> 0011 #include <KConfigWatcher> 0012 #include <KSharedConfig> 0013 #include <QObject> 0014 0015 /** 0016 * @short Wrapper class to access and control mobile shell specific settings. 0017 * 0018 * @author Devin Lin <devin@kde.org> 0019 */ 0020 class QuickSettingsConfig : public QObject 0021 { 0022 Q_OBJECT 0023 0024 public: 0025 QuickSettingsConfig(QObject *parent = nullptr); 0026 0027 /** 0028 * Get the list of IDs of quick settings that are enabled. 0029 */ 0030 QList<QString> enabledQuickSettings() const; 0031 0032 /** 0033 * Set the list of quick settings that are enabled. 0034 * 0035 * @param list A list of quick setting IDs. 0036 */ 0037 void setEnabledQuickSettings(QList<QString> &list); 0038 0039 /** 0040 * Get the list of IDs of quick settings that are disabled. 0041 */ 0042 QList<QString> disabledQuickSettings() const; 0043 0044 /** 0045 * Set the list of quick settings that are disabled. 0046 * 0047 * @param list A list of quick setting IDs. 0048 */ 0049 void setDisabledQuickSettings(QList<QString> &list); 0050 0051 Q_SIGNALS: 0052 void enabledQuickSettingsChanged(); 0053 void disabledQuickSettingsChanged(); 0054 0055 private: 0056 KConfigWatcher::Ptr m_configWatcher; 0057 KSharedConfig::Ptr m_config; 0058 };