File indexing completed on 2024-12-22 05:25:49
0001 /* 0002 * Copyright 2019 by Marco Martin <mart@kde.org> 0003 * Copyright 2018 by Aditya Mehra <aix.m@outlook.com> 0004 * 0005 * Licensed under the Apache License, Version 2.0 (the "License"); 0006 * you may not use this file except in compliance with the License. 0007 * You may obtain a copy of the License at 0008 * 0009 * http://www.apache.org/licenses/LICENSE-2.0 0010 * 0011 * Unless required by applicable law or agreed to in writing, software 0012 * distributed under the License is distributed on an "AS IS" BASIS, 0013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 0014 * See the License for the specific language governing permissions and 0015 * limitations under the License. 0016 * 0017 */ 0018 0019 #pragma once 0020 0021 #include <QSettings> 0022 #include <QCoreApplication> 0023 #include <QDebug> 0024 0025 class QSettings; 0026 0027 class AppSettings : public QObject 0028 { 0029 Q_OBJECT 0030 Q_PROPERTY(bool darkMode READ darkMode WRITE setDarkMode NOTIFY darkModeChanged) 0031 Q_PROPERTY(bool usesRemoteSTT READ usesRemoteSTT WRITE setUsesRemoteSTT NOTIFY usesRemoteSTTChanged) 0032 0033 public: 0034 explicit AppSettings(QObject *parent=0); 0035 0036 bool darkMode() const; 0037 void setDarkMode(bool dark); 0038 bool usesRemoteSTT() const; 0039 void setUsesRemoteSTT(bool remote); 0040 0041 Q_SIGNALS: 0042 void darkModeChanged(); 0043 void usesRemoteSTTChanged(); 0044 0045 private: 0046 QSettings m_settings; 0047 }; 0048