include: Add IStorageFolder interface definition.
[wine.git] / include / windows.storage.idl
blob717460a08171551ac715f018a21668f546f4d084
1 /*
2 * Copyright 2023 Hans Leidekker 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 "asyncinfo.idl";
25 import "eventtoken.idl";
26 import "windowscontracts.idl";
27 import "windows.foundation.idl";
28 import "windows.storage.fileproperties.idl";
29 /* import "windows.storage.provider.idl"; */
30 import "windows.storage.search.idl";
31 import "windows.storage.streams.idl";
32 import "windows.system.idl";
34 namespace Windows.Storage {
35 typedef enum CreationCollisionOption CreationCollisionOption;
36 typedef enum FileAccessMode FileAccessMode;
37 typedef enum FileAttributes FileAttributes;
38 typedef enum NameCollisionOption NameCollisionOption;
39 typedef enum StorageDeleteOption StorageDeleteOption;
40 typedef enum StorageItemTypes StorageItemTypes;
42 interface IStorageFolder;
43 interface IStorageFolderStatics;
44 interface IStorageFolderStatics2;
45 interface IStorageFileStatics;
46 interface IStorageFileStatics2;
47 interface IStorageItem;
49 runtimeclass StorageFolder;
50 runtimeclass StorageFile;
51 runtimeclass StorageStreamTransaction;
53 declare {
54 interface Windows.Foundation.Collections.IVectorView<Windows.Storage.IStorageItem *>;
55 interface Windows.Foundation.Collections.IVectorView<Windows.Storage.StorageFile *>;
56 interface Windows.Foundation.Collections.IVectorView<Windows.Storage.StorageFolder *>;
57 interface Windows.Foundation.AsyncOperationCompletedHandler<Windows.Foundation.Collections.IVectorView<Windows.Storage.IStorageItem *> *>;
58 interface Windows.Foundation.AsyncOperationCompletedHandler<Windows.Foundation.Collections.IVectorView<Windows.Storage.StorageFile *> *>;
59 interface Windows.Foundation.AsyncOperationCompletedHandler<Windows.Foundation.Collections.IVectorView<Windows.Storage.StorageFolder *> *>;
60 interface Windows.Foundation.AsyncOperationCompletedHandler<Windows.Storage.IStorageItem *>;
61 interface Windows.Foundation.AsyncOperationCompletedHandler<Windows.Storage.StorageFile *>;
62 interface Windows.Foundation.AsyncOperationCompletedHandler<Windows.Storage.StorageFolder *>;
63 interface Windows.Foundation.AsyncOperationCompletedHandler<Windows.Storage.StorageStreamTransaction *>;
64 interface Windows.Foundation.IAsyncOperation<Windows.Foundation.Collections.IVectorView<Windows.Storage.IStorageItem *> *>;
65 interface Windows.Foundation.IAsyncOperation<Windows.Foundation.Collections.IVectorView<Windows.Storage.StorageFile *> *>;
66 interface Windows.Foundation.IAsyncOperation<Windows.Foundation.Collections.IVectorView<Windows.Storage.StorageFolder *> *>;
67 interface Windows.Foundation.IAsyncOperation<Windows.Storage.IStorageItem *>;
68 interface Windows.Foundation.IAsyncOperation<Windows.Storage.StorageFile *>;
69 interface Windows.Foundation.IAsyncOperation<Windows.Storage.StorageFolder *>;
70 interface Windows.Foundation.IAsyncOperation<Windows.Storage.StorageStreamTransaction *>;
74 contract(Windows.Foundation.UniversalApiContract, 1.0)
76 enum CreationCollisionOption
78 GenerateUniqueName = 0,
79 ReplaceExisting = 1,
80 FailIfExists = 2,
81 OpenIfExists = 3,
85 contract(Windows.Foundation.UniversalApiContract, 1.0)
87 enum FileAccessMode
89 Read = 0,
90 ReadWrite = 1,
94 contract(Windows.Foundation.UniversalApiContract, 1.0),
95 flags
97 enum FileAttributes
99 Normal = 0x0,
100 ReadOnly = 0x1,
101 Directory = 0x10,
102 Archive = 0x20,
103 Temporary = 0x100,
104 [contract(Windows.Foundation.UniversalApiContract, 1.0)]
105 LocallyIncomplete = 0x200,
109 contract(Windows.Foundation.UniversalApiContract, 1.0)
111 enum NameCollisionOption
113 GenerateUniqueName = 0,
114 ReplaceExisting = 1,
115 FailIfExists = 2,
119 contract(Windows.Foundation.UniversalApiContract, 1.0)
121 enum StorageDeleteOption
123 Default = 0,
124 PermanentDelete = 1,
128 contract(Windows.Foundation.UniversalApiContract, 1.0),
129 flags
131 enum StorageItemTypes
133 None = 0x0,
134 File = 0x1,
135 Folder = 0x2,
139 contract(Windows.Foundation.UniversalApiContract, 1.0),
140 uuid(fa3f6186-4214-428c-a64c-14c9ac7315ea)
142 interface IStorageFile : IInspectable
143 requires Windows.Storage.IStorageItem,
144 Windows.Storage.Streams.IRandomAccessStreamReference,
145 Windows.Storage.Streams.IInputStreamReference
147 [propget] HRESULT FileType([out, retval] HSTRING *value);
148 [propget] HRESULT ContentType([out, retval] HSTRING *value);
149 HRESULT OpenAsync(
150 [in] Windows.Storage.FileAccessMode mode,
151 [out, retval] Windows.Foundation.IAsyncOperation<Windows.Storage.Streams.IRandomAccessStream *> **operation
153 HRESULT OpenTransactedWriteAsync([out, retval] Windows.Foundation.IAsyncOperation<Windows.Storage.StorageStreamTransaction *> **operation);
154 [overload("CopyAsync")]
155 HRESULT CopyOverloadDefaultNameAndOptions(
156 [in] Windows.Storage.IStorageFolder *folder,
157 [out, retval] Windows.Foundation.IAsyncOperation<Windows.Storage.StorageFile *> **operation
159 [overload("CopyAsync")]
160 HRESULT CopyOverloadDefaultOptions(
161 [in] Windows.Storage.IStorageFolder *folder,
162 [in] HSTRING name,
163 [out, retval] Windows.Foundation.IAsyncOperation<Windows.Storage.StorageFile *> **operation);
164 [overload("CopyAsync")]
165 HRESULT CopyOverload(
166 [in] Windows.Storage.IStorageFolder *folder,
167 [in] HSTRING name,
168 [in] Windows.Storage.NameCollisionOption option,
169 [out, retval] Windows.Foundation.IAsyncOperation<Windows.Storage.StorageFile *> **operation
171 HRESULT CopyAndReplaceAsync([in] Windows.Storage.IStorageFile *file, [out, retval] Windows.Foundation.IAsyncAction **operation);
172 [overload("MoveAsync")]
173 HRESULT MoveOverloadDefaultNameAndOptions([in] Windows.Storage.IStorageFolder *folder, [out, retval] Windows.Foundation.IAsyncAction **operation);
174 [overload("MoveAsync")]
175 HRESULT MoveOverloadDefaultOptions(
176 [in] Windows.Storage.IStorageFolder *folder,
177 [in] HSTRING name,
178 [out, retval] Windows.Foundation.IAsyncAction **operation
180 [overload("MoveAsync")]
181 HRESULT MoveOverload(
182 [in] Windows.Storage.IStorageFolder *folder,
183 [in] HSTRING name,
184 [in] Windows.Storage.NameCollisionOption option,
185 [out, retval] Windows.Foundation.IAsyncAction **operation);
186 HRESULT MoveAndReplaceAsync([in] Windows.Storage.IStorageFile *file, [out, retval] Windows.Foundation.IAsyncAction **operation);
190 contract(Windows.Foundation.UniversalApiContract, 1.0),
191 uuid(72d1cb78-b3ef-4f75-a80b-6fd9dae2944b)
193 interface IStorageFolder : IInspectable
194 requires Windows.Storage.IStorageItem
196 [overload("CreateFileAsync")]
197 HRESULT CreateFileAsyncOverloadDefaultOptions(
198 [in] HSTRING name,
199 [out, retval] Windows.Foundation.IAsyncOperation<Windows.Storage.StorageFile *> **operation
201 [overload("CreateFileAsync")]
202 HRESULT CreateFileAsync(
203 [in] HSTRING name,
204 [in] Windows.Storage.CreationCollisionOption options,
205 [out, retval] Windows.Foundation.IAsyncOperation<Windows.Storage.StorageFile *> **operation
207 [overload("CreateFolderAsync")]
208 HRESULT CreateFolderAsyncOverloadDefaultOptions(
209 [in] HSTRING name,
210 [out, retval] Windows.Foundation.IAsyncOperation<Windows.Storage.StorageFolder *> **operation
212 [overload("CreateFolderAsync")]
213 HRESULT CreateFolderAsync(
214 [in] HSTRING name,
215 [in] Windows.Storage.CreationCollisionOption options,
216 [out, retval] Windows.Foundation.IAsyncOperation<Windows.Storage.StorageFolder *> **operation
218 HRESULT GetFileAsync([in] HSTRING name, [out, retval] Windows.Foundation.IAsyncOperation<Windows.Storage.StorageFile *> **operation);
219 HRESULT GetFolderAsync([in] HSTRING name, [out, retval] Windows.Foundation.IAsyncOperation<Windows.Storage.StorageFolder *> **operation);
220 HRESULT GetItemAsync([in] HSTRING name, [out, retval] Windows.Foundation.IAsyncOperation<Windows.Storage.IStorageItem *> **operation);
221 [overload("GetFilesAsync")]
222 HRESULT GetFilesAsyncOverloadDefaultOptionsStartAndCount(
223 [out, retval] Windows.Foundation.IAsyncOperation<Windows.Foundation.Collections.IVectorView<Windows.Storage.StorageFile *> *> **operation
225 [overload("GetFoldersAsync")]
226 HRESULT GetFoldersAsyncOverloadDefaultOptionsStartAndCount(
227 [out, retval] Windows.Foundation.IAsyncOperation<Windows.Foundation.Collections.IVectorView<Windows.Storage.StorageFolder *> *> **operation
229 [overload("GetItemsAsync")]
230 HRESULT GetItemsAsyncOverloadDefaultStartAndCount(
231 [out, retval] Windows.Foundation.IAsyncOperation<Windows.Foundation.Collections.IVectorView<Windows.Storage.IStorageItem *> *> **operation
236 contract(Windows.Foundation.UniversalApiContract, 1.0),
237 uuid(4207a996-ca2f-42f7-bde8-8b10457a7f30)
239 interface IStorageItem : IInspectable
241 [overload("RenameAsync")]
242 HRESULT RenameAsyncOverloadDefaultOptions([in] HSTRING name, [out, retval] Windows.Foundation.IAsyncAction **operation);
243 [overload("RenameAsync")]
244 HRESULT RenameAsync([in] HSTRING name, [in] Windows.Storage.NameCollisionOption option, [out, retval] Windows.Foundation.IAsyncAction **operation);
245 [overload("DeleteAsync")]
246 HRESULT DeleteAsyncOverloadDefaultOptions([out, retval] Windows.Foundation.IAsyncAction **operation);
247 [overload("DeleteAsync")]
248 HRESULT DeleteAsync([in] Windows.Storage.StorageDeleteOption option, [out, retval] Windows.Foundation.IAsyncAction **operation);
249 HRESULT GetBasicPropertiesAsync([out, retval] Windows.Foundation.IAsyncOperation<Windows.Storage.FileProperties.BasicProperties *> **operation);
250 [propget] HRESULT Name([out, retval] HSTRING *value);
251 [propget] HRESULT Path([out, retval] HSTRING *value);
252 [propget] HRESULT Attributes([out, retval] Windows.Storage.FileAttributes *value);
253 [propget] HRESULT DateCreated([out, retval] Windows.Foundation.DateTime *value);
254 HRESULT IsOfType([in] Windows.Storage.StorageItemTypes type, [out, retval] boolean *value);
258 contract(Windows.Foundation.UniversalApiContract, 1.0),
259 exclusiveto(Windows.Storage.StorageStreamTransaction),
260 uuid(f67cf363-a53d-4d94-ae2c-67232d93acdd)
262 interface IStorageStreamTransaction : IInspectable
263 requires Windows.Foundation.IClosable
265 [propget] HRESULT Stream([out, retval] Windows.Storage.Streams.IRandomAccessStream **value);
266 HRESULT CommitAsync([out, retval] Windows.Foundation.IAsyncAction **operation);
270 contract(Windows.Foundation.UniversalApiContract, 1.0),
271 static(Windows.Storage.IStorageFileStatics, Windows.Foundation.UniversalApiContract, 1.0),
272 static(Windows.Storage.IStorageFileStatics2, Windows.Foundation.UniversalApiContract, 10.0)
274 runtimeclass StorageFile
276 [default] interface Windows.Storage.IStorageFile;
277 interface Windows.Storage.Streams.IInputStreamReference;
278 interface Windows.Storage.Streams.IRandomAccessStreamReference;
279 interface Windows.Storage.IStorageItem;
280 interface Windows.Storage.IStorageItemProperties;
281 [contract(Windows.Foundation.UniversalApiContract, 1.0)] interface Windows.Storage.IStorageItemProperties2;
282 [contract(Windows.Foundation.UniversalApiContract, 1.0)] interface Windows.Storage.IStorageItem2;
283 [contract(Windows.Foundation.UniversalApiContract, 1.0)] interface Windows.Storage.IStorageItemPropertiesWithProvider;
284 [contract(Windows.Foundation.UniversalApiContract, 1.0)] interface Windows.Storage.IStorageFilePropertiesWithAvailability;
285 [contract(Windows.Foundation.UniversalApiContract, 1.0)] interface Windows.Storage.IStorageFile2;
289 contract(Windows.Foundation.UniversalApiContract, 1.0),
290 static(Windows.Storage.IStorageFolderStatics, Windows.Foundation.UniversalApiContract, 1.0),
291 static(Windows.Storage.IStorageFolderStatics2, Windows.Foundation.UniversalApiContract, 10.0)
293 runtimeclass StorageFolder
295 [default] interface Windows.Storage.IStorageFolder;
296 interface Windows.Storage.IStorageItem;
297 interface Windows.Storage.Search.IStorageFolderQueryOperations;
298 interface Windows.Storage.IStorageItemProperties;
299 [contract(Windows.Foundation.UniversalApiContract, 1.0)] interface Windows.Storage.IStorageItemProperties2;
300 [contract(Windows.Foundation.UniversalApiContract, 1.0)] interface Windows.Storage.IStorageItem2;
301 [contract(Windows.Foundation.UniversalApiContract, 1.0)] interface Windows.Storage.IStorageFolder2;
302 [contract(Windows.Foundation.UniversalApiContract, 1.0)] interface Windows.Storage.IStorageItemPropertiesWithProvider;
303 [contract(Windows.Foundation.UniversalApiContract, 6.0)] interface Windows.Storage.IStorageFolder3;
307 contract(Windows.Foundation.UniversalApiContract, 1.0)
309 runtimeclass StorageStreamTransaction
311 [default] interface Windows.Storage.IStorageStreamTransaction;
312 interface Windows.Foundation.IClosable;