]>
git.saurik.com Git - apple/xnu.git/blob - iokit/IOKit/pwr_mgt/IOPMPowerSource.h
4deaf8ad70b1830fc0bb5686b4720482b88ddcec
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
23 * @APPLE_LICENSE_HEADER_END@
25 #include <libkern/c++/OSObject.h>
26 #include <IOKit/IOTypes.h>
27 #include <IOKit/IOReturn.h>
32 const unsigned long kSecondsPerHour
= (60*60);
33 const unsigned long kTenMinutesInSeconds
= (10 * 60);
35 // our battery (power source) object
37 class IOPMPowerSource
: public OSObject
39 OSDeclareDefaultStructors(IOPMPowerSource
)
44 UInt32 bTimeRemaining
;
53 IOPMPowerSource
* nextInList
;
55 bool init (unsigned short whichBatteryIndex
);
56 unsigned long capacityPercentRemaining (void);
57 bool atWarnLevel (void);
62 bool isInstalled (void);
63 bool isCharging (void);
64 bool acConnected (void);
65 unsigned long timeRemaining (void);
66 unsigned long maxCapacity (void);
67 unsigned long curCapacity (void);
68 long currentDrawn (void);
69 unsigned long voltage (void);
73 // function updateStatus is called whenever the system needs
74 // to obtain the latest power source state...must be overridden
76 virtual void updateStatus (void);