1/*
2 *
3 * @APPLE_LICENSE_HEADER_START@
4 *
5 * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
6 *
7 * This file contains Original Code and/or Modifications of Original Code
8 * as defined in and that are subject to the Apple Public Source License
9 * Version 2.0 (the 'License'). You may not use this file except in
10 * compliance with the License. Please obtain a copy of the License at
11 * http://www.opensource.apple.com/apsl/ and read it before using this
12 * file.
13 *
14 * The Original Code and all software distributed under the License are
15 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
16 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
17 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
19 * Please see the License for the specific language governing rights and
20 * limitations under the License.
21 *
22 * @APPLE_LICENSE_HEADER_END@
23 */
24
25#ifndef _IOKIT_HID_IOHIDKEYBOARDDEVICE_H
26#define _IOKIT_HID_IOHIDKEYBOARDDEVICE_H
27
28#include "IOHIDDeviceShim.h"
29#include "IOHIKeyboard.h"
30
31class IOHIDKeyboardDevice : public IOHIDDeviceShim
32{
33    OSDeclareDefaultStructors( IOHIDKeyboardDevice )
34
35private:
36    IOBufferMemoryDescriptor *	_report;
37    IOHIKeyboard *		_keyboard;
38
39    UInt8			_cachedLEDState;
40    UInt32          _lastFlags;
41
42    bool			_inputReportOnly;
43
44protected:
45
46    virtual void free();
47    virtual bool handleStart( IOService * provider );
48
49public:
50    static IOHIDKeyboardDevice	* newKeyboardDeviceAndStart(IOService * owner, UInt32 location = 0);
51
52    virtual bool initWithLocation( UInt32 location = 0 );
53
54    virtual IOReturn newReportDescriptor(
55                        IOMemoryDescriptor ** descriptor ) const;
56
57    virtual OSString * newProductString() const;
58
59    virtual IOReturn getReport( IOMemoryDescriptor * report,
60                                 IOHIDReportType      reportType,
61                                 IOOptionBits         options );
62
63    virtual IOReturn setReport( IOMemoryDescriptor * report,
64                                IOHIDReportType      reportType,
65                                IOOptionBits         options );
66
67    virtual void postKeyboardEvent(UInt8 key, bool keyDown);
68    virtual void postFlagKeyboardEvent(UInt32 flags);
69
70    virtual void setCapsLockLEDElement(bool state);
71    virtual void setNumLockLEDElement(bool state);
72};
73
74#endif /* !_IOKIT_HID_IOHIDKEYBOARDDEVICE_H */
75