Solid

ifaces/battery.h
1 /*
2  SPDX-FileCopyrightText: 2006 Kevin Ottens <[email protected]>
3  SPDX-FileCopyrightText: 2012 Lukas Tinkl <[email protected]>
4  SPDX-FileCopyrightText: 2014 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 SOLID_IFACES_BATTERY_H
10 #define SOLID_IFACES_BATTERY_H
11 
12 #include <solid/battery.h>
13 #include <solid/devices/ifaces/deviceinterface.h>
14 
15 namespace Solid
16 {
17 namespace Ifaces
18 {
22 class Battery : virtual public DeviceInterface
23 {
24 public:
28  virtual ~Battery();
29 
35  virtual bool isPresent() const = 0;
36 
43  virtual Solid::Battery::BatteryType type() const = 0;
44 
51  virtual int chargePercent() const = 0;
52 
62  virtual int capacity() const = 0;
63 
69  virtual bool isRechargeable() const = 0;
70 
76  virtual bool isPowerSupply() const = 0;
77 
85  virtual Solid::Battery::ChargeState chargeState() const = 0;
86 
93  virtual qlonglong timeToEmpty() const = 0;
94 
101  virtual qlonglong timeToFull() const = 0;
102 
109  virtual Solid::Battery::Technology technology() const = 0;
110 
116  virtual double energy() const = 0;
117 
124  virtual double energyFull() const = 0;
125 
132  virtual double energyFullDesign() const = 0;
133 
141  virtual double energyRate() const = 0;
142 
148  virtual double voltage() const = 0;
149 
156  virtual double temperature() const = 0;
157 
164  virtual bool isRecalled() const = 0;
165 
172  virtual QString recallVendor() const = 0;
173 
180  virtual QString recallUrl() const = 0;
181 
188  virtual QString serial() const = 0;
189 
196  virtual qlonglong remainingTime() const = 0;
197 
198 protected:
199  //Q_SIGNALS:
207  virtual void presentStateChanged(bool newState, const QString &udi) = 0;
208 
216  virtual void chargePercentChanged(int value, const QString &udi) = 0;
217 
225  virtual void capacityChanged(int value, const QString &udi) = 0;
226 
235  virtual void powerSupplyStateChanged(bool newState, const QString &udi) = 0;
236 
246  virtual void chargeStateChanged(int newState, const QString &udi = QString()) = 0;
247 
256  virtual void timeToEmptyChanged(qlonglong time, const QString &udi) = 0;
257 
266  virtual void timeToFullChanged(qlonglong time, const QString &udi) = 0;
267 
275  virtual void energyChanged(double energy, const QString &udi) = 0;
276 
284  virtual void energyFullChanged(double energy, const QString &udi) = 0;
285 
293  virtual void energyFullDesignChanged(double energy, const QString &udi) = 0;
294 
304  virtual void energyRateChanged(double energyRate, const QString &udi) = 0;
305 
313  virtual void voltageChanged(double voltage, const QString &udi) = 0;
314 
322  virtual void temperatureChanged(double temperature, const QString &udi) = 0;
323 
331  virtual void remainingTimeChanged(qlonglong time, const QString &udi) = 0;
332 };
333 }
334 }
335 
336 Q_DECLARE_INTERFACE(Solid::Ifaces::Battery, "org.kde.Solid.Ifaces.Battery/0.3")
337 
338 #endif
virtual qlonglong remainingTime() const =0
Retrieves the current estimated remaining time of the system batteries.
virtual bool isPowerSupply() const =0
Indicates if the battery is powering the machine.
virtual qlonglong timeToEmpty() const =0
Time (in seconds) until the battery is empty.
virtual ~Battery()
Destroys a Battery object.
virtual QString serial() const =0
The serial number of the battery.
virtual void energyFullChanged(double energy, const QString &udi)=0
This signal is emitted when the energy full value of this battery has changed.
virtual double energyRate() const =0
Amount of energy being drained from the source, measured in W.
virtual void energyFullDesignChanged(double energy, const QString &udi)=0
This signal is emitted when the energy full design value of this battery has changed.
virtual Solid::Battery::Technology technology() const =0
Retrieves the technology used to manufacture the battery.
virtual void energyRateChanged(double energyRate, const QString &udi)=0
This signal is emitted when the energy rate value of this battery has changed.
virtual int capacity() const =0
Retrieves the battery capacity normalised to percent, meaning how much energy can it hold compared to...
virtual void chargeStateChanged(int newState, const QString &udi=QString())=0
This signal is emitted when the charge state of this battery has changed.
virtual QString recallUrl() const =0
The website URL of the vendor that has recalled the battery.
virtual int chargePercent() const =0
Retrieves the current charge level of the battery normalised to percent.
virtual double voltage() const =0
Voltage in the Cell or being recorded by the meter.
virtual void temperatureChanged(double temperature, const QString &udi)=0
This signal is emitted when the battery temperature has changed.
virtual void energyChanged(double energy, const QString &udi)=0
This signal is emitted when the energy value of this battery has changed.
Base interface of all the device interfaces.
virtual qlonglong timeToFull() const =0
Time (in seconds) until the battery is full.
virtual void voltageChanged(double voltage, const QString &udi)=0
This signal is emitted when the voltage in the cell has changed.
virtual QString recallVendor() const =0
The vendor that has recalled the battery.
virtual void timeToEmptyChanged(qlonglong time, const QString &udi)=0
This signal is emitted when the time until the battery is empty has changed.
virtual double energyFull() const =0
Amount of energy (measured in Wh) the battery has when it is full.
virtual void powerSupplyStateChanged(bool newState, const QString &udi)=0
This signal is emitted when the power supply state of the battery changes.
Technology
Technology used in the battery.
virtual void presentStateChanged(bool newState, const QString &udi)=0
This signal is emitted if the battery gets plugged in/out of the battery bay.
virtual bool isRecalled() const =0
The battery may have been recalled by the vendor due to a suspected fault.
ChargeState
This enum type defines charge state of a battery.
virtual Solid::Battery::BatteryType type() const =0
Retrieves the type of device holding this battery.
virtual bool isRechargeable() const =0
Indicates if the battery is rechargeable.
virtual bool isPresent() const =0
Indicates if this battery is currently present in its bay.
virtual void chargePercentChanged(int value, const QString &udi)=0
This signal is emitted when the charge percent value of this battery has changed. ...
The single responsibility of this class is to create arguments valid for logind Inhibit call...
virtual double energy() const =0
Amount of energy (measured in Wh) currently available in the power source.
virtual double temperature() const =0
The temperature of the battery in degrees Celsius.
virtual void capacityChanged(int value, const QString &udi)=0
This signal is emitted when the capacity of this battery has changed.
virtual void timeToFullChanged(qlonglong time, const QString &udi)=0
This signal is emitted when the time until the battery is full has changed.
virtual Solid::Battery::ChargeState chargeState() const =0
Retrieves the current charge state of the battery.
virtual double energyFullDesign() const =0
Amount of energy (measured in Wh) the battery should have by design hen it is full.
virtual void remainingTimeChanged(qlonglong time, const QString &udi)=0
This signal is emitted when the estimated battery remaining time changes.
BatteryType
This enum type defines the type of the device holding the battery.
This device interface is available on batteries.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Tue Sep 22 2020 22:50:17 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.