Solid
Solid::Battery Class Reference
#include <battery.h>

Detailed Description
This device interface is available on batteries.Definition at line 35 of file battery.h.
Public Types | |
enum | BatteryType { UnknownBattery, PdaBattery, UpsBattery, PrimaryBattery, MouseBattery, KeyboardBattery, KeyboardMouseBattery, CameraBattery } |
enum | ChargeState { NoCharge, Charging, Discharging } |
Signals | |
void | chargePercentChanged (int value, const QString &udi) |
void | chargeStateChanged (int newState, const QString &udi) |
void | plugStateChanged (bool newState, const QString &udi) |
Public Member Functions | |
int | chargePercent () const |
ChargeState | chargeState () const |
bool | isPlugged () const |
bool | isRechargeable () const |
BatteryType | type () const |
virtual | ~Battery () |
Static Public Member Functions | |
static Type | deviceInterfaceType () |
Properties | |
int | chargePercent |
ChargeState | chargeState |
bool | plugged |
bool | rechargeable |
BatteryType | type |
Member Enumeration Documentation
This enum type defines the type of the device holding the battery.
- PdaBattery : A battery in a Personal Digital Assistant
- UpsBattery : A battery in an Uninterruptible Power Supply
- PrimaryBattery : A primary battery for the system (for example laptop battery)
- MouseBattery : A battery in a mouse
- KeyboardBattery : A battery in a keyboard
- KeyboardMouseBattery : A battery in a combined keyboard and mouse
- CameraBattery : A battery in a camera
- UnknownBattery : A battery in an unknown device
Constructor & Destructor Documentation
Solid::Battery::~Battery | ( | ) | [virtual] |
Member Function Documentation
int Solid::Battery::chargePercent | ( | ) | const |
Retrieves the current charge level of the battery normalised to percent.
- Returns:
- the current charge level normalised to percent
void Solid::Battery::chargePercentChanged | ( | int | value, | |
const QString & | udi | |||
) | [signal] |
This signal is emitted when the charge percent value of this battery has changed.
- Parameters:
-
value the new charge percent value of the battery udi the UDI of the battery with the new charge percent
ChargeState Solid::Battery::chargeState | ( | ) | const |
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
void Solid::Battery::chargeStateChanged | ( | int | newState, | |
const QString & | udi | |||
) | [signal] |
This signal is emitted when the charge state of this battery has changed.
- Parameters:
-
newState the new charge state of the battery, it's one of the type Solid::Battery::ChargeState
- See also:
- Solid::Battery::ChargeState
- Parameters:
-
udi the UDI of the battery with the new charge state
static Type Solid::Battery::deviceInterfaceType | ( | ) | [inline, static] |
Get the Solid::DeviceInterface::Type of the Battery device interface.
- Returns:
- the Battery device interface type
- See also:
- Solid::DeviceInterface::Type
bool Solid::Battery::isPlugged | ( | ) | const |
Indicates if this battery is plugged.
- Returns:
- true if the battery is plugged, false otherwise
Definition at line 44 of file battery.cpp.
bool Solid::Battery::isRechargeable | ( | ) | const |
Indicates if the battery is rechargeable.
- Returns:
- true if the battery is rechargeable, false otherwise (one time usage)
Definition at line 62 of file battery.cpp.
void Solid::Battery::plugStateChanged | ( | bool | newState, | |
const QString & | udi | |||
) | [signal] |
This signal is emitted if the battery get plugged in/out of the battery bay.
- Parameters:
-
newState the new plugging state of the battery, type is boolean udi the UDI of the battery with the new plugging state
BatteryType Solid::Battery::type | ( | ) | const |
Retrieves the type of device holding this battery.
- Returns:
- the type of device holding this battery
- See also:
- Solid::Battery::BatteryType
Property Documentation
Solid::Battery::ChargeState Solid::Battery::chargeState [read] |
Solid::Battery::BatteryType Solid::Battery::type [read] |
The documentation for this class was generated from the following files: