2 // File: IOHIDElement_.h of HID Utilities
6 // Contains: Definition of the interfaces to <IOHIDElement_.c>
8 // Copyright © 2007-2009 Apple Inc., All Rights Reserved
10 // Disclaimer: IMPORTANT: This Apple software is supplied to you by
11 // Apple Inc. ("Apple") in consideration of your agreement to the
12 // following terms, and your use, installation, modification or
13 // redistribution of this Apple software constitutes acceptance of these
14 // terms. If you do not agree with these terms, please do not use,
15 // install, modify or redistribute this Apple software.
17 // In consideration of your agreement to abide by the following terms, and
18 // subject to these terms, Apple grants you a personal, non-exclusive
19 // license, under Apple's copyrights in this original Apple software (the
20 // "Apple Software"), to use, reproduce, modify and redistribute the Apple
21 // Software, with or without modifications, in source and/or binary forms;
22 // provided that if you redistribute the Apple Software in its entirety and
23 // without modifications, you must retain this notice and the following
24 // text and disclaimers in all such redistributions of the Apple Software.
25 // Neither the name, trademarks, service marks or logos of Apple Inc.
26 // may be used to endorse or promote products derived from the Apple
27 // Software without specific prior written permission from Apple. Except
28 // as expressly stated in this notice, no other rights or licenses, express
29 // or implied, are granted by Apple herein, including but not limited to
30 // any patent rights that may be infringed by your derivative works or by
31 // other works in which the Apple Software may be incorporated.
33 // The Apple Software is provided by Apple on an "AS IS" basis. APPLE
34 // MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
35 // THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
36 // FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
37 // OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
39 // IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
40 // OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
41 // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
42 // INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
43 // MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
44 // AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
45 // STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
46 // POSSIBILITY OF SUCH DAMAGE.
48 #ifndef __IOHIDElement___
49 #define __IOHIDElement___
51 //*****************************************************
52 #pragma mark - includes & imports
54 #include <AvailabilityMacros.h>
56 #include <Carbon/Carbon.h>
57 #include "IOHIDLib_.h"
58 //*****************************************************
71 #if PRAGMA_STRUCT_ALIGN
72 #pragma options align=mac68k
73 #elif PRAGMA_STRUCT_PACKPUSH
75 #elif PRAGMA_STRUCT_PACK
79 //*****************************************************
80 #pragma mark - typedef's, struct's, enums, defines, etc.
81 //-----------------------------------------------------
83 //*****************************************************
84 #pragma mark - exported globals
85 //-----------------------------------------------------
87 //*****************************************************
88 #pragma mark - exported function prototypes
89 //-----------------------------------------------------
91 //*************************************************************************
93 // HIDIsValidElement( inIOHIDElementRef )
95 // Purpose: validate this element
97 // Inputs: inIOHIDElementRef - the element
99 // Returns: Boolean - TRUE if this is a valid element ref
101 extern Boolean
HIDIsValidElement( IOHIDElementRef inIOHIDElementRef
);
103 //*************************************************************************
105 // IOHIDElement_GetValue( inElementRef, inIOHIDValueScaleType )
107 // Purpose: returns the current value for an element( polling )
109 // Notes: will return 0 on error conditions which should be accounted for by application
111 // Inputs: inElementRef - the element
112 // inIOHIDValueScaleType - scale type ( calibrated or physical )
114 // Returns: double - current value for element
116 extern double IOHIDElement_GetValue( IOHIDElementRef inElementRef
, IOHIDValueScaleType inIOHIDValueScaleType
);
118 //*************************************************************************
120 // IOHIDElement_GetCalibrationMin( inElementRef )
122 // Purpose: get the minimum bounds for a calibrated value for this element
124 // Inputs: inElementRef - the IOHIDElementRef for this element
126 // Returns: CFIndex - the minimum Calibration value for this element
129 extern CFIndex
IOHIDElement_GetCalibrationMin( IOHIDElementRef inElementRef
);
131 //*************************************************************************
133 // IOHIDElement_SetCalibrationMin( inElementRef, inValue )
135 // Purpose: set the minimum bounds for a calibrated value for this element
137 // Inputs: inElementRef - the IOHIDElementRef for this element
138 // inValue - the minimum bounds for a calibrated value for this element
143 extern void IOHIDElement_SetCalibrationMin( IOHIDElementRef inElementRef
, CFIndex inValue
);
145 //*************************************************************************
147 // IOHIDElement_GetCalibrationMax( inElementRef )
149 // Purpose: get the maximum bounds for a calibrated value for this element
151 // Inputs: inElementRef - the IOHIDElementRef for this element
153 // Returns: CFIndex - the maximum Calibration value for this element
156 extern CFIndex
IOHIDElement_GetCalibrationMax( IOHIDElementRef inElementRef
);
158 //*************************************************************************
160 // IOHIDElement_SetCalibrationMax( inElementRef, inValue )
162 // Purpose: set the maximum bounds for a calibrated value for this element
164 // Inputs: inElementRef - the IOHIDElementRef for this element
165 // inValue - the maximum Calibration value for this element
170 extern void IOHIDElement_SetCalibrationMax( IOHIDElementRef inElementRef
, CFIndex inValue
);
172 //*************************************************************************
174 // IOHIDElement_GetCalibrationSaturationMin( inElementRef )
176 // Purpose: get the mininum tolerance to be used when calibrating a logical element value
178 // Inputs: inElementRef - the IOHIDElementRef for this element
180 // Returns: CFIndex - the maximum Calibration value for this element
183 extern CFIndex
IOHIDElement_GetCalibrationSaturationMin( IOHIDElementRef inElementRef
);
185 //*************************************************************************
187 // IOHIDElement_SetCalibrationSaturationMin( inElementRef, inValue )
189 // Purpose: set the mininum tolerance to be used when calibrating a logical element value
191 // Inputs: inElementRef - the IOHIDElementRef for this element
192 // inValue - the maximum Calibration value for this element
197 extern void IOHIDElement_SetCalibrationSaturationMin( IOHIDElementRef inElementRef
, CFIndex inValue
);
199 //*************************************************************************
201 // IOHIDElement_GetCalibrationSaturationMax( inElementRef )
203 // Purpose: get the maximum tolerance to be used when calibrating a logical element value
205 // Inputs: inElementRef - the IOHIDElementRef for this element
207 // Returns: CFIndex - the maximum Calibration value for this element
210 extern CFIndex
IOHIDElement_GetCalibrationSaturationMax( IOHIDElementRef inElementRef
);
212 //*************************************************************************
214 // IOHIDElement_SetCalibrationSaturationMax( inElementRef, inValue )
216 // Purpose: set the maximum tolerance to be used when calibrating a logical element value
218 // Inputs: inElementRef - the IOHIDElementRef for this element
219 // inValue - the maximum Calibration value for this element
224 extern void IOHIDElement_SetCalibrationSaturationMax( IOHIDElementRef inElementRef
, CFIndex inValue
);
226 //*************************************************************************
228 // IOHIDElement_GetCalibrationDeadZoneMin( inElementRef )
230 // Purpose: get the minimum bounds near the midpoint of a logical value in which the value is ignored
232 // Inputs: inElementRef - the IOHIDElementRef for this element
234 // Returns: CFIndex - the maximum Calibration value for this element
237 extern CFIndex
IOHIDElement_GetCalibrationDeadZoneMin( IOHIDElementRef inElementRef
);
239 //*************************************************************************
241 // IOHIDElement_SetCalibrationDeadZoneMin( inElementRef, inValue )
243 // Purpose: set the minimum bounds near the midpoint of a logical value in which the value is ignored
245 // Inputs: inElementRef - the IOHIDElementRef for this element
246 // inValue - the maximum Calibration value for this element
251 extern void IOHIDElement_SetCalibrationDeadZoneMin( IOHIDElementRef inElementRef
, CFIndex inValue
);
253 //*************************************************************************
255 // IOHIDElement_GetCalibrationDeadZoneMax( inElementRef )
257 // Purpose: get the maximum bounds near the midpoint of a logical value in which the value is ignored
259 // Inputs: inElementRef - the IOHIDElementRef for this element
261 // Returns: CFIndex - the maximum Calibration value for this element
264 extern CFIndex
IOHIDElement_GetCalibrationDeadZoneMax( IOHIDElementRef inElementRef
);
266 //*************************************************************************
268 // IOHIDElement_SetCalibrationDeadZoneMax( inElementRef, inValue )
270 // Purpose: set the maximum bounds near the midpoint of a logical value in which the value is ignored
272 // Inputs: inElementRef - the IOHIDElementRef for this element
273 // inValue - the maximum Calibration value for this element
278 extern void IOHIDElement_SetCalibrationDeadZoneMax( IOHIDElementRef inElementRef
, CFIndex inValue
);
280 //*************************************************************************
282 // IOHIDElement_GetCalibrationGranularity( inElementRef )
284 // Purpose: get the level of detail returned for a calibrated element value
286 // Inputs: inElementRef - the IOHIDElementRef for this element
288 // Returns: double_t - the maximum Calibration value for this element
291 extern double_t
IOHIDElement_GetCalibrationGranularity( IOHIDElementRef inElementRef
);
293 //*************************************************************************
295 // IOHIDElement_SetCalibrationGranularity( inElementRef, inValue )
297 // Purpose: set the level of detail returned for a calibrated element value
299 // Inputs: inElementRef - the IOHIDElementRef for this element
300 // inValue - the the level of detail for this element
305 extern void IOHIDElement_SetCalibrationGranularity( IOHIDElementRef inElementRef
, double_t inValue
);
307 //*************************************************************************
309 // IOHIDElement_SetupCalibration( inElementRef )
311 // Purpose: set default values for the element calibration parameters
313 // Inputs: inElementRef - the IOHIDElementRef for this element
318 extern void IOHIDElement_SetupCalibration( IOHIDElementRef inIOHIDElementRef
);
320 extern Boolean
IOHIDElement_GetLongProperty( IOHIDElementRef inElementRef
, CFStringRef inKey
, long * outValue
);
321 extern void IOHIDElement_SetLongProperty( IOHIDElementRef inElementRef
, CFStringRef inKey
, long inValue
);
323 //*****************************************************
324 #if PRAGMA_STRUCT_ALIGN
325 #pragma options align=reset
326 #elif PRAGMA_STRUCT_PACKPUSH
328 #elif PRAGMA_STRUCT_PACK
332 #ifdef PRAGMA_IMPORT_OFF
342 #endif // __IOHIDElement___ //