File indexing completed on 2024-10-13 03:42:25
0001 /* 0002 SPDX-FileCopyrightText: 2014 Alejandro Fiestas Olivares <afiestas@kde.org> 0003 0004 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL 0005 */ 0006 0007 #ifndef SOLID_FAKE_UPOWER_H 0008 #define SOLID_FAKE_UPOWER_H 0009 0010 #include <QDBusObjectPath> 0011 #include <QList> 0012 #include <QString> 0013 0014 class FakeUpower : public QObject 0015 { 0016 Q_OBJECT 0017 Q_PROPERTY(bool IsDocked READ isDocked) 0018 Q_PROPERTY(bool OnBattery READ onBattery) 0019 Q_CLASSINFO("D-Bus Interface", "org.freedesktop.UPower") 0020 public: 0021 explicit FakeUpower(QObject *parent); 0022 0023 QString daemonVersion() const; 0024 bool isDocked() const; 0025 bool lidIsClosed() const; 0026 bool lidIsPresent() const; 0027 bool onBattery() const; 0028 void setOnBattery(bool onBattery); 0029 0030 bool m_onBattery; 0031 0032 void emitPropertiesChanged(const QString &name, const QVariant &value); 0033 public Q_SLOTS: 0034 QList<QDBusObjectPath> EnumerateDevices(); 0035 QString GetCriticalAction(); 0036 QDBusObjectPath GetDisplayDevice(); 0037 }; 0038 0039 #endif // SOLID_FAKE_UPOWER_H