epoc32/include/hwrmpowerstatesdkpskeys.h
author William Roberts <williamr@symbian.org>
Tue, 16 Mar 2010 16:12:26 +0000
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
child 4 837f303aceeb
permissions -rw-r--r--
Final list of Symbian^2 public API header files
     1 /*
     2 * Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). 
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     5 * under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
     8 *
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    11 *
    12 * Contributors:
    13 *
    14 * Description:  SDK Publish&Subscribe definitions of the
    15 *                HW Resource Manager for the Power State API.
    16 *
    17 */
    18 
    19 
    20 #ifndef HWRMPOWERSTATESDKPSKEYS_H
    21 #define HWRMPOWERSTATESDKPSKEYS_H
    22 
    23 // INCLUDES
    24 #include <e32std.h>
    25 
    26 /** 
    27 * @file hwrmpowerstatesdkpskeys.h
    28 * 
    29 * The API provides the P&S power state keys that are updated by the HW Resource 
    30 * Manager Server. These keys provide up-to-date information on the charging 
    31 * status, battery level and battery state of the device. Any application may 
    32 * subscribe to these P&S keys that are updated to receive notifications of 
    33 * any change in state.
    34 *
    35 * This interface relies on the Publish and Subscribe (P&S) interface provided
    36 * by Symbian. P&S is used by HW Resource Manager to globally publish the power
    37 * state information.
    38 *
    39 * The P&D UID is #KPSUidHWRMPowerState and following keys are provided:
    40 * - #KHWRMBatteryLevel
    41 * - #KHWRMBatteryStatus
    42 * - #KHWRMChargingStatus
    43 */
    44 
    45 /**
    46 * P&S UID for all power state information keys provided by this API.
    47 */
    48 const TUid KPSUidHWRMPowerState = { 0x10205041 }; 
    49 
    50 
    51 /**
    52 * P&S key to represent the battery level of the device. It can also be related
    53 * to the number of battery bars displayed. This property is updated only when
    54 * battery level changes. Valid values are defined by the enum #EPSHWRMBatteryLevel
    55 * and range from -1 to 7. <br>
    56 * If an error has occurred or the battery level has not yet been initialized, 
    57 * the enumeration value of #EBatteryLevelUnknown is used. In all other cases 
    58 * the battery level is used with level 0 being the lowest (battery empty) and 
    59 * level 7 the highest (battery full).
    60 *
    61 * @see EPSHWRMBatteryLevel
    62 */
    63 const TUint32 KHWRMBatteryLevel = 0x00000001;
    64 
    65 /**
    66 * Battery level of device. Can be related to the number of battery bars 
    67 * displayed by the device.
    68 */
    69 enum EPSHWRMBatteryLevel
    70     {
    71     EBatteryLevelUnknown        = -1,   ///< Uninitialized or some other error
    72     EBatteryLevelLevel0         = 0,    ///< Lowest battery level
    73     EBatteryLevelLevel1         = 1,
    74     EBatteryLevelLevel2         = 2,
    75     EBatteryLevelLevel3         = 3,
    76     EBatteryLevelLevel4         = 4,
    77     EBatteryLevelLevel5         = 5,
    78     EBatteryLevelLevel6         = 6,
    79     EBatteryLevelLevel7         = 7     ///< Highest battery level
    80     };
    81 
    82 
    83 /**
    84 * Battery status of device. 
    85 * This property may be updated to same status as previously, to indicate
    86 * the note in question needs to be shown again.
    87 *
    88 * #EBatteryStatusLow update comes approximately ten times before 
    89 * battery is completely empty and it comes at approximately
    90 * 10 minute intervals. If phone is in-call mode, update comes at 
    91 * approximately 1 minute intervals.
    92 *
    93 * #EBatteryStatusEmpty comes slightly before phone must power down 
    94 * automatically because of insufficient battery power.  
    95 *
    96 * @see EPSHWRMBatteryStatus
    97 */
    98 const TUint32 KHWRMBatteryStatus = 0x00000002;
    99 
   100 /**
   101 * Battery status of device.
   102 */
   103 enum EPSHWRMBatteryStatus
   104     {
   105     EBatteryStatusUnknown        = -1, ///< Uninitialized or some other error
   106     EBatteryStatusOk             = 0,  ///< This can also be used during charging
   107     EBatteryStatusLow            = 1,  ///< Show note to user "Battery low"
   108     EBatteryStatusEmpty          = 2   ///< Show "recharge battery" note to user
   109     };
   110 
   111 /**
   112 * Charging status of device.
   113 * This property is updated only when charging status changes.
   114 *
   115 * @see EPSHWRMChargingStatus
   116 */
   117 const TUint32 KHWRMChargingStatus = 0x00000003;
   118 
   119 /**
   120 * Charging status of device.
   121 */
   122 enum EPSHWRMChargingStatus
   123     {
   124     EChargingStatusError              = -1, ///< Some error has occurred when charger is connected or charging. 
   125     EChargingStatusNotConnected       = 0,  ///< Charger not connected/uninitialized
   126     EChargingStatusCharging           = 1,  ///< Device is charging
   127     EChargingStatusNotCharging        = 2,  ///< Charger is connected, device not charging
   128     EChargingStatusAlmostComplete     = 3,  ///< Charging almost completed
   129     EChargingStatusChargingComplete   = 4,  ///< Charging completed
   130     EChargingStatusChargingContinued  = 5   ///< Charging continued after brief interruption
   131     };
   132 
   133 
   134 #endif      // HWRMPOWERSTATESDKPSKEYS_H