Solid::Ifaces::Battery

Solid::Ifaces::Battery Class Referenceabstract

#include <battery.h>

Inheritance diagram for Solid::Ifaces::Battery:

Public Member Functions

virtual ~Battery ()
 
virtual int capacity () const =0
 
virtual int chargePercent () const =0
 
virtual Solid::Battery::ChargeState chargeState () const =0
 
virtual double energy () const =0
 
virtual double energyFull () const =0
 
virtual double energyFullDesign () const =0
 
virtual double energyRate () const =0
 
virtual bool isPowerSupply () const =0
 
virtual bool isPresent () const =0
 
virtual bool isRecalled () const =0
 
virtual bool isRechargeable () const =0
 
virtual QString recallUrl () const =0
 
virtual QString recallVendor () const =0
 
virtual qlonglong remainingTime () const =0
 
virtual QString serial () const =0
 
virtual Solid::Battery::Technology technology () const =0
 
virtual double temperature () const =0
 
virtual qlonglong timeToEmpty () const =0
 
virtual qlonglong timeToFull () const =0
 
virtual Solid::Battery::BatteryType type () const =0
 
virtual double voltage () const =0
 
- Public Member Functions inherited from Solid::Ifaces::DeviceInterface
virtual ~DeviceInterface ()
 

Protected Member Functions

virtual void capacityChanged (int value, const QString &udi)=0
 
virtual void chargePercentChanged (int value, const QString &udi)=0
 
virtual void chargeStateChanged (int newState, const QString &udi=QString())=0
 
virtual void energyChanged (double energy, const QString &udi)=0
 
virtual void energyFullChanged (double energy, const QString &udi)=0
 
virtual void energyFullDesignChanged (double energy, const QString &udi)=0
 
virtual void energyRateChanged (double energyRate, const QString &udi)=0
 
virtual void powerSupplyStateChanged (bool newState, const QString &udi)=0
 
virtual void presentStateChanged (bool newState, const QString &udi)=0
 
virtual void remainingTimeChanged (qlonglong time, const QString &udi)=0
 
virtual void temperatureChanged (double temperature, const QString &udi)=0
 
virtual void timeToEmptyChanged (qlonglong time, const QString &udi)=0
 
virtual void timeToFullChanged (qlonglong time, const QString &udi)=0
 
virtual void voltageChanged (double voltage, const QString &udi)=0
 

Detailed Description

This device interface is available on batteries.

Definition at line 22 of file ifaces/battery.h.

Constructor & Destructor Documentation

Solid::Ifaces::Battery::~Battery ( )
virtual

Destroys a Battery object.

Definition at line 9 of file ifaces/battery.cpp.

Member Function Documentation

virtual int Solid::Ifaces::Battery::capacity ( ) const
pure virtual

Retrieves the battery capacity normalised to percent, meaning how much energy can it hold compared to what it is designed to.

The capacity of the battery will reduce with age. A capacity value less than 75% is usually a sign that you should renew your battery.

Since
4.11
Returns
the battery capacity normalised to percent
virtual void Solid::Ifaces::Battery::capacityChanged ( int  value,
const QString udi 
)
protectedpure virtual

This signal is emitted when the capacity of this battery has changed.

Parameters
valuethe new capacity of the battery
udithe UDI of the battery with the new capacity
Since
4.11
virtual int Solid::Ifaces::Battery::chargePercent ( ) const
pure virtual

Retrieves the current charge level of the battery normalised to percent.

Returns
the current charge level normalised to percent
virtual void Solid::Ifaces::Battery::chargePercentChanged ( int  value,
const QString udi 
)
protectedpure virtual

This signal is emitted when the charge percent value of this battery has changed.

Parameters
valuethe new charge percent value of the battery
udithe UDI of the battery with the new charge percent
virtual Solid::Battery::ChargeState Solid::Ifaces::Battery::chargeState ( ) const
pure virtual

Retrieves the current charge state of the battery.

It can be in a stable state (no charge), charging or discharging.

Returns
the current battery charge state
See also
Solid::Battery::ChargeState
virtual void Solid::Ifaces::Battery::chargeStateChanged ( int  newState,
const QString udi = QString() 
)
protectedpure virtual

This signal is emitted when the charge state of this battery has changed.

Parameters
newStatethe new charge state of the battery, it's one of the type Solid::Battery::ChargeState
See also
Solid::Battery::ChargeState
Parameters
udithe UDI of the battery with the new charge state
virtual double Solid::Ifaces::Battery::energy ( ) const
pure virtual

Amount of energy (measured in Wh) currently available in the power source.

Returns
amount of battery energy in Wh
virtual void Solid::Ifaces::Battery::energyChanged ( double  energy,
const QString udi 
)
protectedpure virtual

This signal is emitted when the energy value of this battery has changed.

Parameters
energythe new energy value of the battery
udithe UDI of the battery with the new energy value
virtual double Solid::Ifaces::Battery::energyFull ( ) const
pure virtual

Amount of energy (measured in Wh) the battery has when it is full.

Returns
amount of battery energy when full in Wh
Since
5.7
virtual void Solid::Ifaces::Battery::energyFullChanged ( double  energy,
const QString udi 
)
protectedpure virtual

This signal is emitted when the energy full value of this battery has changed.

Parameters
energythe new energy full value of the battery
udithe UDI of the battery with the new energy full value
virtual double Solid::Ifaces::Battery::energyFullDesign ( ) const
pure virtual

Amount of energy (measured in Wh) the battery should have by design hen it is full.

Returns
amount of battery energy when full by design in Wh
Since
5.7
virtual void Solid::Ifaces::Battery::energyFullDesignChanged ( double  energy,
const QString udi 
)
protectedpure virtual

