File indexing completed on 2024-05-12 17:06:42
0001 /*************************************************************************** 0002 * * 0003 * SPDX-FileCopyrightText: 2021 Aditya Mehra <aix.m@outlook.com> * 0004 * SPDX-FileCopyrightText: 2015 Sebastian Kügler <sebas@kde.org> * 0005 * * 0006 * SPDX-License-Identifier: GPL-2.0-or-later * 0007 ***************************************************************************/ 0008 0009 #ifndef BIGSCREENSETTINGS_H 0010 #define BIGSCREENSETTINGS_H 0011 0012 #include <KQuickAddons/ConfigModule> 0013 #include <QObject> 0014 #include <QVariant> 0015 0016 namespace Plasma 0017 { 0018 class Theme; 0019 } 0020 0021 class ThemeListModel; 0022 0023 class BigscreenSettings : public KQuickAddons::ConfigModule 0024 { 0025 Q_OBJECT 0026 0027 Q_PROPERTY(QString themeName READ themeName WRITE setThemeName NOTIFY themeNameChanged) 0028 Q_PROPERTY(ThemeListModel *themeListModel READ themeListModel CONSTANT) 0029 Q_PROPERTY(QTime currentTime READ currentTime WRITE setCurrentTime NOTIFY currentTimeChanged) 0030 Q_PROPERTY(QDate currentDate READ currentDate WRITE setCurrentDate NOTIFY currentDateChanged) 0031 Q_PROPERTY(bool useNtp READ useNtp WRITE setUseNtp NOTIFY useNtpChanged) 0032 0033 public: 0034 BigscreenSettings(QObject *parent, const QVariantList &args); 0035 ~BigscreenSettings() override; 0036 0037 QString themeName() const; 0038 void setThemeName(const QString &theme); 0039 0040 ThemeListModel *themeListModel(); 0041 0042 public Q_SLOTS: 0043 void load() override; 0044 void applyPlasmaTheme(QQuickItem *item, const QString &themeName); 0045 0046 bool useColoredTiles(); 0047 void setUseColoredTiles(bool useColoredTiles); 0048 0049 bool useExpandingTiles(); 0050 void setUseExpandingTiles(bool useExpandingTiles); 0051 0052 bool mycroftIntegrationActive(); 0053 void setMycroftIntegrationActive(bool mycroftIntegrationActive); 0054 0055 bool pmInhibitionActive(); 0056 void setPmInhibitionActive(bool pmInhibitionActive); 0057 0058 void saveTimeZone(const QString &newtimezone); 0059 0060 bool useNtp(); 0061 void setUseNtp(bool ntp); 0062 0063 QTime currentTime(); 0064 void setCurrentTime(const QTime &time); 0065 0066 QDate currentDate(); 0067 void setCurrentDate(const QDate &date); 0068 0069 bool saveTime(); 0070 0071 Q_SIGNALS: 0072 void themeNameChanged(); 0073 void timeFormatChanged(); 0074 void twentyFourChanged(); 0075 void useNtpChanged(); 0076 void currentTimeChanged(); 0077 void currentDateChanged(); 0078 0079 private: 0080 QHash<QString, Plasma::Theme *> m_themes; 0081 Plasma::Theme *m_theme; 0082 QString m_themeName; 0083 ThemeListModel *m_themeListModel; 0084 0085 bool m_coloredTiles; 0086 bool m_expandingTiles; 0087 0088 QTime m_currentTime; 0089 QDate m_currentDate; 0090 bool m_useNtp; 0091 }; 0092 0093 #endif // BIGSCREENSETTINGS_H