• Skip to content
  • Skip to link menu
KDE 4.1 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

Solid

Solid::Battery

Solid::Battery Class Reference

#include <battery.h>

Inheritance diagram for Solid::Battery:

Inheritance graph
[legend]

List of all members.


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

enum Solid::Battery::BatteryType

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
Enumerator:
UnknownBattery 
PdaBattery 
UpsBattery 
PrimaryBattery 
MouseBattery 
KeyboardBattery 
KeyboardMouseBattery 
CameraBattery 

Definition at line 60 of file battery.h.

enum Solid::Battery::ChargeState

This enum type defines charge state of a battery.

  • NoCharge : Battery charge is stable, not charging or discharging or the state is Unknown
  • Charging : Battery is charging
  • Discharging : Battery is discharging
Enumerator:
NoCharge 
Charging 
Discharging 

Definition at line 72 of file battery.h.


Constructor & Destructor Documentation

Solid::Battery::~Battery (  )  [virtual]

Destroys a Battery object.

Definition at line 39 of file battery.cpp.


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

Definition at line 99 of file battery.h.

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

int Solid::Battery::chargePercent [read]

Definition at line 41 of file battery.h.

Solid::Battery::ChargeState Solid::Battery::chargeState [read]

Definition at line 43 of file battery.h.

bool Solid::Battery::plugged [read]

Definition at line 39 of file battery.h.

bool Solid::Battery::rechargeable [read]

Definition at line 42 of file battery.h.

Solid::Battery::BatteryType Solid::Battery::type [read]

Definition at line 40 of file battery.h.


The documentation for this class was generated from the following files:
  • battery.h
  • battery.cpp

Solid

Skip menu "Solid"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • KIO
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal