Home · All Namespaces · All Classes
Public Slots | Signals | Public Member Functions

LowBatteryNotifier Class Reference

#include <batterybusinesslogic.h>

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

List of all members.

Public Slots

void showLowBatteryNotification ()

Signals

void lowBatteryAlert ()

Public Member Functions

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

Detailed Description

Please note that this class will emit the lowBatteryAlert() when the user needed to be alerted about the low battery condition, that is this class will not generate new notifications. The BatteryBusinessLogic will connect to this signal and handle the notifications.

Definition at line 41 of file batterybusinesslogic.h.


Constructor & Destructor Documentation

LowBatteryNotifier::LowBatteryNotifier ( QObject parent = 0  ) 

Definition at line 42 of file batterybusinesslogic.cpp.

                         :
        QObject (parent),
        m_Timer (new QTimer (this)),
        m_Sleep (false)
{
    m_ActiveInterval = LowBatteryActiveInterval;
    m_InactiveInterval = LowBatteryInactiveInterval;
    m_Time.start ();

#ifdef HAVE_QMSYSTEM
    m_Display = new MeeGo::QmDisplayState;
    m_Sleep = m_Display->get () == MeeGo::QmDisplayState::Off;
    connect (m_Display,
            SIGNAL (displayStateChanged (MeeGo::QmDisplayState::DisplayState)),
            this,
            SLOT (displayStateChanged (MeeGo::QmDisplayState::DisplayState)));
#endif

    connect (m_Timer, SIGNAL (timeout ()),
            this, SLOT (showLowBatteryNotification ()));
}

Here is the call graph for this function:

LowBatteryNotifier::~LowBatteryNotifier (  )  [virtual]

Definition at line 65 of file batterybusinesslogic.cpp.

{
}


Member Function Documentation

void LowBatteryNotifier::lowBatteryAlert (  )  [signal]
void LowBatteryNotifier::showLowBatteryNotification (  )  [slot]

Definition at line 71 of file batterybusinesslogic.cpp.

{
    emit lowBatteryAlert ();

    m_Time.start (); //restart time

#ifdef HAVE_QMSYSTEM
    switch (m_Display->get ()) {
        case MeeGo::QmDisplayState::On:
        case MeeGo::QmDisplayState::Dimmed:
            m_Sleep = false;
            m_Timer->start (m_ActiveInterval);
            break;

        case MeeGo::QmDisplayState::Off:
            m_Sleep = true;
            m_Timer->start (m_InactiveInterval);
            break;

        default:
            break;
    }
#endif
}

Here is the call graph for this function:


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

Copyright © 2010 Nokia Corporation Generated on Thu Nov 4 2010 18:19:35
Doxygen 1.7.1
MeeGo Touch