BluezQt

battery.h
1/*
2 * BluezQt - Asynchronous BlueZ wrapper library
3 *
4 * SPDX-FileCopyrightText: 2019 Kai Uwe Broulik <kde@broulik.de>
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#include <memory>
18
19namespace BluezQt
20{
21/**
22 * @class BluezQt::Battery battery.h <BluezQt/Battery>
23 *
24 * %Device battery.
25 *
26 * This class represents a battery interface.
27 */
29{
30 Q_OBJECT
31 Q_PROPERTY(int percentage READ percentage NOTIFY percentageChanged)
32
33public:
34 /**
35 * Destroys a Battery object.
36 */
37 ~Battery() override;
38
39 /**
40 * Returns a shared pointer from this.
41 *
42 * @return BatteryPtr
43 */
44 BatteryPtr toSharedPtr() const;
45
46 /**
47 * Returns the battery percentage.
48 *
49 * @return battery percentage
50 */
51 int percentage() const;
52
53Q_SIGNALS:
54 /**
55 * Indicates that battery's percentage has changed.
56 */
57 void percentageChanged(int percentage);
58
59private:
60 BLUEZQT_NO_EXPORT explicit Battery(const QString &path, const QVariantMap &properties);
61
62 std::unique_ptr<class BatteryPrivate> const d;
63
64 friend class BatteryPrivate;
65 friend class DevicePrivate;
66};
67
68} // namespace BluezQt
69
70#endif // BLUEZQT_BATTERY_H
Device battery.
Definition battery.h:29
~Battery() override
Destroys a Battery object.
void percentageChanged(int percentage)
Indicates that battery's percentage has changed.
D-Bus request.
Definition request.h:39
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:13:51 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.