windows.devices.enumeration.idl 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. /*
  2. * Copyright 2021 Gijs Vermeulen
  3. *
  4. * This library is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Lesser General Public
  6. * License as published by the Free Software Foundation; either
  7. * version 2.1 of the License, or (at your option) any later version.
  8. *
  9. * This library is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * Lesser General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Lesser General Public
  15. * License along with this library; if not, write to the Free Software
  16. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  17. */
  18. #ifdef __WIDL__
  19. #pragma winrt ns_prefix
  20. #endif
  21. import "inspectable.idl";
  22. import "asyncinfo.idl";
  23. import "eventtoken.idl";
  24. import "windowscontracts.idl";
  25. import "windows.storage.streams.idl";
  26. import "windows.foundation.idl";
  27. namespace Windows {
  28. namespace Devices {
  29. namespace Enumeration {
  30. typedef enum DeviceWatcherStatus DeviceWatcherStatus;
  31. typedef enum Panel Panel;
  32. interface IDeviceInformation;
  33. interface IDeviceInformationStatics;
  34. interface IDeviceInformationStatics2;
  35. interface IDeviceInformationUpdate;
  36. interface IEnclosureLocation;
  37. runtimeclass DeviceInformation;
  38. runtimeclass DeviceInformationUpdate;
  39. runtimeclass DeviceThumbnail;
  40. runtimeclass DeviceWatcher;
  41. runtimeclass EnclosureLocation;
  42. }
  43. }
  44. }
  45. namespace Windows
  46. {
  47. namespace Devices
  48. {
  49. namespace Enumeration
  50. {
  51. declare
  52. {
  53. interface Windows.Foundation.AsyncOperationCompletedHandler<Windows.Devices.Enumeration.DeviceInformation *>;
  54. interface Windows.Foundation.AsyncOperationCompletedHandler<Windows.Devices.Enumeration.DeviceThumbnail *>;
  55. interface Windows.Foundation.Collections.IMapView<HSTRING, IInspectable *>;
  56. interface Windows.Foundation.IAsyncOperation<Windows.Devices.Enumeration.DeviceInformation *>;
  57. interface Windows.Foundation.IAsyncOperation<Windows.Devices.Enumeration.DeviceThumbnail *>;
  58. interface Windows.Foundation.TypedEventHandler<Windows.Devices.Enumeration.DeviceWatcher *, IInspectable *>;
  59. interface Windows.Foundation.TypedEventHandler<Windows.Devices.Enumeration.DeviceWatcher *, Windows.Devices.Enumeration.DeviceInformation *>;
  60. interface Windows.Foundation.TypedEventHandler<Windows.Devices.Enumeration.DeviceWatcher *, Windows.Devices.Enumeration.DeviceInformationUpdate *>;
  61. }
  62. }
  63. }
  64. }
  65. namespace Windows
  66. {
  67. namespace Storage
  68. {
  69. namespace Streams
  70. {
  71. interface IContentTypeProvider;
  72. interface IInputStream;
  73. interface IOutputStream;
  74. interface IRandomAccessStream;
  75. interface IRandomAccessStreamWithContentType;
  76. }
  77. }
  78. }
  79. namespace Windows {
  80. namespace Devices {
  81. namespace Enumeration {
  82. enum DeviceWatcherStatus
  83. {
  84. Created = 0,
  85. Started = 1,
  86. EnumerationCompleted = 2,
  87. Stopping = 3,
  88. Stopped = 4,
  89. Aborted = 5
  90. };
  91. enum Panel
  92. {
  93. Unknown = 0,
  94. Front = 1,
  95. Back = 2,
  96. Top = 3,
  97. Bottom = 4,
  98. Left = 5,
  99. Right = 6
  100. };
  101. [
  102. exclusiveto(Windows.Devices.Enumeration.DeviceInformation),
  103. uuid(aba0fb95-4398-489d-8e44-e6130927011f)
  104. ]
  105. interface IDeviceInformation : IInspectable
  106. {
  107. [propget] HRESULT Id([out, retval] HSTRING *value);
  108. [propget] HRESULT Name([out, retval] HSTRING *value);
  109. [propget] HRESULT IsEnabled([out, retval] boolean *value);
  110. [propget] HRESULT IsDefault([out, retval] boolean *value);
  111. [propget] HRESULT EnclosureLocation([out, retval] Windows.Devices.Enumeration.EnclosureLocation **value);
  112. [propget] HRESULT Properties([out, retval] Windows.Foundation.Collections.IMapView<HSTRING, IInspectable *> **value);
  113. HRESULT Update([in] Windows.Devices.Enumeration.DeviceInformationUpdate *info);
  114. HRESULT GetThumbnailAsync([out, retval] Windows.Foundation.IAsyncOperation<Windows.Devices.Enumeration.DeviceThumbnail *> **operation);
  115. HRESULT GetGlyphThumbnailAsync([out, retval] Windows.Foundation.IAsyncOperation<Windows.Devices.Enumeration.DeviceThumbnail *> **operation);
  116. }
  117. [
  118. exclusiveto(Windows.Devices.Enumeration.DeviceInformationUpdate),
  119. uuid(8f315305-d972-44b7-a37e-9e822c78213b)
  120. ]
  121. interface IDeviceInformationUpdate : IInspectable
  122. {
  123. [propget] HRESULT Id([out, retval] HSTRING *value);
  124. [propget] HRESULT Properties([out, retval] Windows.Foundation.Collections.IMapView<HSTRING, IInspectable *> **value);
  125. }
  126. [
  127. exclusiveto(Windows.Devices.Enumeration.DeviceWatcher),
  128. uuid(c9eab97d-8f6b-4f96-a9f4-abc814e22271),
  129. ]
  130. interface IDeviceWatcher : IInspectable
  131. {
  132. [eventadd] HRESULT Added([in] Windows.Foundation.TypedEventHandler<Windows.Devices.Enumeration.DeviceWatcher*,
  133. Windows.Devices.Enumeration.DeviceInformation *> *handler, [out, retval] EventRegistrationToken *token);
  134. [eventremove] HRESULT Added([in] EventRegistrationToken token);
  135. [eventadd] HRESULT Updated([in] Windows.Foundation.TypedEventHandler<Windows.Devices.Enumeration.DeviceWatcher *,
  136. Windows.Devices.Enumeration.DeviceInformationUpdate *> *handler, [out, retval] EventRegistrationToken *token);
  137. [eventremove] HRESULT Updated([in] EventRegistrationToken token);
  138. [eventadd] HRESULT Removed([in] Windows.Foundation.TypedEventHandler<Windows.Devices.Enumeration.DeviceWatcher *,
  139. Windows.Devices.Enumeration.DeviceInformationUpdate *> *handler, [out, retval] EventRegistrationToken *token);
  140. [eventremove] HRESULT Removed([in] EventRegistrationToken token);
  141. [eventadd] HRESULT EnumerationCompleted([in] Windows.Foundation.TypedEventHandler<Windows.Devices.Enumeration.DeviceWatcher *,
  142. IInspectable *> *handler, [out, retval] EventRegistrationToken *token);
  143. [eventremove] HRESULT EnumerationCompleted([in] EventRegistrationToken token);
  144. [eventadd] HRESULT Stopped([in] Windows.Foundation.TypedEventHandler<Windows.Devices.Enumeration.DeviceWatcher *,
  145. IInspectable *> *handler, [out, retval] EventRegistrationToken *token);
  146. [eventremove] HRESULT Stopped([in] EventRegistrationToken token);
  147. [propget] HRESULT Status([out, retval] Windows.Devices.Enumeration.DeviceWatcherStatus *status);
  148. HRESULT Start();
  149. HRESULT Stop();
  150. }
  151. [
  152. exclusiveto(Windows.Devices.Enumeration.EnclosureLocation),
  153. uuid(42340a27-5810-459c-aabb-c65e1f813ecf)
  154. ]
  155. interface IEnclosureLocation : IInspectable
  156. {
  157. [propget] HRESULT InDock([out, retval] boolean *value);
  158. [propget] HRESULT InLid([out, retval] boolean *value);
  159. [propget] HRESULT Panel([out, retval] Windows.Devices.Enumeration.Panel *value);
  160. }
  161. [
  162. contract(Windows.Foundation.UniversalApiContract, 1.0),
  163. marshaling_behavior(agile),
  164. static(Windows.Devices.Enumeration.IDeviceInformationStatics, Windows.Foundation.UniversalApiContract, 1.0),
  165. static(Windows.Devices.Enumeration.IDeviceInformationStatics2, Windows.Foundation.UniversalApiContract, 1.0),
  166. threading(both)
  167. ]
  168. runtimeclass DeviceInformation
  169. {
  170. [default] interface Windows.Devices.Enumeration.IDeviceInformation;
  171. [contract(Windows.Foundation.UniversalApiContract, 1.0)] interface Windows.Devices.Enumeration.IDeviceInformation2;
  172. }
  173. [
  174. marshaling_behavior(agile),
  175. ]
  176. runtimeclass DeviceInformationUpdate
  177. {
  178. [default] interface Windows.Devices.Enumeration.IDeviceInformationUpdate;
  179. interface Windows.Devices.Enumeration.IDeviceInformationUpdate2;
  180. }
  181. [
  182. marshaling_behavior(agile),
  183. ]
  184. runtimeclass DeviceThumbnail
  185. {
  186. [default] interface Windows.Storage.Streams.IRandomAccessStreamWithContentType;
  187. interface Windows.Storage.Streams.IContentTypeProvider;
  188. interface Windows.Storage.Streams.IRandomAccessStream;
  189. interface Windows.Storage.Streams.IOutputStream;
  190. interface Windows.Foundation.IClosable;
  191. interface Windows.Storage.Streams.IInputStream;
  192. }
  193. [
  194. marshaling_behavior(agile),
  195. ]
  196. runtimeclass DeviceWatcher
  197. {
  198. [default] interface Windows.Devices.Enumeration.IDeviceWatcher;
  199. interface Windows.Devices.Enumeration.IDeviceWatcher2;
  200. }
  201. [
  202. marshaling_behavior(agile)
  203. ]
  204. runtimeclass EnclosureLocation
  205. {
  206. [default] interface Windows.Devices.Enumeration.IEnclosureLocation;
  207. }
  208. }
  209. }
  210. }