This signal is emitted when the energy full design value of this battery has changed.

Parameters
energythe new energy full design value of the battery
udithe UDI of the battery with the new energy full design value
virtual double Solid::Ifaces::Battery::energyRate ( ) const
pure virtual

Amount of energy being drained from the source, measured in W.

If positive, the source is being discharged, if negative it's being charged.

Returns
battery rate in Watts
virtual void Solid::Ifaces::Battery::energyRateChanged ( double  energyRate,
const QString udi 
)
protectedpure virtual

This signal is emitted when the energy rate value of this battery has changed.

If positive, the source is being discharged, if negative it's being charged.

Parameters
energyRatethe new energy rate value of the battery
udithe UDI of the battery with the new charge percent
virtual bool Solid::Ifaces::Battery::isPowerSupply ( ) const
pure virtual

Indicates if the battery is powering the machine.

Returns
true if the battery is powersupply, false otherwise
virtual bool Solid::Ifaces::Battery::isPresent ( ) const
pure virtual

Indicates if this battery is currently present in its bay.

Returns
true if the battery is present, false otherwise
virtual bool Solid::Ifaces::Battery::isRecalled ( ) const
pure virtual

The battery may have been recalled by the vendor due to a suspected fault.

Returns
true if the battery has been recalled, false otherwise
Since
5.0
virtual bool Solid::Ifaces::Battery::isRechargeable ( ) const
pure virtual

Indicates if the battery is rechargeable.

Returns
true if the battery is rechargeable, false otherwise (one time usage)
virtual void Solid::Ifaces::Battery::powerSupplyStateChanged ( bool  newState,
const QString udi 
)
protectedpure virtual

This signal is emitted when the power supply state of the battery changes.

Parameters
newStatethe new power supply state, type is boolean
udithe UDI of the battery with the new power supply state
Since
4.11
virtual void Solid::Ifaces::Battery::presentStateChanged ( bool  newState,
const QString udi 
)
protectedpure virtual

This signal is emitted if the battery gets plugged in/out of the battery bay.

Parameters
newStatethe new plugging state of the battery, type is boolean
udithe UDI of the battery with thew new plugging state
virtual QString Solid::Ifaces::Battery::recallUrl ( ) const
pure virtual

The website URL of the vendor that has recalled the battery.

Returns
the website URL of the vendor that has recalled the battery
Since
5.0
virtual QString Solid::Ifaces::Battery::recallVendor ( ) const
pure virtual

The vendor that has recalled the battery.

Returns
the vendor name that has recalled the battery
Since
5.0
virtual qlonglong Solid::Ifaces::Battery::remainingTime ( ) const
pure virtual

Retrieves the current estimated remaining time of the system batteries.

Returns
the current global estimated remaining time in seconds
Since
5.8
virtual void Solid::Ifaces::Battery::remainingTimeChanged ( qlonglong  time,
const QString udi 
)
protectedpure virtual

This signal is emitted when the estimated battery remaining time changes.

Parameters
timethe new remaining time
udithe UDI of the battery with the new remaining time
Since
5.8
virtual QString Solid::Ifaces::Battery::serial ( ) const
pure virtual

The serial number of the battery.

Returns
the serial number of the battery
Since
5.0
virtual Solid::Battery::Technology Solid::Ifaces::Battery::technology ( ) const
pure virtual

Retrieves the technology used to manufacture the battery.

Returns
the battery technology
See also
Solid::Battery::Technology
virtual double Solid::Ifaces::Battery::temperature ( ) const
pure virtual

The temperature of the battery in degrees Celsius.

Returns
the battery temperature in degrees Celsius
Since
5.0
virtual void Solid::Ifaces::Battery::temperatureChanged ( double  temperature,
const QString udi 
)
protectedpure virtual

This signal is emitted when the battery temperature has changed.

Parameters
temperaturethe new temperature of the battery in degrees Celsius
udithe UDI of the battery with the new temperature
Since
5.0
virtual qlonglong Solid::Ifaces::Battery::timeToEmpty ( ) const
pure virtual

Time (in seconds) until the battery is empty.

Returns
time until the battery is empty
Since
5.0
virtual void Solid::Ifaces::Battery::timeToEmptyChanged ( qlonglong  time,
const QString udi 
)
protectedpure virtual

This signal is emitted when the time until the battery is empty has changed.

Parameters
timethe new remaining time
udithe UDI of the battery with the new remaining time
Since
5.0
virtual qlonglong Solid::Ifaces::Battery::timeToFull ( ) const
pure virtual

Time (in seconds) until the battery is full.

Returns
time until the battery is full
Since
5.0
virtual void Solid::Ifaces::Battery::timeToFullChanged ( qlonglong  time,
const QString udi 
)
protectedpure virtual

This signal is emitted when the time until the battery is full has changed.

Parameters
timethe new remaining time
udithe UDI of the battery with the new remaining time
Since
5.0
virtual Solid::Battery::BatteryType Solid::Ifaces::Battery::type ( ) const
pure virtual

Retrieves the type of device holding this battery.

Returns
the type of device holding this battery
See also
Solid::Battery::BatteryType
virtual double Solid::Ifaces::Battery::voltage ( ) const
pure virtual

Voltage in the Cell or being recorded by the meter.

Returns
voltage in Volts
virtual void Solid::Ifaces::Battery::voltageChanged ( double  voltage,
const QString udi 
)
protectedpure virtual

This signal is emitted when the voltage in the cell has changed.

Parameters
voltagethe new voltage of the cell
udithe UDI of the battery with the new voltage
Since
5.0

The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Aug 10 2020 22:53:12 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.