epoc32/include/hwrmpowerstatesdkpskeys.h
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
child 4 837f303aceeb
     1.1 --- a/epoc32/include/hwrmpowerstatesdkpskeys.h	Tue Nov 24 13:55:44 2009 +0000
     1.2 +++ b/epoc32/include/hwrmpowerstatesdkpskeys.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -1,1 +1,134 @@
     1.4 -hwrmpowerstatesdkpskeys.h
     1.5 +/*
     1.6 +* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). 
     1.7 +* All rights reserved.
     1.8 +* This component and the accompanying materials are made available
     1.9 +* 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
    1.10 +* which accompanies this distribution, and is available
    1.11 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.12 +*
    1.13 +* Initial Contributors:
    1.14 +* Nokia Corporation - initial contribution.
    1.15 +*
    1.16 +* Contributors:
    1.17 +*
    1.18 +* Description:  SDK Publish&Subscribe definitions of the
    1.19 +*                HW Resource Manager for the Power State API.
    1.20 +*
    1.21 +*/
    1.22 +
    1.23 +
    1.24 +#ifndef HWRMPOWERSTATESDKPSKEYS_H
    1.25 +#define HWRMPOWERSTATESDKPSKEYS_H
    1.26 +
    1.27 +// INCLUDES
    1.28 +#include <e32std.h>
    1.29 +
    1.30 +/** 
    1.31 +* @file hwrmpowerstatesdkpskeys.h
    1.32 +* 
    1.33 +* The API provides the P&S power state keys that are updated by the HW Resource 
    1.34 +* Manager Server. These keys provide up-to-date information on the charging 
    1.35 +* status, battery level and battery state of the device. Any application may 
    1.36 +* subscribe to these P&S keys that are updated to receive notifications of 
    1.37 +* any change in state.
    1.38 +*
    1.39 +* This interface relies on the Publish and Subscribe (P&S) interface provided
    1.40 +* by Symbian. P&S is used by HW Resource Manager to globally publish the power
    1.41 +* state information.
    1.42 +*
    1.43 +* The P&D UID is #KPSUidHWRMPowerState and following keys are provided:
    1.44 +* - #KHWRMBatteryLevel
    1.45 +* - #KHWRMBatteryStatus
    1.46 +* - #KHWRMChargingStatus
    1.47 +*/
    1.48 +
    1.49 +/**
    1.50 +* P&S UID for all power state information keys provided by this API.
    1.51 +*/
    1.52 +const TUid KPSUidHWRMPowerState = { 0x10205041 }; 
    1.53 +
    1.54 +
    1.55 +/**
    1.56 +* P&S key to represent the battery level of the device. It can also be related
    1.57 +* to the number of battery bars displayed. This property is updated only when
    1.58 +* battery level changes. Valid values are defined by the enum #EPSHWRMBatteryLevel
    1.59 +* and range from -1 to 7. <br>
    1.60 +* If an error has occurred or the battery level has not yet been initialized, 
    1.61 +* the enumeration value of #EBatteryLevelUnknown is used. In all other cases 
    1.62 +* the battery level is used with level 0 being the lowest (battery empty) and 
    1.63 +* level 7 the highest (battery full).
    1.64 +*
    1.65 +* @see EPSHWRMBatteryLevel
    1.66 +*/
    1.67 +const TUint32 KHWRMBatteryLevel = 0x00000001;
    1.68 +
    1.69 +/**
    1.70 +* Battery level of device. Can be related to the number of battery bars 
    1.71 +* displayed by the device.
    1.72 +*/
    1.73 +enum EPSHWRMBatteryLevel
    1.74 +    {
    1.75 +    EBatteryLevelUnknown        = -1,   ///< Uninitialized or some other error
    1.76 +    EBatteryLevelLevel0         = 0,    ///< Lowest battery level
    1.77 +    EBatteryLevelLevel1         = 1,
    1.78 +    EBatteryLevelLevel2         = 2,
    1.79 +    EBatteryLevelLevel3         = 3,
    1.80 +    EBatteryLevelLevel4         = 4,
    1.81 +    EBatteryLevelLevel5         = 5,
    1.82 +    EBatteryLevelLevel6         = 6,
    1.83 +    EBatteryLevelLevel7         = 7     ///< Highest battery level
    1.84 +    };
    1.85 +
    1.86 +
    1.87 +/**
    1.88 +* Battery status of device. 
    1.89 +* This property may be updated to same status as previously, to indicate
    1.90 +* the note in question needs to be shown again.
    1.91 +*
    1.92 +* #EBatteryStatusLow update comes approximately ten times before 
    1.93 +* battery is completely empty and it comes at approximately
    1.94 +* 10 minute intervals. If phone is in-call mode, update comes at 
    1.95 +* approximately 1 minute intervals.
    1.96 +*
    1.97 +* #EBatteryStatusEmpty comes slightly before phone must power down 
    1.98 +* automatically because of insufficient battery power.  
    1.99 +*
   1.100 +* @see EPSHWRMBatteryStatus
   1.101 +*/
   1.102 +const TUint32 KHWRMBatteryStatus = 0x00000002;
   1.103 +
   1.104 +/**
   1.105 +* Battery status of device.
   1.106 +*/
   1.107 +enum EPSHWRMBatteryStatus
   1.108 +    {
   1.109 +    EBatteryStatusUnknown        = -1, ///< Uninitialized or some other error
   1.110 +    EBatteryStatusOk             = 0,  ///< This can also be used during charging
   1.111 +    EBatteryStatusLow            = 1,  ///< Show note to user "Battery low"
   1.112 +    EBatteryStatusEmpty          = 2   ///< Show "recharge battery" note to user
   1.113 +    };
   1.114 +
   1.115 +/**
   1.116 +* Charging status of device.
   1.117 +* This property is updated only when charging status changes.
   1.118 +*
   1.119 +* @see EPSHWRMChargingStatus
   1.120 +*/
   1.121 +const TUint32 KHWRMChargingStatus = 0x00000003;
   1.122 +
   1.123 +/**
   1.124 +* Charging status of device.
   1.125 +*/
   1.126 +enum EPSHWRMChargingStatus
   1.127 +    {
   1.128 +    EChargingStatusError              = -1, ///< Some error has occurred when charger is connected or charging. 
   1.129 +    EChargingStatusNotConnected       = 0,  ///< Charger not connected/uninitialized
   1.130 +    EChargingStatusCharging           = 1,  ///< Device is charging
   1.131 +    EChargingStatusNotCharging        = 2,  ///< Charger is connected, device not charging
   1.132 +    EChargingStatusAlmostComplete     = 3,  ///< Charging almost completed
   1.133 +    EChargingStatusChargingComplete   = 4,  ///< Charging completed
   1.134 +    EChargingStatusChargingContinued  = 5   ///< Charging continued after brief interruption
   1.135 +    };
   1.136 +
   1.137 +
   1.138 +#endif      // HWRMPOWERSTATESDKPSKEYS_H