[1166] | 1 | /**
|
---|
| 2 | * This file has no copyright assigned and is placed in the Public Domain.
|
---|
| 3 | * This file is part of the mingw-w64 runtime package.
|
---|
| 4 | * No warranty is given; refer to the file DISCLAIMER.PD within this package.
|
---|
| 5 | */
|
---|
| 6 |
|
---|
| 7 | import "oaidl.idl";
|
---|
| 8 | import "ocidl.idl";
|
---|
| 9 | import "propsys.idl";
|
---|
| 10 | import "portabledevicetypes.idl";
|
---|
| 11 |
|
---|
| 12 | typedef enum {
|
---|
| 13 | SENSOR_STATE_MIN = 0,
|
---|
| 14 | SENSOR_STATE_READY = SENSOR_STATE_MIN,
|
---|
| 15 | SENSOR_STATE_NOT_AVAILABLE = (SENSOR_STATE_READY+1) ,
|
---|
| 16 | SENSOR_STATE_NO_DATA = (SENSOR_STATE_NOT_AVAILABLE+1),
|
---|
| 17 | SENSOR_STATE_INITIALIZING = (SENSOR_STATE_NO_DATA+1),
|
---|
| 18 | SENSOR_STATE_ACCESS_DENIED = (SENSOR_STATE_INITIALIZING+1),
|
---|
| 19 | SENSOR_STATE_ERROR = (SENSOR_STATE_ACCESS_DENIED+1),
|
---|
| 20 | SENSOR_STATE_MAX = SENSOR_STATE_ERROR
|
---|
| 21 | } SensorState;
|
---|
| 22 |
|
---|
| 23 | typedef enum {
|
---|
| 24 | SENSOR_CONNECTION_TYPE_PC_INTEGRATED = 0,
|
---|
| 25 | SENSOR_CONNECTION_TYPE_PC_ATTACHED = (SENSOR_CONNECTION_TYPE_PC_INTEGRATED+1),
|
---|
| 26 | SENSOR_CONNECTION_TYPE_PC_EXTERNAL = (SENSOR_CONNECTION_TYPE_PC_ATTACHED+1)
|
---|
| 27 | } SensorConnectionType;
|
---|
| 28 |
|
---|
| 29 | typedef enum LOCATION_DESIRED_ACCURACY {
|
---|
| 30 | LOCATION_DESIRED_ACCURACY_DEFAULT = 0,
|
---|
| 31 | LOCATION_DESIRED_ACCURACY_HIGH = (LOCATION_DESIRED_ACCURACY_DEFAULT+1)
|
---|
| 32 | } LOCATION_DESIRED_ACCURACY;
|
---|
| 33 |
|
---|
| 34 | typedef GUID SENSOR_CATEGORY_ID;
|
---|
| 35 | typedef REFGUID REFSENSOR_CATEGORY_ID;
|
---|
| 36 |
|
---|
| 37 | typedef GUID SENSOR_TYPE_ID;
|
---|
| 38 | typedef REFGUID REFSENSOR_TYPE_ID;
|
---|
| 39 |
|
---|
| 40 | typedef GUID SENSOR_ID;
|
---|
| 41 | typedef REFGUID REFSENSOR_ID;
|
---|
| 42 |
|
---|
| 43 | interface ISensorCollection;
|
---|
| 44 | interface ISensor;
|
---|
| 45 | interface ISensorDataReport;
|
---|
| 46 | interface ISensorManagerEvents;
|
---|
| 47 | interface ISensorEvents;
|
---|
| 48 |
|
---|
| 49 | [
|
---|
| 50 | uuid(bd77db67-45a8-42dc-8d00-6dcf15f8377a),
|
---|
| 51 | object
|
---|
| 52 | ]
|
---|
| 53 | interface ISensorManager : IUnknown
|
---|
| 54 | {
|
---|
| 55 | HRESULT GetSensorsByCategory(
|
---|
| 56 | [in] REFSENSOR_CATEGORY_ID sensorCategory,
|
---|
| 57 | [out] ISensorCollection **ppSensorsFound);
|
---|
| 58 |
|
---|
| 59 | HRESULT GetSensorsByType(
|
---|
| 60 | [in] REFSENSOR_TYPE_ID sensorType,
|
---|
| 61 | [out] ISensorCollection **ppSensorsFound);
|
---|
| 62 |
|
---|
| 63 | HRESULT GetSensorByID(
|
---|
| 64 | [in] REFSENSOR_ID sensorID,
|
---|
| 65 | [out] ISensor **ppSensor);
|
---|
| 66 |
|
---|
| 67 | HRESULT SetEventSink([in] ISensorManagerEvents *pEvents);
|
---|
| 68 |
|
---|
| 69 | HRESULT RequestPermissions(
|
---|
| 70 | [in] HWND hParent,
|
---|
| 71 | [in] ISensorCollection *pSensors,
|
---|
| 72 | [in] BOOL fModal);
|
---|
| 73 | }
|
---|
| 74 |
|
---|
| 75 | [
|
---|
| 76 | uuid(23571e11-e545-4dd8-a337-b89bf44b10df),
|
---|
| 77 | object
|
---|
| 78 | ]
|
---|
| 79 | interface ISensorCollection : IUnknown
|
---|
| 80 | {
|
---|
| 81 | HRESULT GetAt(
|
---|
| 82 | [in] ULONG ulIndex,
|
---|
| 83 | [out] ISensor **ppSensor) = 0;
|
---|
| 84 |
|
---|
| 85 | HRESULT GetCount([out] ULONG *pCount);
|
---|
| 86 | HRESULT Add([in] ISensor *pSensor);
|
---|
| 87 | HRESULT Remove([in] ISensor *pSensor);
|
---|
| 88 | HRESULT RemoveByID([in] REFSENSOR_ID sensorID);
|
---|
| 89 | HRESULT Clear();
|
---|
| 90 | }
|
---|
| 91 |
|
---|
| 92 | [
|
---|
| 93 | uuid(5fa08f80-2657-458e-af75-46f73fa6ac5c),
|
---|
| 94 | object
|
---|
| 95 | ]
|
---|
| 96 | interface ISensor : IUnknown
|
---|
| 97 | {
|
---|
| 98 | HRESULT GetID([out] SENSOR_ID *pID);
|
---|
| 99 | HRESULT GetCategory([out] SENSOR_CATEGORY_ID *pSensorCategory);
|
---|
| 100 | HRESULT GetType([out] SENSOR_TYPE_ID *pSensorType);
|
---|
| 101 | HRESULT GetFriendlyName([out] BSTR *pFriendlyName);
|
---|
| 102 |
|
---|
| 103 | HRESULT GetProperty(
|
---|
| 104 | [in] REFPROPERTYKEY key,
|
---|
| 105 | [out] PROPVARIANT *pProperty);
|
---|
| 106 |
|
---|
| 107 | HRESULT GetProperties(
|
---|
| 108 | [in] IPortableDeviceKeyCollection *pKeys,
|
---|
| 109 | [out] IPortableDeviceValues **ppProperties);
|
---|
| 110 |
|
---|
| 111 | HRESULT GetSupportedDataFields([out] IPortableDeviceKeyCollection **ppDataFields);
|
---|
| 112 |
|
---|
| 113 | HRESULT SetProperties(
|
---|
| 114 | [in] IPortableDeviceValues *pProperties,
|
---|
| 115 | [out] IPortableDeviceValues **ppResults);
|
---|
| 116 |
|
---|
| 117 | HRESULT SupportsDataField(
|
---|
| 118 | [in] REFPROPERTYKEY key,
|
---|
| 119 | [out] VARIANT_BOOL *pIsSupported);
|
---|
| 120 |
|
---|
| 121 | HRESULT GetState([out] SensorState *pState);
|
---|
| 122 | HRESULT GetData([out] ISensorDataReport **ppDataReport);
|
---|
| 123 |
|
---|
| 124 | HRESULT SupportsEvent(
|
---|
| 125 | [in] REFGUID eventGuid,
|
---|
| 126 | [out] VARIANT_BOOL *pIsSupported);
|
---|
| 127 |
|
---|
| 128 | HRESULT GetEventInterest(
|
---|
| 129 | [size_is(*pCount), out] GUID **ppValues,
|
---|
| 130 | [out] ULONG *pCount);
|
---|
| 131 |
|
---|
| 132 | HRESULT SetEventInterest(
|
---|
| 133 | [size_is(count), in] GUID *pValues,
|
---|
| 134 | [in] ULONG count);
|
---|
| 135 |
|
---|
| 136 | HRESULT SetEventSink([in] ISensorEvents *pEvents);
|
---|
| 137 | }
|
---|
| 138 |
|
---|
| 139 | [
|
---|
| 140 | uuid(0ab9df9b-c4b5-4796-8898-0470706a2e1d),
|
---|
| 141 | object
|
---|
| 142 | ]
|
---|
| 143 | interface ISensorDataReport : IUnknown
|
---|
| 144 | {
|
---|
| 145 | HRESULT GetTimestamp([out] SYSTEMTIME *pTimeStamp);
|
---|
| 146 |
|
---|
| 147 | HRESULT GetSensorValue(
|
---|
| 148 | [in] REFPROPERTYKEY pKey,
|
---|
| 149 | [out] PROPVARIANT *pValue);
|
---|
| 150 |
|
---|
| 151 | HRESULT GetSensorValues(
|
---|
| 152 | [in] IPortableDeviceKeyCollection *pKeys,
|
---|
| 153 | [out] IPortableDeviceValues **ppValues);
|
---|
| 154 | }
|
---|
| 155 |
|
---|
| 156 | [
|
---|
| 157 | uuid(9b3b0b86-266a-4aad-b21f-fde5501001b7),
|
---|
| 158 | local
|
---|
| 159 | ]
|
---|
| 160 | interface ISensorManagerEvents : IUnknown
|
---|
| 161 | {
|
---|
| 162 | HRESULT OnSensorEnter(
|
---|
| 163 | [in] ISensor *pSensor,
|
---|
| 164 | [in] SensorState state) ;
|
---|
| 165 | }
|
---|
| 166 |
|
---|
| 167 | [
|
---|
| 168 | uuid(5d8dcc91-4641-47e7-b7c3-b74f48a6c391),
|
---|
| 169 | object
|
---|
| 170 | ]
|
---|
| 171 | interface ISensorEvents : IUnknown
|
---|
| 172 | {
|
---|
| 173 | HRESULT OnStateChanged(
|
---|
| 174 | [in] ISensor *pSensor,
|
---|
| 175 | [in] SensorState state);
|
---|
| 176 |
|
---|
| 177 | HRESULT OnDataUpdated(
|
---|
| 178 | [in] ISensor *pSensor,
|
---|
| 179 | [in] ISensorDataReport *pNewData);
|
---|
| 180 |
|
---|
| 181 | HRESULT OnEvent(
|
---|
| 182 | [in] ISensor *pSensor,
|
---|
| 183 | [in] REFGUID eventID,
|
---|
| 184 | [in] IPortableDeviceValues *pEventData);
|
---|
| 185 |
|
---|
| 186 | HRESULT OnLeave([in] REFSENSOR_ID ID);
|
---|
| 187 | }
|
---|
| 188 |
|
---|
| 189 | [
|
---|
| 190 | uuid(15092592-5270-4c6c-aaa0-11764f189a8f)
|
---|
| 191 | ]
|
---|
| 192 | library SensorsApiLib
|
---|
| 193 | {
|
---|
| 194 | [
|
---|
| 195 | uuid(77a1c827-fcd2-4689-8915-9d613cc5fa3e)
|
---|
| 196 | ]
|
---|
| 197 | coclass SensorManager {
|
---|
| 198 | interface SensorManager;
|
---|
| 199 | }
|
---|
| 200 | }
|
---|