]>
git.saurik.com Git - apple/xnu.git/blob - iokit/IOKit/pwr_mgt/IOPMPowerSource.h
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
20 * @APPLE_LICENSE_HEADER_END@
22 #include <libkern/c++/OSObject.h>
23 #include <IOKit/IOTypes.h>
24 #include <IOKit/IOReturn.h>
29 const unsigned long kSecondsPerHour
= (60*60);
30 const unsigned long kTenMinutesInSeconds
= (10 * 60);
32 // our battery (power source) object
34 class IOPMPowerSource
: public OSObject
36 OSDeclareDefaultStructors(IOPMPowerSource
)
41 UInt32 bTimeRemaining
;
50 IOPMPowerSource
* nextInList
;
52 bool init (unsigned short whichBatteryIndex
);
53 unsigned long capacityPercentRemaining (void);
54 bool atWarnLevel (void);
59 bool isInstalled (void);
60 bool isCharging (void);
61 bool acConnected (void);
62 unsigned long timeRemaining (void);
63 unsigned long maxCapacity (void);
64 unsigned long curCapacity (void);
65 long currentDrawn (void);
66 unsigned long voltage (void);
70 // function updateStatus is called whenever the system needs
71 // to obtain the latest power source state...must be overridden
73 virtual void updateStatus (void);