include: Add IFACEMETHOD macros.
[wine.git] / include / windows.storage.streams.idl
blobcc58a037f13d1a18f7771052d46f42c9fa40bea6
1 /*
2 * Copyright 2021 Jactry Zeng for CodeWeavers
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.
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.
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
19 #ifdef __WIDL__
20 #pragma winrt ns_prefix
21 #endif
23 import "inspectable.idl";
24 import "eventtoken.idl";
25 import "windows.foundation.idl";
27 namespace Windows.Storage.Streams {
28 interface IBuffer;
29 interface IBufferFactory;
30 interface IBufferStatics;
31 interface IContentTypeProvider;
32 interface IInputStream;
33 interface IInputStreamReference;
34 interface IOutputStream;
35 interface IRandomAccessStream;
36 interface IRandomAccessStreamReference;
37 interface IRandomAccessStreamReferenceStatics;
38 interface IRandomAccessStreamStatics;
39 interface IRandomAccessStreamWithContentType;
40 runtimeclass Buffer;
41 runtimeclass InMemoryRandomAccessStream;
42 runtimeclass RandomAccessStream;
43 runtimeclass RandomAccessStreamReference;
45 declare {
46 interface Windows.Foundation.Collections.IIterable<Windows.Storage.Streams.IRandomAccessStream *>;
47 interface Windows.Foundation.Collections.IIterator<Windows.Storage.Streams.IRandomAccessStream *>;
48 interface Windows.Foundation.Collections.IVectorView<Windows.Storage.Streams.IRandomAccessStream *>;
49 interface Windows.Foundation.Collections.IVector<Windows.Storage.Streams.IRandomAccessStream *>;
50 interface Windows.Foundation.AsyncOperationCompletedHandler<Windows.Storage.Streams.IBuffer *>;
51 interface Windows.Foundation.AsyncOperationCompletedHandler<Windows.Storage.Streams.IRandomAccessStream *>;
52 interface Windows.Foundation.IAsyncOperation<Windows.Storage.Streams.IBuffer *>;
53 interface Windows.Foundation.IAsyncOperation<Windows.Storage.Streams.IRandomAccessStream *>;
57 contract(Windows.Foundation.UniversalApiContract, 1.0),
58 uuid(905a0fe0-bc53-11df-8c49-001e4fc686da)
60 interface IBuffer : IInspectable
62 [propget] HRESULT Capacity([out, retval] UINT32 *value);
63 [propget] HRESULT Length([out, retval] UINT32 *value);
64 [propput] HRESULT Length([in] UINT32 value);
68 contract(Windows.Foundation.UniversalApiContract, 1.0),
69 exclusiveto(Windows.Storage.Streams.Buffer),
70 uuid(71af914d-c10f-484b-bc50-14bc623b3a27)
72 interface IBufferFactory : IInspectable
74 HRESULT Create([in, range(0x00000000, 0x7fffffff)] UINT32 capacity,
75 [out, retval] Windows.Storage.Streams.Buffer **value);
79 contract(Windows.Foundation.UniversalApiContract, 1.0),
80 exclusiveto(Windows.Storage.Streams.Buffer),
81 uuid(e901e65b-d716-475a-a90a-af7229b1e741)
83 interface IBufferStatics : IInspectable
85 HRESULT CreateCopyFromMemoryBuffer([in] Windows.Foundation.IMemoryBuffer *input,
86 [out, retval] Windows.Storage.Streams.Buffer **value);
87 HRESULT CreateMemoryBufferOverIBuffer([in] Windows.Storage.Streams.IBuffer *input,
88 [out, retval] Windows.Foundation.MemoryBuffer **value);
92 contract(Windows.Foundation.UniversalApiContract, 1.0),
93 uuid(905a0fe1-bc53-11df-8c49-001e4fc686da),
95 interface IRandomAccessStream : IInspectable
96 requires Windows.Foundation.IClosable,
97 Windows.Storage.Streams.IInputStream,
98 Windows.Storage.Streams.IOutputStream
100 [propget] HRESULT Size([out, retval] UINT64 *value);
101 [propput] HRESULT Size([in] UINT64 value);
102 HRESULT GetInputStreamAt([in] UINT64 position, [out, retval] Windows.Storage.Streams.IInputStream **stream);
103 HRESULT GetOutputStreamAt([in] UINT64 position, [out, retval] Windows.Storage.Streams.IOutputStream **stream);
104 [propget] HRESULT Position([out, retval] UINT64 *value);
105 HRESULT Seek([in] UINT64 position);
106 HRESULT CloneStream([out, retval] Windows.Storage.Streams.IRandomAccessStream **stream);
107 [propget] HRESULT CanRead([out, retval] boolean *value);
108 [propget] HRESULT CanWrite([out, retval] boolean *value);
112 uuid(cc254827-4b3d-438f-9232-10c76bc7e038),
114 interface IRandomAccessStreamWithContentType : IInspectable
115 requires
116 Windows.Storage.Streams.IRandomAccessStream,
117 Windows.Foundation.IClosable,
118 Windows.Storage.Streams.IInputStream,
119 Windows.Storage.Streams.IOutputStream,
120 Windows.Storage.Streams.IContentTypeProvider
125 contract(Windows.Foundation.UniversalApiContract, 1.0),
126 marshaling_behavior(agile),
127 static(Windows.Storage.Streams.IRandomAccessStreamStatics, Windows.Foundation.UniversalApiContract, 1.0)
129 runtimeclass RandomAccessStream
134 activatable(Windows.Foundation.UniversalApiContract, 1.0),
135 contract(Windows.Foundation.UniversalApiContract, 1.0),
136 marshaling_behavior(agile)
138 runtimeclass InMemoryRandomAccessStream
140 [default] interface Windows.Storage.Streams.IRandomAccessStream;
141 interface Windows.Storage.Streams.IOutputStream;
142 interface Windows.Foundation.IClosable;
143 interface Windows.Storage.Streams.IInputStream;
147 activatable(Windows.Storage.Streams.IBufferFactory, Windows.Foundation.UniversalApiContract, 1.0),
148 contract(Windows.Foundation.UniversalApiContract, 1.0),
149 marshaling_behavior(agile),
150 static(Windows.Storage.Streams.IBufferStatics, Windows.Foundation.UniversalApiContract, 1.0),
151 threading(both)
153 runtimeclass Buffer
155 [default] interface Windows.Storage.Streams.IBuffer;
159 contract(Windows.Foundation.UniversalApiContract, 1.0),
160 marshaling_behavior(agile),
161 static(Windows.Storage.Streams.IRandomAccessStreamReferenceStatics, Windows.Foundation.UniversalApiContract, 1.0)
163 runtimeclass RandomAccessStreamReference
165 [default] interface Windows.Storage.Streams.IRandomAccessStreamReference;