forked from nemomobile-graveyard/meegotouch-systemui
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RevBy: TrustMe
- Loading branch information
Vesa Halttunen
committed
Jun 9, 2011
1 parent
9a7427d
commit aac785a
Showing
73 changed files
with
510 additions
and
636 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,32 @@ | ||
/**************************************************************************** | ||
** | ||
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary (-ies). | ||
** All rights reserved. | ||
** Contact: Nokia Corporation ([email protected]) | ||
** | ||
** This file is part of systemui. | ||
** | ||
** If you have questions regarding the use of this file, please contact | ||
** Nokia at [email protected]. | ||
** | ||
** This library is free software; you can redistribute it and/or | ||
** modify it under the terms of the GNU Lesser General Public | ||
** License version 2.1 as published by the Free Software Foundation | ||
** and appearing in the file LICENSE.LGPL included in the packaging | ||
** of this file. | ||
** | ||
****************************************************************************/ | ||
** | ||
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary (-ies). | ||
** All rights reserved. | ||
** Contact: Nokia Corporation ([email protected]) | ||
** | ||
** This file is part of systemui. | ||
** | ||
** If you have questions regarding the use of this file, please contact | ||
** Nokia at [email protected]. | ||
** | ||
** This library is free software; you can redistribute it and/or | ||
** modify it under the terms of the GNU Lesser General Public | ||
** License version 2.1 as published by the Free Software Foundation | ||
** and appearing in the file LICENSE.LGPL included in the packaging | ||
** of this file. | ||
** | ||
****************************************************************************/ | ||
#ifndef BATTERYBUSINESSLOGIC_H | ||
#define BATTERYBUSINESSLOGIC_H | ||
|
||
#include <QObject> | ||
#include <QTime> | ||
|
||
#ifdef HAVE_QMSYSTEM | ||
#include <qmled.h> | ||
#include <qmbattery.h> | ||
#include <qmdevicemode.h> | ||
#include <qmdisplaystate.h> | ||
#include <qmled.h> | ||
#include <qmbattery.h> | ||
#include <qmdevicemode.h> | ||
#include <qmdisplaystate.h> | ||
#endif | ||
|
||
class QTimer; | ||
|
@@ -38,34 +38,33 @@ class MNotification; | |
* not generate new notifications. The BatteryBusinessLogic will connect to this | ||
* signal and handle the notifications. | ||
*/ | ||
class LowBatteryNotifier : public QObject | ||
{ | ||
class LowBatteryNotifier: public QObject { | ||
Q_OBJECT | ||
|
||
public: | ||
LowBatteryNotifier (QObject* parent = 0); | ||
virtual ~LowBatteryNotifier (); | ||
LowBatteryNotifier(QObject* parent = 0); | ||
virtual ~LowBatteryNotifier(); | ||
|
||
public slots: | ||
void showLowBatteryNotification (); | ||
void showLowBatteryNotification(); | ||
|
||
private slots: | ||
#ifdef HAVE_QMSYSTEM | ||
void displayStateChanged (MeeGo::QmDisplayState::DisplayState state); | ||
#endif | ||
|
||
signals: | ||
void lowBatteryAlert (); | ||
void lowBatteryAlert(); | ||
|
||
private: | ||
#ifdef HAVE_QMSYSTEM | ||
MeeGo::QmDisplayState *m_Display; | ||
MeeGo::QmDisplayState *m_Display; | ||
#endif | ||
QTimer *m_Timer; | ||
QTime m_Time; | ||
bool m_Sleep; | ||
int m_ActiveInterval; | ||
int m_InactiveInterval; | ||
QTimer *m_Timer; | ||
QTime m_Time; | ||
bool m_Sleep; | ||
int m_ActiveInterval; | ||
int m_InactiveInterval; | ||
|
||
#ifdef UNIT_TEST | ||
friend class Ut_LowBatteryNotifier; | ||
|
@@ -75,13 +74,12 @@ private slots: | |
/*! | ||
* Implements the configuration and state for the battery, the power save mode. | ||
*/ | ||
class BatteryBusinessLogic : public QObject | ||
{ | ||
class BatteryBusinessLogic : public QObject { | ||
Q_OBJECT | ||
|
||
public: | ||
BatteryBusinessLogic (QObject* parent = 0); | ||
virtual ~BatteryBusinessLogic (); | ||
BatteryBusinessLogic(QObject* parent = 0); | ||
virtual ~BatteryBusinessLogic(); | ||
|
||
typedef enum { | ||
NotificationCharging, | ||
|
@@ -92,22 +90,19 @@ class BatteryBusinessLogic : public QObject | |
NotificationEnteringPSM, | ||
NotificationExitingPSM, | ||
NotificationLowBattery, | ||
NotificationNoEnoughPower, | ||
NotificationNoEnoughPower | ||
} NotificationID; | ||
|
||
signals: | ||
/* | ||
* To simplify the test case we use this signal that we can catch. See | ||
* NB#171466 for further details. | ||
*/ | ||
void notificationSent ( | ||
QString eventType, | ||
QString text, | ||
QString icon); | ||
void notificationSent(QString eventType, QString text, QString icon); | ||
|
||
public slots: | ||
void initBattery (); | ||
void lowBatteryAlert (); | ||
void initBattery(); | ||
void lowBatteryAlert(); | ||
|
||
private slots: | ||
#ifdef HAVE_QMSYSTEM | ||
|
@@ -116,24 +111,21 @@ private slots: | |
void batteryChargerEvent (MeeGo::QmBattery::ChargerType type); | ||
void devicePSMStateChanged (MeeGo::QmDeviceMode::PSMState PSMState); | ||
#endif | ||
void utiliseLED (bool activate, const QString &pattern); | ||
void utiliseLED(bool activate, const QString &pattern); | ||
|
||
private: | ||
void sendNotification (BatteryBusinessLogic::NotificationID id); | ||
void sendNotification ( | ||
const QString &eventType, | ||
const QString &text, | ||
const QString &icon = QString("")); | ||
void sendNotification(BatteryBusinessLogic::NotificationID id); | ||
void sendNotification(const QString &eventType, const QString &text, const QString &icon = QString("")); | ||
void removeNotification(const QString &eventType); | ||
QString chargingImageId (); | ||
QString chargingImageId(); | ||
|
||
LowBatteryNotifier *m_LowBatteryNotifier; | ||
MNotification *m_notification; | ||
LowBatteryNotifier *m_LowBatteryNotifier; | ||
MNotification *m_notification; | ||
#ifdef HAVE_QMSYSTEM | ||
MeeGo::QmBattery *m_Battery; | ||
MeeGo::QmDeviceMode *m_DeviceMode; | ||
MeeGo::QmLED *m_Led; | ||
MeeGo::QmBattery::ChargerType m_ChargerType; | ||
MeeGo::QmBattery *m_Battery; | ||
MeeGo::QmDeviceMode *m_DeviceMode; | ||
MeeGo::QmLED *m_Led; | ||
MeeGo::QmBattery::ChargerType m_ChargerType; | ||
#endif | ||
|
||
#ifdef UNIT_TEST | ||
|
@@ -142,6 +134,4 @@ private slots: | |
#endif | ||
}; | ||
|
||
|
||
#endif | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.