1/*
2 *
3 * @APPLE_LICENSE_HEADER_START@
4 *
5 * Copyright (c) 1999-2009 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_IOHIDEVENTSERVICE_H
26#define _IOKIT_HID_IOHIDEVENTSERVICE_H
27
28#include <TargetConditionals.h>
29
30#include <IOKit/IOService.h>
31#include <IOKit/IOWorkLoop.h>
32#include <IOKit/IOTimerEventSource.h>
33#include <IOKit/hidsystem/IOHIDTypes.h>
34#include <IOKit/hid/IOHIDInterface.h>
35#include <IOKit/hid/IOHIDElement.h>
36#include <IOKit/hid/IOHIDKeys.h>
37
38#if TARGET_OS_EMBEDDED
39    #include <IOKit/hid/IOHIDEvent.h>
40#endif
41
42enum
43{
44    kHIDDispatchOptionPointerNoAcceleration            = 0x01,
45    kHIDDispatchOptionPointerAffixToScreen             = 0x02,
46    kHIDDispatchOptionPointerAbsolutToRelative         = 0x04
47};
48
49enum
50{
51    kHIDDispatchOptionScrollNoAcceleration      = 0x001,
52
53    kHIDDispatchOptionScrollMomentumAny         = 0x00e,
54    kHIDDispatchOptionScrollMomentumContinue    = 0x002,
55    kHIDDispatchOptionScrollMomentumStart       = 0x004,
56    kHIDDispatchOptionScrollMomentumEnd         = 0x008,
57
58    kHIDDispatchOptionPhaseAny                  = 0xff0,
59    kHIDDispatchOptionPhaseBegan                = 0x010,
60    kHIDDispatchOptionPhaseChanged              = 0x020,
61    kHIDDispatchOptionPhaseEnded                = 0x040,
62    kHIDDispatchOptionPhaseCanceled             = 0x080,
63    kHIDDispatchOptionPhaseMayBegin             = 0x800,
64};
65
66enum
67{
68    kHIDDispatchOptionKeyboardNoRepeat                 = 0x01
69};
70
71/*! @class IOHIDEventService : public IOService
72    @abstract
73    @discussion
74*/
75class   IOHIDPointing;
76class   IOHIDKeyboard;
77class   IOHIDConsumer;
78struct  TransducerData;
79
80class IOHIDEventService: public IOService
81{
82    OSDeclareAbstractStructors( IOHIDEventService )
83
84    friend class IOHIDPointing;
85    friend class IOHIDKeyboard;
86    friend class IOHIDConsumer;
87    friend class AppleEmbeddedKeyboard;
88    friend class IOHIDEventServiceUserClient;
89
90private:
91    IOHIDKeyboard *         _keyboardNub;
92    IOHIDPointing *         _pointingNub;
93    IOHIDConsumer *         _consumerNub;
94
95    IONotifier *			_publishNotify;
96    IORecursiveLock *       _nubLock;
97
98    OSArray *               _transducerDataArray;
99
100    bool                    _readyForInputReports;
101
102    struct ExpansionData {
103		IOService *				provider;
104        IOWorkLoop *            workLoop;
105        OSArray *               deviceUsagePairs;
106        IOCommandGate       *   commandGate;
107
108#if TARGET_OS_EMBEDDED
109        OSDictionary *          clientDict;
110#endif
111
112        struct {
113            bool                    range;
114            bool                    touch;
115            SInt32                  x;
116            SInt32                  y;
117            SInt32                  z;
118        } digitizer;
119
120        struct {
121            struct {
122                UInt32                  delayMS;
123                IOTimerEventSource 	*   timer;
124                UInt32                  state;
125                IOOptionBits            options;
126            } eject;
127            struct {
128                UInt32                  delayMS;
129                IOTimerEventSource 	*   timer;
130                UInt32                  state;
131                IOOptionBits            options;
132            } caps;
133
134#if TARGET_OS_EMBEDDED
135            struct {
136                UInt32                  startMask;
137                UInt32                  mask;
138                IOTimerEventSource 	*   timer;
139            } debug;
140
141            bool                    swapISO;
142#endif
143        } keyboard;
144
145        struct {
146            IOFixed                 x;
147            IOFixed                 y;
148            IOFixed                 z;
149            IOFixed                 rX;
150            IOFixed                 rY;
151            IOFixed                 rZ;
152            UInt32                  buttonState;
153            IOOptionBits            options;
154            IOTimerEventSource *    timer;
155        } multiAxis;
156
157
158    };
159    /*! @var reserved
160        Reserved for future use.  (Internal use only)  */
161    ExpansionData *         _reserved;
162
163    IOHIDPointing *         newPointingShim (
164                                UInt32          buttonCount         = 1,
165                                IOFixed         pointerResolution   = (400 << 16),
166                                IOFixed         scrollResolution    = 0,
167                                IOOptionBits    options             = 0 );
168
169    IOHIDKeyboard *         newKeyboardShim (
170                                UInt32          supportedModifiers  = 0,
171                                IOOptionBits    options             = 0 );
172
173    IOHIDConsumer *         newConsumerShim ( IOOptionBits options = 0 );
174
175    void                    parseSupportedElements (
176                                OSArray *                   elementArray,
177                                UInt32                      bootProtocol );
178
179    void                    processTabletElement ( IOHIDElement * element );
180
181    void                    processTransducerData ();
182
183    TransducerData *        createTransducerData ( UInt32 transducerID );
184
185    TransducerData *        getTransducerData ( UInt32 transducerID );
186
187    IOFixed                 determineResolution ( IOHIDElement * element );
188
189    static bool 			_publishMatchingNotificationHandler(void * target, void * ref, IOService * newService, IONotifier * notifier);
190
191    void                    ejectTimerCallback(IOTimerEventSource *sender);
192
193    void                    capsTimerCallback(IOTimerEventSource *sender);
194
195#if TARGET_OS_EMBEDDED
196    void                    debuggerTimerCallback(IOTimerEventSource *sender);
197#endif
198
199    void                    multiAxisTimerCallback(IOTimerEventSource *sender);
200
201	void					calculateCapsLockDelay();
202
203    void                    calculateStandardType();
204
205protected:
206
207    virtual void            free();
208
209/*! @function handleOpen
210    @abstract Handle a client open on the interface.
211    @discussion This method is called by IOService::open() with the
212    arbitration lock held, and must return true to accept the client open.
213    This method will in turn call handleClientOpen() to qualify the client
214    requesting the open.
215    @param client The client object that requested the open.
216    @param options Options passed to IOService::open().
217    @param argument Argument passed to IOService::open().
218    @result true to accept the client open, false otherwise. */
219
220    virtual bool handleOpen(IOService *  client,
221                            IOOptionBits options,
222                            void *       argument);
223
224/*! @function handleClose
225    @abstract Handle a client close on the interface.
226    @discussion This method is called by IOService::close() with the
227    arbitration lock held. This method will in turn call handleClientClose()
228    to notify interested subclasses about the client close. If this represents
229    the last close, then the interface will also close the controller before
230    this method returns. The controllerWillClose() method will be called before
231    closing the controller. Subclasses should not override this method.
232    @param client The client object that requested the close.
233    @param options Options passed to IOService::close(). */
234
235    virtual void handleClose(IOService * client, IOOptionBits options);
236
237/*! @function handleIsOpen
238    @abstract Query whether a client has an open on the interface.
239    @discussion This method is always called by IOService with the
240    arbitration lock held. Subclasses should not override this method.
241    @result true if the specified client, or any client if none (0) is
242    specified, presently has an open on this object. */
243
244    virtual bool handleIsOpen(const IOService * client) const;
245
246/*! @function handleStart
247    @abstract Prepare the hardware and driver to support I/O operations.
248    @discussion IOHIDEventService will call this method from start() before
249    any I/O operations are issued to the concrete subclass. Methods
250    such as getReportElements() are only called after handleStart()
251    has returned true. A subclass that overrides this method should
252    begin its implementation by calling the version in super, and
253    then check the return value.
254    @param provider The provider argument passed to start().
255    @result True on success, or false otherwise. Returning false will
256    cause start() to fail and return false. */
257
258    virtual bool            handleStart( IOService * provider );
259
260/*! @function handleStop
261    @abstract Quiesce the hardware and stop the driver.
262    @discussion IOHIDEventService will call this method from stop() to
263    signal that the hardware should be quiesced and the driver stopped.
264    A subclass that overrides this method should end its implementation
265    by calling the version in super.
266    @param provider The provider argument passed to stop(). */
267
268    virtual void            handleStop(  IOService * provider );
269
270    virtual OSString *      getTransport ();
271    virtual UInt32          getLocationID ();
272    virtual UInt32          getVendorID ();
273    virtual UInt32          getVendorIDSource ();
274    virtual UInt32          getProductID ();
275    virtual UInt32          getVersion ();
276    virtual UInt32          getCountryCode ();
277    virtual OSString *      getManufacturer ();
278    virtual OSString *      getProduct ();
279    virtual OSString *      getSerialNumber ();
280
281    virtual OSArray *       getReportElements();
282
283    virtual void            setElementValue (
284                                UInt32                      usagePage,
285                                UInt32                      usage,
286                                UInt32                      value );
287
288    virtual UInt32          getElementValue (
289                                UInt32                      usagePage,
290                                UInt32                      usage );
291
292    virtual void            dispatchKeyboardEvent(
293                                AbsoluteTime                timeStamp,
294                                UInt32                      usagePage,
295                                UInt32                      usage,
296                                UInt32                      value,
297                                IOOptionBits                options = 0 );
298
299    virtual void            dispatchRelativePointerEvent(
300                                AbsoluteTime                timeStamp,
301                                SInt32                      dx,
302                                SInt32                      dy,
303                                UInt32                      buttonState,
304                                IOOptionBits                options = 0 );
305
306    virtual void            dispatchAbsolutePointerEvent(
307                                AbsoluteTime                timeStamp,
308                                SInt32                      x,
309                                SInt32                      y,
310                                IOGBounds *                 bounds,
311                                UInt32                      buttonState,
312                                bool                        inRange,
313                                SInt32                      tipPressure,
314                                SInt32                      tipPressureMin,
315                                SInt32                      tipPressureMax,
316                                IOOptionBits                options = 0 );
317
318    virtual void            dispatchScrollWheelEvent(
319                                AbsoluteTime                timeStamp,
320                                SInt32                      deltaAxis1,
321                                SInt32                      deltaAxis2,
322                                SInt32                      deltaAxis3,
323                                IOOptionBits                options = 0 );
324
325    virtual void            dispatchTabletPointerEvent(
326                                AbsoluteTime                timeStamp,
327                                UInt32                      transducerID,
328                                SInt32                      x,
329                                SInt32                      y,
330                                SInt32                      z,
331                                IOGBounds *                 bounds,
332                                UInt32                      buttonState,
333                                SInt32                      tipPressure,
334                                SInt32                      tipPressureMin,
335                                SInt32                      tipPressureMax,
336                                SInt32                      barrelPressure,
337                                SInt32                      barrelPressureMin,
338                                SInt32                      barrelPressureMax,
339                                SInt32                      tiltX,
340                                SInt32                      tiltY,
341                                UInt32                      twist,
342                                IOOptionBits                options = 0 );
343
344    virtual void            dispatchTabletProximityEvent(
345                                AbsoluteTime                timeStamp,
346                                UInt32                      transducerID,
347                                bool                        inRange,
348                                bool                        invert,
349                                UInt32                      vendorTransducerUniqueID        = 0,
350                                UInt32                      vendorTransducerSerialNumber    = 0,
351                                IOOptionBits                options                         = 0 );
352
353public:
354    bool                    readyForReports();
355
356    virtual bool            init(OSDictionary * properties = 0);
357
358    virtual bool            start( IOService * provider );
359
360    virtual void            stop( IOService * provider );
361
362    virtual bool            matchPropertyTable(OSDictionary * table, SInt32 * score);
363
364    virtual IOReturn        setSystemProperties( OSDictionary * properties );
365
366    virtual IOReturn        setProperties( OSObject * properties );
367
368protected:
369    OSMetaClassDeclareReservedUsed(IOHIDEventService,  0);
370    virtual OSArray *       getDeviceUsagePairs();
371
372
373    OSMetaClassDeclareReservedUsed(IOHIDEventService,  1);
374    virtual UInt32          getReportInterval();
375
376    OSMetaClassDeclareReservedUsed(IOHIDEventService,  2);
377    enum {
378        kMultiAxisOptionRotationForTranslation  = (1<<0),
379        kMultiAxisOptionZForScroll              = (1<<1)
380    };
381/*!
382    @function dispatchMultiAxisPointerEvent
383    @abstract Dispatch multi-axis pointer event
384    @discussion This is meant to be used with joysticks or multi-axis pointer devices such as those with
385                with 6 degrees of freedom.  This function will generate related relative pointer and scroll
386                event associated with movement.
387    @param timeStamp    AbsoluteTime representing origination of event
388    @param buttonState  Button mask where bit0 is the primary button, bit1 secondary and so forth
389    @param x            Absolute location of pointer along the x-axis from -1.0 to 1.0 in 16:16 fixed point.
390    @param y            Absolute location of pointer along the y-axis from -1.0 to 1.0 in 16:16 fixed point.
391    @param z            Absolute location of pointer along the z-axis from -1.0 to 1.0 in 16:16 fixed point.
392    @param rX           Absolute rotation of pointer around the x-axis from -1.0 to 1.0 in 16:16 fixed point.
393    @param rY           Absolute rotation of pointer around the y-axis from -1.0 to 1.0 in 16:16 fixed point.
394    @param rZ           Absolute rotation of pointer around the z-axis from -1.0 to 1.0 in 16:16 fixed point.
395    @param options      Additional options to be used when dispatching event such as leveraging rotational
396                        axis for translation or using the z axis for vertical scrolling.
397*/
398    virtual void            dispatchMultiAxisPointerEvent(
399                                AbsoluteTime                timeStamp,
400                                UInt32                      buttonState,
401                                IOFixed                     x,
402                                IOFixed                     y,
403                                IOFixed                     z,
404                                IOFixed                     rX      = 0,
405                                IOFixed                     rY      = 0,
406                                IOFixed                     rZ      = 0,
407                                IOOptionBits                options = 0 );
408
409    enum {
410        kDigitizerInvert = (1<<0)
411    };
412
413    enum {
414        kDigitizerTransducerTypeStylus = 0,
415        kDigitizerTransducerTypePuck,
416        kDigitizerTransducerTypeFinger,
417        kDigitizerTransducerTypeHand
418    };
419    typedef UInt32 DigitizerTransducerType;
420
421/*!
422    @function dispatchDigitizerEvent
423    @abstract Dispatch tablet events without orientation
424    @discussion This is meant to be used with transducers without any orientation.
425    @param timeStamp    AbsoluteTime representing origination of event
426    @param ID           ID of the transducer generating the event
427    @param type         Type of the transducer generating the event
428    @param inRange      Details whether the transducer is in promitity to digitizer surface
429    @param buttonState  Button mask where bit0 is the primary button, bit1 secondary and so forth
430    @param x            Absolute location of transducer along the x-axis from 0.0 to 1.0 in
431                        16:16 fixed point.
432    @param y            Absolute location of transducer along the y-axis from 0.0 to 1.0 in
433                        16:16 fixed point.
434    @param z            Absolute location of transducer along the z-axis from 0.0 to 1.0 in
435                        16:16 fixed point. This is typically used to determine the distance
436                        between the transducer and surface
437    @param tipPressure  Absolute pressure exerted on surface by tip from 0.0 to 1.0 in 16:16
438                        fixed point.
439    @param auxPressure  Absolute pressure exerted on transducer from 0.0 to 1.0 in 16:16 fixed point.
440    @param options      Additional options to be used when dispatching event.
441*/
442    OSMetaClassDeclareReservedUsed(IOHIDEventService,  3);
443    virtual void            dispatchDigitizerEvent(
444                                AbsoluteTime                    timeStamp,
445                                UInt32                          transducerID,
446                                DigitizerTransducerType         type,
447                                bool                            inRange,
448                                UInt32                          buttonState,
449                                IOFixed                         x,
450                                IOFixed                         y,
451                                IOFixed                         z               = 0,
452                                IOFixed                         tipPressure     = 0,
453                                IOFixed                         auxPressure     = 0,
454                                IOFixed                         twist           = 0,
455                                IOOptionBits                    options         = 0 );
456
457/*!
458    @function dispatchDigitizerEventWithTiltOrientation
459    @abstract Dispatch tablet events with tilt orientation
460    @discussion This is meant to be used with transducers that leverage tilt orientation
461    @param timeStamp    AbsoluteTime representing origination of event
462    @param ID           ID of the transducer generating the event
463    @param type         Type of the transducer generating the event
464    @param inRange      Details whether the transducer is in promitity to digitizer surface
465    @param buttonState  Button mask where bit0 is the primary button, bit1 secondary and so forth
466    @param x            Absolute location of transducer along the x-axis from 0.0 to 1.0 in
467                        16:16 fixed point.
468    @param y            Absolute location of transducer along the y-axis from 0.0 to 1.0 in
469                        16:16 fixed point.
470    @param z            Absolute location of transducer along the z-axis from 0.0 to 1.0 in
471                        16:16 fixed point. This is typically used to determine the distance
472                        between the transducer and surface
473    @param tipPressure  Absolute pressure exerted on surface by tip from 0.0 to 1.0 in 16:16
474                        fixed point.
475    @param auxPressure  Absolute pressure exerted on transducer from 0.0 to 1.0 in 16:16 fixed point.
476    @param twist        Absolute clockwise rotation along the transducer's major axis from 0.0 to
477                        360.0 degrees in 16:16 fixed point.
478    @param tiltX        Absolute plane angle between the Y-Z plane and the plane containing the
479                        transducer axis and the Y axis.  A positive X tilt is to the right.  Value is
480                        represented in degrees from -90.0 to 90.0 in 16:16 fixed point.
481    @param tiltY        Absolute plane angle between the X-Z plane and the plane containing the
482                        transducer axis and the X axis.  A positive Y tilt is towards the user.  Value
483                        is represented in degrees from -90.0 to 90.0 in 16:16 fixed point.
484    @param options      Additional options to be used when dispatching event.
485*/
486    OSMetaClassDeclareReservedUsed(IOHIDEventService,  4);
487    virtual void            dispatchDigitizerEventWithTiltOrientation(
488                                AbsoluteTime                    timeStamp,
489                                UInt32                          ID,
490                                DigitizerTransducerType         type,
491                                bool                            inRange,
492                                UInt32                          buttonState,
493                                IOFixed                         x,
494                                IOFixed                         y,
495                                IOFixed                         z               = 0,
496                                IOFixed                         tipPressure     = 0, // 0.0-1.0 in 16:16 fixed
497                                IOFixed                         auxPressure     = 0, // 0.0-1.0 in 16:16 fixed
498                                IOFixed                         twist           = 0,
499                                IOFixed                         tiltX           = 0,
500                                IOFixed                         tiltY           = 0,
501                                IOOptionBits                    options         = 0 );
502
503/*!
504    @function dispatchDigitizerEventWithPolarOrientation
505    @abstract Dispatch tablet events with polar orientation
506    @discussion This is meant to be used with transducers that leverage polar orientation
507    @param timeStamp    AbsoluteTime representing origination of event
508    @param ID           ID of the transducer generating the event
509    @param type         Type of the transducer generating the event
510    @param inRange      Details whether the transducer is in promitity to digitizer surface
511    @param buttonState  Button mask where bit0 is the primary button, bit1 secondary and so forth
512    @param x            Absolute location of transducer along the x-axis from 0.0 to 1.0 in
513                        16:16 fixed point.
514    @param y            Absolute location of transducer along the y-axis from 0.0 to 1.0 in
515                        16:16 fixed point.
516    @param z            Absolute location of transducer along the z-axis from 0.0 to 1.0 in
517                        16:16 fixed point. This is typically used to determine the distance
518                        between the transducer and surface
519    @param tipPressure  Absolute pressure exerted on surface by tip from 0.0 to 1.0 in 16:16
520                        fixed point.
521    @param auxPressure  Absolute pressure exerted on transducer from 0.0 to 1.0 in 16:16 fixed point.
522    @param twist        Absolute clockwise rotation along the transducer's major axis from 0.0 to
523                        360.0 degrees in 16:16 fixed point.
524    @param altitude     Specifies angle with the X-Y plane thorugh a signed, semicircular range.
525                        Positive values specify an angle downward and toward the positive Z axis.
526                        Value is represented in degrees from -180.0 to 180.0 in 16:16 fixed point.
527    @param azimuth      Counter clockwise rotation of the cursor around the Z-axis through a full
528                        circular range.  Value is represented in degrees from 0.0 to 360.0 in 16:16
529                        fixed point.
530    @param options      Additional options to be used when dispatching event.
531*/
532    OSMetaClassDeclareReservedUsed(IOHIDEventService,  5);
533    virtual void            dispatchDigitizerEventWithPolarOrientation(
534                                AbsoluteTime                    timeStamp,
535                                UInt32                          transducerID,
536                                DigitizerTransducerType         type,
537                                bool                            inRange,
538                                UInt32                          buttonState,
539                                IOFixed                         x,
540                                IOFixed                         y,
541                                IOFixed                         z               = 0,
542                                IOFixed                         tipPressure     = 0, // 0.0-1.0 in 16:16 fixed
543                                IOFixed                         tanPressure     = 0, // 0.0-1.0 in 16:16 fixed
544                                IOFixed                         twist           = 0,
545                                IOFixed                         altitude        = 0,
546                                IOFixed                         azimuth         = 0,
547                                IOOptionBits                    options         = 0 );
548
549private:
550    enum {
551        kDigitizerOrientationTypeTilt = 0,
552        kDigitizerOrientationTypePolar,
553        kDigitizerOrientationTypeQuality
554    };
555    typedef UInt32 DigitizerOrientationType;
556
557    void            dispatchDigitizerEventWithOrientation(
558                                AbsoluteTime                    timeStamp,
559                                UInt32                          transducerID,
560                                DigitizerTransducerType         type,
561                                bool                            inRange,
562                                UInt32                          buttonState,
563                                IOFixed                         x,
564                                IOFixed                         y,
565                                IOFixed                         z                       = 0,
566                                IOFixed                         tipPressure             = 0,
567                                IOFixed                         auxPressure             = 0,
568                                IOFixed                         twist                   = 0,
569                                DigitizerOrientationType        orientationType         = kDigitizerOrientationTypeTilt,
570                                IOFixed *                       orientationParams       = NULL,
571                                UInt32                          orientationParamCount   = 0,
572                                IOOptionBits                    options                 = 0 );
573
574
575
576#if TARGET_OS_EMBEDDED
577public:
578    typedef void (*Action)(OSObject *target, OSObject * sender, void *context, OSObject *event, IOOptionBits options);
579
580    OSMetaClassDeclareReservedUsed(IOHIDEventService,  6);
581    virtual bool            open(
582                                IOService *                 client,
583                                IOOptionBits                options,
584                                void *                      context,
585                                Action                      action);
586
587protected:
588    OSMetaClassDeclareReservedUsed(IOHIDEventService,  7);
589    virtual void            dispatchEvent(IOHIDEvent * event, IOOptionBits options=0);
590
591    OSMetaClassDeclareReservedUsed(IOHIDEventService,  8);
592    virtual UInt32          getPrimaryUsagePage();
593
594    OSMetaClassDeclareReservedUsed(IOHIDEventService,  9);
595    virtual UInt32          getPrimaryUsage();
596
597public:
598    OSMetaClassDeclareReservedUsed(IOHIDEventService,  10);
599    virtual IOHIDEvent *    copyEvent(
600                                IOHIDEventType              type,
601                                IOHIDEvent *                matching = 0,
602                                IOOptionBits                options = 0);
603
604protected:
605
606#else
607    OSMetaClassDeclareReservedUnused(IOHIDEventService,  6);
608    OSMetaClassDeclareReservedUnused(IOHIDEventService,  7);
609    OSMetaClassDeclareReservedUnused(IOHIDEventService,  8);
610    OSMetaClassDeclareReservedUnused(IOHIDEventService,  9);
611    OSMetaClassDeclareReservedUnused(IOHIDEventService, 10);
612#endif
613    OSMetaClassDeclareReservedUnused(IOHIDEventService, 11);
614    OSMetaClassDeclareReservedUnused(IOHIDEventService, 12);
615    OSMetaClassDeclareReservedUnused(IOHIDEventService, 13);
616    OSMetaClassDeclareReservedUnused(IOHIDEventService, 14);
617    OSMetaClassDeclareReservedUnused(IOHIDEventService, 15);
618    OSMetaClassDeclareReservedUnused(IOHIDEventService, 16);
619    OSMetaClassDeclareReservedUnused(IOHIDEventService, 17);
620    OSMetaClassDeclareReservedUnused(IOHIDEventService, 18);
621    OSMetaClassDeclareReservedUnused(IOHIDEventService, 19);
622    OSMetaClassDeclareReservedUnused(IOHIDEventService, 20);
623    OSMetaClassDeclareReservedUnused(IOHIDEventService, 21);
624    OSMetaClassDeclareReservedUnused(IOHIDEventService, 22);
625    OSMetaClassDeclareReservedUnused(IOHIDEventService, 23);
626    OSMetaClassDeclareReservedUnused(IOHIDEventService, 24);
627    OSMetaClassDeclareReservedUnused(IOHIDEventService, 25);
628    OSMetaClassDeclareReservedUnused(IOHIDEventService, 26);
629    OSMetaClassDeclareReservedUnused(IOHIDEventService, 27);
630    OSMetaClassDeclareReservedUnused(IOHIDEventService, 28);
631    OSMetaClassDeclareReservedUnused(IOHIDEventService, 29);
632    OSMetaClassDeclareReservedUnused(IOHIDEventService, 30);
633    OSMetaClassDeclareReservedUnused(IOHIDEventService, 31);
634
635#if TARGET_OS_EMBEDDED
636public:
637    virtual void            close( IOService * forClient, IOOptionBits options = 0 );
638
639private:
640    bool                    openGated( IOService *client, IOOptionBits options, void *context, Action action);
641    void                    closeGated( IOService * forClient, IOOptionBits options = 0 );
642#endif
643
644};
645
646#endif /* !_IOKIT_HID_IOHIDEVENTSERVICE_H */
647