windows.foundation.idl 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. /*
  2. * Copyright 2015 Jacek Caban for CodeWeavers
  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 "windowscontracts.idl";
  24. import "eventtoken.idl";
  25. /* import "ivectorchangedeventargs.idl"; */
  26. import "windows.foundation.collections.idl";
  27. namespace Windows.Foundation {
  28. typedef enum PropertyType PropertyType;
  29. typedef struct Point Point;
  30. typedef struct Size Size;
  31. typedef struct Rect Rect;
  32. typedef struct DateTime DateTime;
  33. typedef struct TimeSpan TimeSpan;
  34. interface IAsyncAction;
  35. interface IClosable;
  36. interface IMemoryBuffer;
  37. interface IMemoryBufferFactory;
  38. interface IMemoryBufferReference;
  39. interface IStringable;
  40. runtimeclass MemoryBuffer;
  41. declare {
  42. interface Windows.Foundation.Collections.IIterable<HSTRING>;
  43. interface Windows.Foundation.Collections.IIterable<IInspectable *>;
  44. interface Windows.Foundation.Collections.IIterator<HSTRING>;
  45. interface Windows.Foundation.Collections.IIterator<IInspectable *>;
  46. interface Windows.Foundation.Collections.IVectorView<HSTRING>;
  47. interface Windows.Foundation.Collections.IVectorView<IInspectable *>;
  48. interface Windows.Foundation.Collections.IVector<HSTRING>;
  49. interface Windows.Foundation.Collections.IVector<IInspectable *>;
  50. interface Windows.Foundation.Collections.IMapView<HSTRING, Windows.Foundation.Collections.IVectorView<HSTRING> *>;
  51. interface Windows.Foundation.EventHandler<IInspectable *>;
  52. interface Windows.Foundation.AsyncOperationCompletedHandler<IInspectable *>;
  53. interface Windows.Foundation.AsyncOperationCompletedHandler<boolean>;
  54. interface Windows.Foundation.IAsyncOperation<IInspectable *>;
  55. interface Windows.Foundation.IAsyncOperation<boolean>;
  56. interface Windows.Foundation.IReference<INT32>;
  57. interface Windows.Foundation.TypedEventHandler<IInspectable *, IInspectable *>;
  58. interface Windows.Foundation.TypedEventHandler<Windows.Foundation.IMemoryBufferReference *, IInspectable *>;
  59. }
  60. [
  61. contract(Windows.Foundation.FoundationContract, 1.0),
  62. uuid(a4ed5c81-76c9-40bd-8be6-b1d90fb20ae7)
  63. ]
  64. delegate HRESULT AsyncActionCompletedHandler([in] Windows.Foundation.IAsyncAction *action, [in] AsyncStatus status);
  65. [contract(Windows.Foundation.FoundationContract, 1.0)]
  66. enum PropertyType
  67. {
  68. Empty = 0,
  69. UInt8 = 1,
  70. Int16 = 2,
  71. UInt16 = 3,
  72. Int32 = 4,
  73. UInt32 = 5,
  74. Int64 = 6,
  75. UInt64 = 7,
  76. Single = 8,
  77. Double = 9,
  78. Char16 = 10,
  79. Boolean = 11,
  80. String = 12,
  81. Inspectable = 13,
  82. DateTime = 14,
  83. TimeSpan = 15,
  84. Guid = 16,
  85. Point = 17,
  86. Size = 18,
  87. Rect = 19,
  88. OtherType = 20,
  89. UInt8Array = 1025,
  90. Int16Array = 1026,
  91. UInt16Array = 1027,
  92. Int32Array = 1028,
  93. UInt32Array = 1029,
  94. Int64Array = 1030,
  95. UInt64Array = 1031,
  96. SingleArray = 1032,
  97. DoubleArray = 1033,
  98. Char16Array = 1034,
  99. BooleanArray = 1035,
  100. StringArray = 1036,
  101. InspectableArray = 1037,
  102. DateTimeArray = 1038,
  103. TimeSpanArray = 1039,
  104. GuidArray = 1040,
  105. PointArray = 1041,
  106. SizeArray = 1042,
  107. RectArray = 1043,
  108. OtherTypeArray = 1044,
  109. };
  110. [contract(Windows.Foundation.FoundationContract, 1.0)]
  111. struct Point
  112. {
  113. FLOAT X;
  114. FLOAT Y;
  115. };
  116. [contract(Windows.Foundation.FoundationContract, 1.0)]
  117. struct Size
  118. {
  119. FLOAT Width;
  120. FLOAT Height;
  121. };
  122. [contract(Windows.Foundation.FoundationContract, 1.0)]
  123. struct Rect
  124. {
  125. FLOAT X;
  126. FLOAT Y;
  127. FLOAT Width;
  128. FLOAT Height;
  129. };
  130. [contract(Windows.Foundation.FoundationContract, 1.0)]
  131. struct DateTime
  132. {
  133. INT64 UniversalTime;
  134. };
  135. [contract(Windows.Foundation.FoundationContract, 1.0)]
  136. struct TimeSpan
  137. {
  138. INT64 Duration;
  139. };
  140. [
  141. contract(Windows.Foundation.FoundationContract, 1.0),
  142. uuid(96369f54-8eb6-48f0-abce-c1b211e627c3)
  143. ]
  144. interface IStringable : IInspectable
  145. {
  146. HRESULT ToString([out, retval] HSTRING *value);
  147. }
  148. [
  149. contract(Windows.Foundation.FoundationContract, 1.0),
  150. uuid(30d5a829-7fa4-4026-83bb-d75bae4ea99e)
  151. ]
  152. interface IClosable : IInspectable
  153. {
  154. HRESULT Close();
  155. }
  156. [
  157. contract(Windows.Foundation.FoundationContract, 1.0),
  158. uuid(5a648006-843a-4da9-865b-9d26e5dfad7b)
  159. ]
  160. interface IAsyncAction : IInspectable
  161. requires IAsyncInfo
  162. {
  163. [propput] HRESULT Completed([in] Windows.Foundation.AsyncActionCompletedHandler *handler);
  164. [propget] HRESULT Completed([out, retval] Windows.Foundation.AsyncActionCompletedHandler **handler);
  165. HRESULT GetResults();
  166. }
  167. [
  168. contract(Windows.Foundation.UniversalApiContract, 1.0),
  169. uuid(fbc4dd2a-245b-11e4-af98-689423260cf8)
  170. ]
  171. interface IMemoryBuffer : IInspectable
  172. requires Windows.Foundation.IClosable
  173. {
  174. HRESULT CreateReference([out, retval] Windows.Foundation.IMemoryBufferReference **reference);
  175. }
  176. [
  177. contract(Windows.Foundation.UniversalApiContract, 1.0),
  178. exclusiveto(Windows.Foundation.MemoryBuffer),
  179. uuid(fbc4dd2b-245b-11e4-af98-689423260cf8)
  180. ]
  181. interface IMemoryBufferFactory : IInspectable
  182. {
  183. HRESULT Create([in, range(0x00000000, 0x7fffffff)] UINT32 capacity,
  184. [out, retval] Windows.Foundation.MemoryBuffer **value);
  185. }
  186. [
  187. contract(Windows.Foundation.UniversalApiContract, 1.0),
  188. uuid(fbc4dd29-245b-11e4-af98-689423260cf8)
  189. ]
  190. interface IMemoryBufferReference : IInspectable
  191. requires Windows.Foundation.IClosable
  192. {
  193. [propget] HRESULT Capacity([out, retval] UINT32 *value);
  194. [eventadd] HRESULT Closed([in] Windows.Foundation.TypedEventHandler<Windows.Foundation.IMemoryBufferReference *, IInspectable *> *handler,
  195. [out, retval] EventRegistrationToken *cookie);
  196. [eventremove] HRESULT Closed([in] EventRegistrationToken cookie);
  197. }
  198. [
  199. activatable(Windows.Foundation.IMemoryBufferFactory, Windows.Foundation.UniversalApiContract, 1.0),
  200. contract(Windows.Foundation.UniversalApiContract, 1.0),
  201. marshaling_behavior(agile),
  202. threading(both)
  203. ]
  204. runtimeclass MemoryBuffer
  205. {
  206. [default] interface Windows.Foundation.IMemoryBuffer;
  207. interface Windows.Foundation.IClosable;
  208. }
  209. }