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