File indexing completed on 2024-05-12 15:32:33

0001 /*
0002  * BluezQt - Asynchronous BlueZ wrapper library
0003  *
0004  * SPDX-FileCopyrightText: 2019 Kai Uwe Broulik <kde@broulik.de>
0005  *
0006  * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0007  */
0008 
0009 #ifndef DECLARATIVEBATTERY_H
0010 #define DECLARATIVEBATTERY_H
0011 
0012 #include "battery.h"
0013 
0014 class DeclarativeBattery : public QObject
0015 {
0016     Q_OBJECT
0017     Q_PROPERTY(int percentage READ percentage NOTIFY percentageChanged)
0018 
0019 public:
0020     explicit DeclarativeBattery(const BluezQt::BatteryPtr &battery, QObject *parent = nullptr);
0021 
0022     int percentage() const;
0023 
0024 Q_SIGNALS:
0025     void percentageChanged(int percentage);
0026 
0027 private:
0028     BluezQt::BatteryPtr m_battery;
0029 };
0030 
0031 #endif // DECLARATIVEBATTERY_H