File: fakeUpower.h

package info (click to toggle)
solid 5.78.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 5,100 kB
  • sloc: cpp: 21,549; xml: 464; lex: 111; yacc: 83; sh: 14; makefile: 5
file content (39 lines) | stat: -rw-r--r-- 1,010 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*
    SPDX-FileCopyrightText: 2014 Alejandro Fiestas Olivares <afiestas@kde.org>

    SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/

#ifndef SOLID_FAKE_UPOWER_H
#define SOLID_FAKE_UPOWER_H

#include <QList>
#include <QString>
#include <QDBusObjectPath>

class FakeUpower : public QObject
{
    Q_OBJECT
    Q_PROPERTY(bool IsDocked READ isDocked)
    Q_PROPERTY(bool OnBattery READ onBattery)
    Q_CLASSINFO("D-Bus Interface", "org.freedesktop.UPower")
public:
    explicit FakeUpower(QObject* parent);

    QString daemonVersion() const;
    bool isDocked() const;
    bool lidIsClosed() const;
    bool lidIsPresent() const;
    bool onBattery() const;
    void setOnBattery(bool onBattery);

    bool m_onBattery;

    void emitPropertiesChanged(const QString &name, const QVariant &value);
public Q_SLOTS:
    QList<QDBusObjectPath> EnumerateDevices();
    QString GetCriticalAction();
    QDBusObjectPath GetDisplayDevice();
};

#endif //SOLID_FAKE_UPOWER_H