| 1 |
/* |
| 2 |
* Copyright 2021 Jactry Zeng 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 |
|
| 19 |
#ifdef __WIDL__ |
| 20 |
#pragma winrt ns_prefix |
| 21 |
#endif |
| 22 |
|
| 23 |
import "inspectable.idl"; |
| 24 |
import "eventtoken.idl"; |
| 25 |
import "windows.foundation.idl"; |
| 26 |
|
| 27 |
namespace Windows.Storage { |
| 28 |
interface IStorageFile; |
| 29 |
} |
| 30 |
|
| 31 |
namespace Windows.Storage.Streams { |
| 32 |
typedef enum ByteOrder ByteOrder; |
| 33 |
typedef enum InputStreamOptions InputStreamOptions; |
| 34 |
typedef enum UnicodeEncoding UnicodeEncoding; |
| 35 |
interface IBuffer; |
| 36 |
interface IBufferFactory; |
| 37 |
interface IBufferStatics; |
| 38 |
interface IContentTypeProvider; |
| 39 |
interface IDataWriter; |
| 40 |
interface IDataWriterFactory; |
| 41 |
interface IInputStream; |
| 42 |
interface IInputStreamReference; |
| 43 |
interface IOutputStream; |
| 44 |
interface IRandomAccessStream; |
| 45 |
interface IRandomAccessStreamReference; |
| 46 |
interface IRandomAccessStreamReferenceStatics; |
| 47 |
interface IRandomAccessStreamStatics; |
| 48 |
interface IRandomAccessStreamWithContentType; |
| 49 |
runtimeclass Buffer; |
| 50 |
runtimeclass DataWriter; |
| 51 |
runtimeclass DataWriterStoreOperation; |
| 52 |
runtimeclass InMemoryRandomAccessStream; |
| 53 |
runtimeclass RandomAccessStream; |
| 54 |
runtimeclass RandomAccessStreamReference; |
| 55 |
|
| 56 |
declare { |
| 57 |
interface Windows.Foundation.AsyncOperationCompletedHandler<Windows.Storage.Streams.IBuffer *>; |
| 58 |
interface Windows.Foundation.AsyncOperationCompletedHandler<Windows.Storage.Streams.IInputStream *>; |
| 59 |
interface Windows.Foundation.AsyncOperationCompletedHandler<Windows.Storage.Streams.IOutputStream *>; |
| 60 |
interface Windows.Foundation.IAsyncOperation<UINT32>; |
| 61 |
interface Windows.Foundation.IAsyncOperation<Windows.Storage.Streams.IBuffer *>; |
| 62 |
interface Windows.Foundation.IAsyncOperation<Windows.Storage.Streams.IInputStream *>; |
| 63 |
interface Windows.Foundation.IAsyncOperation<Windows.Storage.Streams.IOutputStream *>; |
| 64 |
interface Windows.Foundation.Collections.IIterable<Windows.Storage.Streams.IRandomAccessStream *>; |
| 65 |
interface Windows.Foundation.Collections.IIterator<Windows.Storage.Streams.IRandomAccessStream *>; |
| 66 |
interface Windows.Foundation.Collections.IMapView<HSTRING, Windows.Storage.Streams.RandomAccessStreamReference *>; |
| 67 |
interface Windows.Foundation.Collections.IMap<HSTRING, Windows.Storage.Streams.RandomAccessStreamReference *>; |
| 68 |
interface Windows.Foundation.Collections.IVectorView<Windows.Storage.Streams.IRandomAccessStream *>; |
| 69 |
interface Windows.Foundation.Collections.IVector<Windows.Storage.Streams.IRandomAccessStream *>; |
| 70 |
interface Windows.Foundation.AsyncOperationCompletedHandler<Windows.Foundation.Collections.IMapView<HSTRING, Windows.Storage.Streams.RandomAccessStreamReference *> *>; |
| 71 |
interface Windows.Foundation.AsyncOperationCompletedHandler<Windows.Storage.Streams.IRandomAccessStream *>; |
| 72 |
interface Windows.Foundation.AsyncOperationCompletedHandler<Windows.Storage.Streams.IRandomAccessStreamReference *>; |
| 73 |
interface Windows.Foundation.AsyncOperationCompletedHandler<Windows.Storage.Streams.IRandomAccessStreamWithContentType *>; |
| 74 |
interface Windows.Foundation.AsyncOperationCompletedHandler<Windows.Storage.Streams.RandomAccessStreamReference *>; |
| 75 |
interface Windows.Foundation.AsyncOperationProgressHandler<UINT64,UINT64>; |
| 76 |
interface Windows.Foundation.AsyncOperationProgressHandler<Windows.Storage.Streams.IBuffer *,UINT32>; |
| 77 |
interface Windows.Foundation.AsyncOperationWithProgressCompletedHandler<Windows.Storage.Streams.IBuffer *,UINT32>; |
| 78 |
interface Windows.Foundation.AsyncOperationWithProgressCompletedHandler<UINT64,UINT64>; |
| 79 |
interface Windows.Foundation.IAsyncOperation<Windows.Foundation.Collections.IMapView<HSTRING, Windows.Storage.Streams.RandomAccessStreamReference *> *>; |
| 80 |
interface Windows.Foundation.IAsyncOperation<Windows.Storage.Streams.IRandomAccessStream *>; |
| 81 |
interface Windows.Foundation.IAsyncOperation<Windows.Storage.Streams.IRandomAccessStreamReference *>; |
| 82 |
interface Windows.Foundation.IAsyncOperation<Windows.Storage.Streams.IRandomAccessStreamWithContentType *>; |
| 83 |
interface Windows.Foundation.IAsyncOperation<Windows.Storage.Streams.RandomAccessStreamReference *>; |
| 84 |
interface Windows.Foundation.IAsyncOperationWithProgress<UINT64,UINT64>; |
| 85 |
interface Windows.Foundation.IAsyncOperationWithProgress<Windows.Storage.Streams.IBuffer *,UINT32>; |
| 86 |
} |
| 87 |
|
| 88 |
[ |
| 89 |
contract(Windows.Foundation.UniversalApiContract, 1.0) |
| 90 |
] |
| 91 |
enum ByteOrder |
| 92 |
{ |
| 93 |
LittleEndian = 0, |
| 94 |
BigEndian = 1, |
| 95 |
}; |
| 96 |
|
| 97 |
[ |
| 98 |
contract(Windows.Foundation.UniversalApiContract, 1.0), |
| 99 |
flags |
| 100 |
] |
| 101 |
enum InputStreamOptions |
| 102 |
{ |
| 103 |
None = 0x0, |
| 104 |
Partial = 0x1, |
| 105 |
ReadAhead = 0x2, |
| 106 |
}; |
| 107 |
|
| 108 |
[ |
| 109 |
contract(Windows.Foundation.UniversalApiContract, 1.0) |
| 110 |
] |
| 111 |
enum UnicodeEncoding |
| 112 |
{ |
| 113 |
Utf8 = 0, |
| 114 |
Utf16LE = 1, |
| 115 |
Utf16BE = 2, |
| 116 |
}; |
| 117 |
|
| 118 |
[ |
| 119 |
contract(Windows.Foundation.UniversalApiContract, 1.0), |
| 120 |
uuid(905a0fe0-bc53-11df-8c49-001e4fc686da) |
| 121 |
] |
| 122 |
interface IBuffer : IInspectable |
| 123 |
{ |
| 124 |
[propget] HRESULT Capacity([out, retval] UINT32 *value); |
| 125 |
[propget] HRESULT Length([out, retval] UINT32 *value); |
| 126 |
[propput] HRESULT Length([in] UINT32 value); |
| 127 |
} |
| 128 |
|
| 129 |
[ |
| 130 |
contract(Windows.Foundation.UniversalApiContract, 1.0), |
| 131 |
exclusiveto(Windows.Storage.Streams.Buffer), |
| 132 |
uuid(71af914d-c10f-484b-bc50-14bc623b3a27) |
| 133 |
] |
| 134 |
interface IBufferFactory : IInspectable |
| 135 |
{ |
| 136 |
HRESULT Create([in, range(0x00000000, 0x7fffffff)] UINT32 capacity, |
| 137 |
[out, retval] Windows.Storage.Streams.Buffer **value); |
| 138 |
} |
| 139 |
|
| 140 |
[ |
| 141 |
contract(Windows.Foundation.UniversalApiContract, 1.0), |
| 142 |
exclusiveto(Windows.Storage.Streams.Buffer), |
| 143 |
uuid(e901e65b-d716-475a-a90a-af7229b1e741) |
| 144 |
] |
| 145 |
interface IBufferStatics : IInspectable |
| 146 |
{ |
| 147 |
HRESULT CreateCopyFromMemoryBuffer([in] Windows.Foundation.IMemoryBuffer *input, |
| 148 |
[out, retval] Windows.Storage.Streams.Buffer **value); |
| 149 |
HRESULT CreateMemoryBufferOverIBuffer([in] Windows.Storage.Streams.IBuffer *input, |
| 150 |
[out, retval] Windows.Foundation.MemoryBuffer **value); |
| 151 |
} |
| 152 |
|
| 153 |
[ |
| 154 |
contract(Windows.Foundation.UniversalApiContract, 1.0), |
| 155 |
uuid(97d098a5-3b99-4de9-88a5-e11d2f50c795) |
| 156 |
] |
| 157 |
interface IContentTypeProvider : IInspectable |
| 158 |
{ |
| 159 |
[propget] HRESULT ContentType([out, retval] HSTRING *value); |
| 160 |
} |
| 161 |
|
| 162 |
[ |
| 163 |
contract(Windows.Foundation.UniversalApiContract, 1.0), |
| 164 |
uuid(64b89265-d341-4922-b38a-dd4af8808c4e) |
| 165 |
] |
| 166 |
interface IDataWriter : IInspectable |
| 167 |
{ |
| 168 |
[propget] HRESULT UnstoredBufferLength([out, retval] UINT32 *value); |
| 169 |
[propget] HRESULT UnicodeEncoding([out, retval] Windows.Storage.Streams.UnicodeEncoding *value); |
| 170 |
[propput] HRESULT UnicodeEncoding([in] Windows.Storage.Streams.UnicodeEncoding value); |
| 171 |
[propget] HRESULT ByteOrder([out, retval] Windows.Storage.Streams.ByteOrder *value); |
| 172 |
[propput] HRESULT ByteOrder([in] Windows.Storage.Streams.ByteOrder value); |
| 173 |
HRESULT WriteByte([in] BYTE value); |
| 174 |
HRESULT WriteBytes([in] UINT32 value_size, [in, size_is(value_size)] BYTE *value); |
| 175 |
[overload("WriteBuffer")] HRESULT WriteBuffer([in] Windows.Storage.Streams.IBuffer *buffer); |
| 176 |
[overload("WriteBuffer")] HRESULT WriteBufferRange([in] Windows.Storage.Streams.IBuffer *buffer, [in] UINT32 start, [in] UINT32 count); |
| 177 |
HRESULT WriteBoolean([in] boolean value); |
| 178 |
HRESULT WriteGuid([in] GUID value); |
| 179 |
HRESULT WriteInt16([in] INT16 value); |
| 180 |
HRESULT WriteInt32([in] INT32 value); |
| 181 |
HRESULT WriteInt64([in] INT64 value); |
| 182 |
HRESULT WriteUInt16([in] UINT16 value); |
| 183 |
HRESULT WriteUInt32([in] UINT32 value); |
| 184 |
HRESULT WriteUInt64([in] UINT64 value); |
| 185 |
HRESULT WriteSingle([in] FLOAT value); |
| 186 |
HRESULT WriteDouble([in] DOUBLE value); |
| 187 |
HRESULT WriteDateTime([in] Windows.Foundation.DateTime value); |
| 188 |
HRESULT WriteTimeSpan([in] Windows.Foundation.TimeSpan value); |
| 189 |
HRESULT WriteString([in] HSTRING value, [out, retval] UINT32 *code_unit_count); |
| 190 |
HRESULT MeasureString([in] HSTRING value, [out, retval] UINT32 *code_unit_count); |
| 191 |
HRESULT StoreAsync([out, retval] Windows.Storage.Streams.DataWriterStoreOperation **operation); |
| 192 |
HRESULT FlushAsync([out, retval] Windows.Foundation.IAsyncOperation<boolean> **operation); |
| 193 |
HRESULT DetachBuffer([out, retval] Windows.Storage.Streams.IBuffer **buffer); |
| 194 |
HRESULT DetachStream([out, retval] Windows.Storage.Streams.IOutputStream **output_stream); |
| 195 |
} |
| 196 |
|
| 197 |
[ |
| 198 |
contract(Windows.Foundation.UniversalApiContract, 1.0), |
| 199 |
exclusiveto(Windows.Storage.Streams.DataWriter), |
| 200 |
uuid(338c67c2-8b84-4c2b-9c50-7b8767847a1f) |
| 201 |
] |
| 202 |
interface IDataWriterFactory : IInspectable |
| 203 |
{ |
| 204 |
HRESULT CreateDataWriter( |
| 205 |
[in] Windows.Storage.Streams.IOutputStream *output_stream, |
| 206 |
[out, retval] Windows.Storage.Streams.DataWriter **data_writer); |
| 207 |
} |
| 208 |
|
| 209 |
[ |
| 210 |
contract(Windows.Foundation.UniversalApiContract, 1.0), |
| 211 |
uuid(905a0fe2-bc53-11df-8c49-001e4fc686da) |
| 212 |
] |
| 213 |
interface IInputStream : IInspectable |
| 214 |
requires Windows.Foundation.IClosable |
| 215 |
{ |
| 216 |
HRESULT ReadAsync( |
| 217 |
[in] Windows.Storage.Streams.IBuffer *buffer, |
| 218 |
[in] UINT32 count, |
| 219 |
[in] Windows.Storage.Streams.InputStreamOptions options, |
| 220 |
[out, retval] Windows.Foundation.IAsyncOperationWithProgress<Windows.Storage.Streams.IBuffer *, UINT32> **operation); |
| 221 |
} |
| 222 |
|
| 223 |
[ |
| 224 |
contract(Windows.Foundation.UniversalApiContract, 1.0), |
| 225 |
uuid(43929d18-5ec9-4b5a-919c-4205b0c804b6) |
| 226 |
] |
| 227 |
interface IInputStreamReference : IInspectable |
| 228 |
{ |
| 229 |
HRESULT OpenSequentialReadAsync([out, retval] Windows.Foundation.IAsyncOperation<Windows.Storage.Streams.IInputStream *> **operation); |
| 230 |
} |
| 231 |
|
| 232 |
[ |
| 233 |
contract(Windows.Foundation.UniversalApiContract, 1.0), |
| 234 |
uuid(905a0fe6-bc53-11df-8c49-001e4fc686da) |
| 235 |
] |
| 236 |
interface IOutputStream : IInspectable |
| 237 |
requires Windows.Foundation.IClosable |
| 238 |
{ |
| 239 |
HRESULT WriteAsync( |
| 240 |
[in] Windows.Storage.Streams.IBuffer *buffer, |
| 241 |
[out, retval] Windows.Foundation.IAsyncOperationWithProgress<UINT32, UINT32> **operation); |
| 242 |
HRESULT FlushAsync([out, retval] Windows.Foundation.IAsyncOperation<boolean> **operation); |
| 243 |
} |
| 244 |
|
| 245 |
[ |
| 246 |
contract(Windows.Foundation.UniversalApiContract, 1.0), |
| 247 |
exclusiveto(Windows.Storage.Streams.RandomAccessStream), |
| 248 |
uuid(524cedcf-6e29-4ce5-9573-6b753db66c3a) |
| 249 |
] |
| 250 |
interface IRandomAccessStreamStatics : IInspectable |
| 251 |
{ |
| 252 |
[overload("CopyAsync")] HRESULT CopyAsync([in] Windows.Storage.Streams.IInputStream *source, [in] Windows.Storage.Streams.IOutputStream *dest, [out, retval] Windows.Foundation.IAsyncOperationWithProgress<UINT64, UINT64> **operation); |
| 253 |
[overload("CopyAsync")] HRESULT CopySizeAsync([in] Windows.Storage.Streams.IInputStream *source, [in] Windows.Storage.Streams.IOutputStream *dest, [in] UINT64 bytesToCopy, [out, retval] Windows.Foundation.IAsyncOperationWithProgress<UINT64, UINT64> **operation); |
| 254 |
HRESULT CopyAndCloseAsync([in] Windows.Storage.Streams.IInputStream *source, [in] Windows.Storage.Streams.IOutputStream *dest, [out, retval] Windows.Foundation.IAsyncOperationWithProgress<UINT64, UINT64> **operation); |
| 255 |
} |
| 256 |
|
| 257 |
[ |
| 258 |
contract(Windows.Foundation.UniversalApiContract, 1.0), |
| 259 |
uuid(905a0fe1-bc53-11df-8c49-001e4fc686da), |
| 260 |
] |
| 261 |
interface IRandomAccessStream : IInspectable |
| 262 |
requires Windows.Foundation.IClosable, |
| 263 |
Windows.Storage.Streams.IInputStream, |
| 264 |
Windows.Storage.Streams.IOutputStream |
| 265 |
{ |
| 266 |
[propget] HRESULT Size([out, retval] UINT64 *value); |
| 267 |
[propput] HRESULT Size([in] UINT64 value); |
| 268 |
HRESULT GetInputStreamAt([in] UINT64 position, [out, retval] Windows.Storage.Streams.IInputStream **stream); |
| 269 |
HRESULT GetOutputStreamAt([in] UINT64 position, [out, retval] Windows.Storage.Streams.IOutputStream **stream); |
| 270 |
[propget] HRESULT Position([out, retval] UINT64 *value); |
| 271 |
HRESULT Seek([in] UINT64 position); |
| 272 |
HRESULT CloneStream([out, retval] Windows.Storage.Streams.IRandomAccessStream **stream); |
| 273 |
[propget] HRESULT CanRead([out, retval] boolean *value); |
| 274 |
[propget] HRESULT CanWrite([out, retval] boolean *value); |
| 275 |
} |
| 276 |
|
| 277 |
[ |
| 278 |
contract(Windows.Foundation.UniversalApiContract, 1.0), |
| 279 |
uuid(33ee3134-1dd6-4e3a-8067-d1c162e8642b) |
| 280 |
] |
| 281 |
interface IRandomAccessStreamReference : IInspectable |
| 282 |
{ |
| 283 |
HRESULT OpenReadAsync([out, retval] Windows.Foundation.IAsyncOperation<Windows.Storage.Streams.IRandomAccessStreamWithContentType *> **operation); |
| 284 |
} |
| 285 |
|
| 286 |
[ |
| 287 |
contract(Windows.Foundation.UniversalApiContract, 1.0), |
| 288 |
exclusiveto(Windows.Storage.Streams.RandomAccessStreamReference), |
| 289 |
uuid(857309dc-3fbf-4e7d-986f-ef3b1a07a964) |
| 290 |
] |
| 291 |
interface IRandomAccessStreamReferenceStatics : IInspectable |
| 292 |
{ |
| 293 |
HRESULT CreateFromFile( |
| 294 |
[in] Windows.Storage.IStorageFile *file, |
| 295 |
[out, retval] Windows.Storage.Streams.RandomAccessStreamReference **stream_reference); |
| 296 |
HRESULT CreateFromUri( |
| 297 |
[in] Windows.Foundation.Uri *uri, |
| 298 |
[out, retval] Windows.Storage.Streams.RandomAccessStreamReference **stream_reference); |
| 299 |
HRESULT CreateFromStream( |
| 300 |
[in] Windows.Storage.Streams.IRandomAccessStream *stream, |
| 301 |
[out, retval] Windows.Storage.Streams.RandomAccessStreamReference **stream_reference); |
| 302 |
} |
| 303 |
|
| 304 |
[ |
| 305 |
uuid(cc254827-4b3d-438f-9232-10c76bc7e038), |
| 306 |
] |
| 307 |
interface IRandomAccessStreamWithContentType : IInspectable |
| 308 |
requires |
| 309 |
Windows.Storage.Streams.IRandomAccessStream, |
| 310 |
Windows.Foundation.IClosable, |
| 311 |
Windows.Storage.Streams.IInputStream, |
| 312 |
Windows.Storage.Streams.IOutputStream, |
| 313 |
Windows.Storage.Streams.IContentTypeProvider |
| 314 |
{ |
| 315 |
} |
| 316 |
|
| 317 |
[ |
| 318 |
activatable(Windows.Storage.Streams.IBufferFactory, Windows.Foundation.UniversalApiContract, 1.0), |
| 319 |
contract(Windows.Foundation.UniversalApiContract, 1.0), |
| 320 |
marshaling_behavior(agile), |
| 321 |
static(Windows.Storage.Streams.IBufferStatics, Windows.Foundation.UniversalApiContract, 1.0), |
| 322 |
threading(both) |
| 323 |
] |
| 324 |
runtimeclass Buffer |
| 325 |
{ |
| 326 |
[default] interface Windows.Storage.Streams.IBuffer; |
| 327 |
} |
| 328 |
|
| 329 |
[ |
| 330 |
activatable(Windows.Foundation.UniversalApiContract, 1.0), |
| 331 |
activatable(Windows.Storage.Streams.IDataWriterFactory, Windows.Foundation.UniversalApiContract, 1.0), |
| 332 |
contract(Windows.Foundation.UniversalApiContract, 1.0), |
| 333 |
marshaling_behavior(agile), |
| 334 |
threading(both) |
| 335 |
] |
| 336 |
runtimeclass DataWriter |
| 337 |
{ |
| 338 |
[default] interface Windows.Storage.Streams.IDataWriter; |
| 339 |
interface Windows.Foundation.IClosable; |
| 340 |
} |
| 341 |
|
| 342 |
[ |
| 343 |
contract(Windows.Foundation.UniversalApiContract, 1.0), |
| 344 |
marshaling_behavior(agile) |
| 345 |
] |
| 346 |
runtimeclass DataWriterStoreOperation |
| 347 |
{ |
| 348 |
[default] interface Windows.Foundation.IAsyncOperation<UINT32>; |
| 349 |
} |
| 350 |
|
| 351 |
[ |
| 352 |
activatable(Windows.Foundation.UniversalApiContract, 1.0), |
| 353 |
contract(Windows.Foundation.UniversalApiContract, 1.0), |
| 354 |
marshaling_behavior(agile) |
| 355 |
] |
| 356 |
runtimeclass InMemoryRandomAccessStream |
| 357 |
{ |
| 358 |
[default] interface Windows.Storage.Streams.IRandomAccessStream; |
| 359 |
interface Windows.Storage.Streams.IOutputStream; |
| 360 |
interface Windows.Foundation.IClosable; |
| 361 |
interface Windows.Storage.Streams.IInputStream; |
| 362 |
} |
| 363 |
|
| 364 |
[ |
| 365 |
contract(Windows.Foundation.UniversalApiContract, 1.0), |
| 366 |
marshaling_behavior(agile), |
| 367 |
static(Windows.Storage.Streams.IRandomAccessStreamStatics, Windows.Foundation.UniversalApiContract, 1.0) |
| 368 |
] |
| 369 |
runtimeclass RandomAccessStream |
| 370 |
{ |
| 371 |
} |
| 372 |
|
| 373 |
[ |
| 374 |
contract(Windows.Foundation.UniversalApiContract, 1.0), |
| 375 |
marshaling_behavior(agile), |
| 376 |
static(Windows.Storage.Streams.IRandomAccessStreamReferenceStatics, Windows.Foundation.UniversalApiContract, 1.0) |
| 377 |
] |
| 378 |
runtimeclass RandomAccessStreamReference |
| 379 |
{ |
| 380 |
[default] interface Windows.Storage.Streams.IRandomAccessStreamReference; |
| 381 |
} |
| 382 |
|
| 383 |
} |