Home · All Namespaces · All Classes

BatteryBusinessLogic Class Reference

#include <batterybusinesslogic.h>

Inheritance diagram for BatteryBusinessLogic:
Inheritance graph
[legend]
Collaboration diagram for BatteryBusinessLogic:
Collaboration graph
[legend]

List of all members.

Public Types

enum  NotificationID {
  NotificationCharging, NotificationChargingComplete, NotificationRemoveCharger, NotificationChargingNotStarted,
  NotificationRechargeBattery, NotificationEnteringPSM, NotificationExitingPSM, NotificationLowBattery,
  NotificationNoEnoughPower
}

Public Slots

void initBattery ()
void lowBatteryAlert ()

Signals

void notificationSent (QString eventType, QString text, QString icon)

Public Member Functions

 BatteryBusinessLogic (QObject *parent=0)
virtual ~BatteryBusinessLogic ()

Detailed Description

Implements the configuration and state for the battery, the power save mode.

Definition at line 78 of file batterybusinesslogic.h.


Member Enumeration Documentation

Enumerator:
NotificationCharging 
NotificationChargingComplete 
NotificationRemoveCharger 
NotificationChargingNotStarted 
NotificationRechargeBattery 
NotificationEnteringPSM 
NotificationExitingPSM 
NotificationLowBattery 
NotificationNoEnoughPower 

Definition at line 86 of file batterybusinesslogic.h.


Constructor & Destructor Documentation

BatteryBusinessLogic::BatteryBusinessLogic ( QObject parent = 0  ) 

Definition at line 131 of file batterybusinesslogic.cpp.

00132                                :
00133     QObject (parent),
00134     m_LowBatteryNotifier (0),
00135     m_notification (0)
00136 #ifdef HAVE_QMSYSTEM
00137    ,m_Battery (new MeeGo::QmBattery),
00138     m_DeviceMode (new MeeGo::QmDeviceMode),
00139     m_Led (new MeeGo::QmLED),
00140     m_ChargerType (MeeGo::QmBattery::Unknown)
00141 #endif
00142 {
00143 #ifdef HAVE_QMSYSTEM
00144     /* connect to QmSystem signals */
00145     connect (m_Battery,
00146              SIGNAL (batteryStateChanged (MeeGo::QmBattery::BatteryState)),
00147              this,
00148              SLOT (batteryStateChanged (MeeGo::QmBattery::BatteryState)));
00149     connect (m_Battery,
00150              SIGNAL (chargingStateChanged (MeeGo::QmBattery::ChargingState)),
00151              this,
00152              SLOT (chargingStateChanged (MeeGo::QmBattery::ChargingState)));
00153     connect (m_Battery,
00154              SIGNAL (chargerEvent (MeeGo::QmBattery::ChargerType)),
00155              this,
00156              SLOT (batteryChargerEvent (MeeGo::QmBattery::ChargerType)));
00157 
00158     connect (m_DeviceMode,
00159              SIGNAL (devicePSMStateChanged (MeeGo::QmDeviceMode::PSMState)),
00160              this,
00161              SLOT (devicePSMStateChanged (MeeGo::QmDeviceMode::PSMState)));
00162 #endif
00163 
00164     // Init battery values delayed...
00165     initBattery ();
00166 }

Here is the call graph for this function:

BatteryBusinessLogic::~BatteryBusinessLogic (  )  [virtual]

Definition at line 169 of file batterybusinesslogic.cpp.

00170 {
00171 #ifdef HAVE_QMSYSTEM
00172     delete m_Battery;
00173     m_Battery = NULL;
00174 
00175     delete m_DeviceMode;
00176     m_DeviceMode = NULL;
00177 
00178     delete m_Led;
00179     m_Led = NULL;
00180 #endif
00181 }


Member Function Documentation

void BatteryBusinessLogic::initBattery (  )  [slot]

Definition at line 186 of file batterybusinesslogic.cpp.

00187 {
00188 #ifdef HAVE_QMSYSTEM
00189     //init the charging status
00190     chargingStateChanged (m_Battery->getChargingState ());
00191 
00192     //init the battery level
00193     batteryStateChanged (m_Battery->getBatteryState ());
00194 #endif
00195 }

void BatteryBusinessLogic::lowBatteryAlert (  )  [slot]

This slot is called by the low battery notifier to send the notifications.

Definition at line 201 of file batterybusinesslogic.cpp.

00202 {
00203     sendNotification (NotificationLowBattery);
00204 }

void BatteryBusinessLogic::notificationSent ( QString  eventType,
QString  text,
QString  icon 
) [signal]

The documentation for this class was generated from the following files:

Copyright © 2010 Nokia Corporation Generated on Wed Nov 10 16:05:02 2010
Doxygen 1.6.1
MeeGo Touch