1/*
2 *  IOHIDAggdMetricsPlugIn.h
3 *  IOHIDEventSystemPlugIns
4 *
5 *  Created by Rob Yepez on 05/21/2013.
6 *  Copyright 2013 Apple Inc. All rights reserved.
7 *
8 */
9
10#include <sys/cdefs.h>
11#include <CoreFoundation/CoreFoundation.h>
12#if COREFOUNDATION_CFPLUGINCOM_SEPARATE
13#include <CoreFoundation/CFPlugInCOM.h>
14#endif
15class IOHIDAggdMetricsPlugIn
16{
17public:
18    IOHIDAggdMetricsPlugIn(CFUUIDRef factoryID);
19    ~IOHIDAggdMetricsPlugIn();
20    HRESULT QueryInterface( REFIID iid, LPVOID *ppv );
21    ULONG AddRef();
22    ULONG Release();
23
24    IOHIDEventRef filter(IOHIDServiceRef sender, IOHIDEventRef event);
25    void registerService(IOHIDServiceRef service);
26    void setPropertyForClient(CFStringRef key, CFTypeRef property, CFTypeRef client);
27private:
28    IOHIDSessionFilterPlugInInterface *_sessionInterface;
29    CFUUIDRef                   _factoryID;
30    UInt32                      _refCount;
31
32    float                       _factor;
33
34private:
35    static IOHIDSessionFilterPlugInInterface sIOHIDAggdMetricsPlugInFtbl;
36    static HRESULT QueryInterface( void *self, REFIID iid, LPVOID *ppv );
37    static ULONG AddRef( void *self );
38    static ULONG Release( void *self );
39
40    static IOHIDEventRef filter(void * self, IOHIDServiceRef sender, IOHIDEventRef event);
41    static IOHIDEventRef copyEvent(void * self, IOHIDEventType type, IOHIDEventRef matching, IOOptionBits options);
42
43    static boolean_t open(void * self, IOHIDSessionRef inSession, IOOptionBits options);
44    static void close(void * self, IOHIDSessionRef inSession, IOOptionBits options);
45    static void registerDisplay(void * self, IOHIDDisplayRef display);
46    static void unregisterDisplay(void * self, IOHIDDisplayRef display);
47    static void registerService(void * self, IOHIDServiceRef service);
48    static void unregisterService(void * self, IOHIDServiceRef service);
49    static void scheduleWithRunLoop(void * self, CFRunLoopRef runLoop, CFStringRef runLoopMode);
50    static void unscheduleFromRunLoop(void * self, CFRunLoopRef runLoop, CFStringRef runLoopMode);
51    static CFTypeRef getPropertyForClient(void * self, CFStringRef key, CFTypeRef client);
52    static void setPropertyForClient(void * self, CFStringRef key, CFTypeRef property, CFTypeRef client);
53
54private:
55    IOHIDAggdMetricsPlugIn();
56    IOHIDAggdMetricsPlugIn(const IOHIDAggdMetricsPlugIn &);
57    IOHIDAggdMetricsPlugIn &operator=(const IOHIDAggdMetricsPlugIn &);
58};
59