BluezQt

battery.h
1 /*
2  * BluezQt - Asynchronous BlueZ wrapper library
3  *
4  * SPDX-FileCopyrightText: 2019 Kai Uwe Broulik <[email protected]>
5  *
6  * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
7  */
8 
9 #ifndef BLUEZQT_BATTERY_H
10 #define BLUEZQT_BATTERY_H
11 
12 #include <QObject>
13 
14 #include "bluezqt_export.h"
15 #include "types.h"
16 
17 namespace BluezQt
18 {
19 /**
20  * @class BluezQt::Battery battery.h <BluezQt/Battery>
21  *
22  * %Device battery.
23  *
24  * This class represents a battery interface.
25  */
26 class BLUEZQT_EXPORT Battery : public QObject
27 {
28  Q_OBJECT
29  Q_PROPERTY(int percentage READ percentage NOTIFY percentageChanged)
30 
31 public:
32  /**
33  * Destroys a Battery object.
34  */
35  ~Battery() override;
36 
37  /**
38  * Returns a shared pointer from this.
39  *
40  * @return BatteryPtr
41  */
42  BatteryPtr toSharedPtr() const;
43 
44  /**
45  * Returns the battery percentage.
46  *
47  * @return battery percentage
48  */
49  int percentage() const;
50 
51 Q_SIGNALS:
52  /**
53  * Indicates that battery's percentage has changed.
54  */
55  void percentageChanged(int percentage);
56 
57 private:
58  explicit Battery(const QString &path, const QVariantMap &properties);
59 
60  class BatteryPrivate *const d;
61 
62  friend class BatteryPrivate;
63  friend class DevicePrivate;
64 };
65 
66 } // namespace BluezQt
67 
68 #endif // BLUEZQT_BATTERY_H
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Sun Sep 25 2022 04:19:10 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.