coreapplicationuis/SysAp/Inc/sysapbatteryinfocontroller.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 31 Aug 2010 15:24:25 +0300
branchRCL_3
changeset 19 924385140d98
parent 3 096dad6e50a9
child 20 c2c61fdca848
permissions -rw-r--r--
Revision: 201033 Kit: 201035

/*
* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description:  CSysApBatteryInfoController class declaration
*
*/


#ifndef SYSAPBATTERYINFOCONTROLLER_H
#define SYSAPBATTERYINFOCONTROLLER_H

#include <e32base.h>

class CBSUtil;
// class CBatteryPopupControl;

/**
 *  Controller for enhanced battery information.
 *
 *  @lib None.
 *  @since S60 5.0
 */
class CSysApBatteryInfoController : public CBase
    {

    /**
    * States for battery information.
    */
    enum TBatteryInfoState
        {
        /**
        * Battery capacity is below defined threshold. 
        * The battery information is displayed every time when
        * the battery capacity decreases.
        */
        EBatteryInfoBelowThreshold,
        
        /**
        * Battery capacity is above defined threshold.
        * The battery information is not shown
        */
        EBatteryInfoAboveThreshold,
        
        /**
        * Battery status is low or empty.
        * The battery information is not shown.
        */
        EBatteryInfoStatusLow
        };

public:    
    /**
    * Symbian two-phase controller.
    *
    * @since S60 5.0
    * @param aThreshold battery capacity percentage after which enhanced battery information
    *                   is displayed.
    */
    static CSysApBatteryInfoController* NewL( TInt aThreshold );

    /**
    * Destructor.
    */
    virtual ~CSysApBatteryInfoController();

    /**
     * Power menu has been displayed.
     * Displays the enhanced battery information.
     *
     * @since S60 5.0
     */
     void PowerMenuShownL();
     
     /**
     * Battery level indicator has been updated.
     * Displays the enhanced battery information if needed.
     *
     * @since S60 5.0
     */
     void BatteryLevelUpdatedL();
     
     /**
     * Battery status has been updated.
     * Stops displaying the battery information even if the battery level
     * is below the threshold value and continues to decrease.
     *
     * @since S60 5.0
     * @param aValue battery status
     *
     * @see KHWRMBatteryStatus
     */
     void BatteryStatusUpdated( const TInt aValue );

private:

    /**
    * C++ default constructor.
    */
    CSysApBatteryInfoController();

    /**
    * Constructor.
    */
    CSysApBatteryInfoController( TInt aThreshold );
    
    /**
    * Symbian 2nd-phase constructor.
    */
    void ConstructL();

    /**
    * Displays the battery pane popup.
    */
    void ShowBatteryPreviewPopupL( TInt aCapacity );

private: // data
    
    /**
    * Battery State utility.
    * Own.
    */
    CBSUtil* iBsUtil;
    
    /**
    * Battery capacity percentage which is currently shown.
    */
    TInt iCurrentCapacity;
    
    /**
    * Battery capacity percentage after which the enhanced battery 
    * information is shown for the first time.
    */
    TInt iThresholdCapacity;
    
    /**
    * Battery info state.
    */
    TBatteryInfoState iBatteryInfoState;
    
    /**
    * Battery popup control.
    * Own.
    */
    // CBatteryPopupControl* iBatteryPopup;
    };


#endif // SYSAPBATTERYINFOCONTROLLER_H