1/*
2 * Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23/*
24 * Copyright (c) 2002 Apple Computer, Inc.  All rights reserved.
25 *
26 * HISTORY
27 *
28 * 29-Aug-02 ebold created
29 *
30*/
31#include "PrivateLib.h"
32
33#ifndef _BatteryTimeRemaining_h_
34#define _BatteryTimeRemaining_h_
35
36
37__private_extern__ void BatteryTimeRemaining_prime(void);
38
39__private_extern__ void BatteryTimeRemainingSleepWakeNotification(natural_t messageType);
40
41__private_extern__ void BatteryTimeRemainingRTCDidResync(void);
42
43/*!
44 * Pass kInternalBattery to kernelPowerSourcesDidChange when you need
45 * PM to re-evaluate the single internal battery (modeled as an IOPMPowerSource)
46 * inside your device.
47 */
48#define kInternalBattery      NULL
49__private_extern__ void kernelPowerSourcesDidChange(IOPMBattery *battery_info);
50
51__private_extern__ bool BatteryHandleDeadName(mach_port_t deadName);
52
53__private_extern__ void BatterySetNoPoll(bool noPoll);
54
55__private_extern__ bool isFullyCharged(IOPMBattery *b);
56
57
58/* getActivePSType
59 * returns one of AC, Internal Battery, or External Battery
60 */
61__private_extern__ int getActivePSType(void);
62__private_extern__ CFDictionaryRef getActiveBatteryDictionary(void);
63__private_extern__ CFDictionaryRef getActiveUPSDictionary(void);
64
65
66#ifndef kIOPSFailureKey
67#define kIOPSFailureKey                         "Failure"
68#endif
69
70#define kBatteryPermFailureString               "Permanent Battery Failure"
71
72#ifndef kIOPMBatteryPercentageFactors
73#define kIOPMBatteryPercentageFactors           CFSTR("IOPMBatteryPercentageFactors")
74#endif
75
76#ifndef kIOPSDynamicStorePowerAdapterKey
77#define kIOPSDynamicStorePowerAdapterKey        "/IOKit/PowerAdapter"
78#endif
79
80#ifndef kIOPSDynamicStoreLowBattPathKey
81#define kIOPSDynamicStoreLowBattPathKey         "/IOKit/LowBatteryWarning"
82#endif
83
84
85#endif //_BatteryTimeRemaining_h_
86