1 #ifndef BATTERYMONITOR_H
2 #define BATTERYMONITOR_H
6 #include <QtDBus/QtDBus>
7 #include <QDBusInterface>
8 #include <QDBusConnection>
9 #include <QDBusObjectPath>
12 #define UPOWER_PROPERTIES "org.freedesktop.UPower.Device"
14 class BatteryMonitor:
public QObject {
16 Q_PROPERTY(qint64 timeToFull READ timeToFull NOTIFY timeToFullChanged)
17 Q_PROPERTY(
bool charging READ charging NOTIFY chargingChanged)
26 Q_INVOKABLE uint state();
43 void propertiesChanged(QString
string, QVariantMap map, QStringList list);
46 void chargingChanged();
47 void timeToFullChanged();
50 QDBusInterface *m_iface;
51 QDBusObjectPath m_displayPath;