Battery Class Reference

class representing one single battery More...

#include <battery.h>

List of all members.

Public Member Functions

 Battery ()
 constructor
BATTERY_STATES batteryState ()
 get the current state the battery is in
int updateBatteryState (int ac_state, EventManagement *eM)
 update the battery state
int chargingState ()
 get the current charging state
int remainingTime ()
 get remaining time until battery is empty
int remainingPercent ()
 get remaining percentage until battery is empty
int remainingChargingTime ()
 return remaining time until battery is fully charged
void resetState ()
 reset the battery state to BAT_NORM state

Private Attributes

BATTERY_STATES _battery_state
 holds the current battery state
BatteryGeneral _bg
 holds battery info for client requests
unsigned _msecs_last_battery_read
 sums up time since battery was last polled


Detailed Description

class representing one single battery


Constructor & Destructor Documentation

Battery::Battery  ) 
 

constructor


Member Function Documentation

BATTERY_STATES Battery::batteryState  ) 
 

get the current state the battery is in

Returns:
the current battery state

int Battery::chargingState  ) 
 

get the current charging state

Returns:
current charging state

int Battery::remainingChargingTime  ) 
 

return remaining time until battery is fully charged

Returns:
remaining charging time

int Battery::remainingPercent  ) 
 

get remaining percentage until battery is empty

Returns:
remaining percent

int Battery::remainingTime  ) 
 

get remaining time until battery is empty

Returns:
remaining time in minutes

void Battery::resetState  ) 
 

reset the battery state to BAT_NORM state

I'm not exactly sure whether this is needed

int Battery::updateBatteryState int  ac_state,
EventManagement eM
 

update the battery state

Returns:
integer with current battery state
Return values:
-1 on failure
0 when state did not change
1 when a lower battery level is reached
2 when a higher battery level is reached


Member Data Documentation

BATTERY_STATES Battery::_battery_state [private]
 

holds the current battery state

BatteryGeneral Battery::_bg [private]
 

holds battery info for client requests

unsigned Battery::_msecs_last_battery_read [private]
 

sums up time since battery was last polled

not private, because it needs to be reset on ACPI event from outside.


The documentation for this class was generated from the following files:
Generated on Mon Mar 27 09:27:19 2006 for Powersave Daemon by  doxygen 1.4.6