From: Mohamad Al-Jaf mohamadaljaf@gmail.com
Needed by IStorageFolder. --- include/windows.storage.idl | 135 ++++++++++++++++++++++++++++++++++++ 1 file changed, 135 insertions(+)
diff --git a/include/windows.storage.idl b/include/windows.storage.idl index de918ddc104..aa050040640 100644 --- a/include/windows.storage.idl +++ b/include/windows.storage.idl @@ -20,13 +20,139 @@ #pragma winrt ns_prefix #endif
+import "inspectable.idl"; +import "asyncinfo.idl"; +import "eventtoken.idl"; +import "windowscontracts.idl"; import "windows.foundation.idl"; +/* import "windows.storage.fileproperties.idl"; */ +/* import "windows.storage.provider.idl"; */ +/* import "windows.storage.search.idl"; */ +import "windows.storage.streams.idl"; +import "windows.system.idl";
namespace Windows.Storage { + typedef enum FileAccessMode FileAccessMode; + typedef enum NameCollisionOption NameCollisionOption; + interface IStorageFolder; interface IStorageFolderStatics; + interface IStorageFolderStatics2; + interface IStorageFileStatics; + interface IStorageFileStatics2; + interface IStorageItem;
runtimeclass StorageFolder; + runtimeclass StorageFile; + runtimeclass StorageStreamTransaction; + + declare { + interface Windows.Foundation.AsyncOperationCompletedHandler<Windows.Storage.StorageFile *>; + interface Windows.Foundation.AsyncOperationCompletedHandler<Windows.Storage.StorageStreamTransaction *>; + interface Windows.Foundation.IAsyncOperation<Windows.Storage.StorageFile *>; + interface Windows.Foundation.IAsyncOperation<Windows.Storage.StorageStreamTransaction *>; + } + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0) + ] + enum FileAccessMode + { + Read = 0, + ReadWrite = 1, + }; + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0) + ] + enum NameCollisionOption + { + GenerateUniqueName = 0, + ReplaceExisting = 1, + FailIfExists = 2, + }; + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + uuid(fa3f6186-4214-428c-a64c-14c9ac7315ea) + ] + interface IStorageFile : IInspectable + requires Windows.Storage.IStorageItem, + Windows.Storage.Streams.IRandomAccessStreamReference, + Windows.Storage.Streams.IInputStreamReference + { + [propget] HRESULT FileType([out, retval] HSTRING *value); + [propget] HRESULT ContentType([out, retval] HSTRING *value); + HRESULT OpenAsync( + [in] Windows.Storage.FileAccessMode mode, + [out, retval] Windows.Foundation.IAsyncOperation<Windows.Storage.Streams.IRandomAccessStream *> **operation + ); + HRESULT OpenTransactedWriteAsync([out, retval] Windows.Foundation.IAsyncOperation<Windows.Storage.StorageStreamTransaction *> **operation); + [overload("CopyAsync")] + HRESULT CopyOverloadDefaultNameAndOptions( + [in] Windows.Storage.IStorageFolder *folder, + [out, retval] Windows.Foundation.IAsyncOperation<Windows.Storage.StorageFile *> **operation + ); + [overload("CopyAsync")] + HRESULT CopyOverloadDefaultOptions( + [in] Windows.Storage.IStorageFolder *folder, + [in] HSTRING name, + [out, retval] Windows.Foundation.IAsyncOperation<Windows.Storage.StorageFile *> **operation); + [overload("CopyAsync")] + HRESULT CopyOverload( + [in] Windows.Storage.IStorageFolder *folder, + [in] HSTRING name, + [in] Windows.Storage.NameCollisionOption option, + [out, retval] Windows.Foundation.IAsyncOperation<Windows.Storage.StorageFile *> **operation + ); + HRESULT CopyAndReplaceAsync([in] Windows.Storage.IStorageFile *file, [out, retval] Windows.Foundation.IAsyncAction **operation); + [overload("MoveAsync")] + HRESULT MoveOverloadDefaultNameAndOptions([in] Windows.Storage.IStorageFolder *folder, [out, retval] Windows.Foundation.IAsyncAction **operation); + [overload("MoveAsync")] + HRESULT MoveOverloadDefaultOptions( + [in] Windows.Storage.IStorageFolder *folder, + [in] HSTRING name, + [out, retval] Windows.Foundation.IAsyncAction **operation + ); + [overload("MoveAsync")] + HRESULT MoveOverload( + [in] Windows.Storage.IStorageFolder *folder, + [in] HSTRING name, + [in] Windows.Storage.NameCollisionOption option, + [out, retval] Windows.Foundation.IAsyncAction **operation); + HRESULT MoveAndReplaceAsync([in] Windows.Storage.IStorageFile *file, [out, retval] Windows.Foundation.IAsyncAction **operation); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + exclusiveto(Windows.Storage.StorageStreamTransaction), + uuid(f67cf363-a53d-4d94-ae2c-67232d93acdd) + ] + interface IStorageStreamTransaction : IInspectable + requires Windows.Foundation.IClosable + { + [propget] HRESULT Stream([out, retval] Windows.Storage.Streams.IRandomAccessStream **value); + HRESULT CommitAsync([out, retval] Windows.Foundation.IAsyncAction **operation); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + static(Windows.Storage.IStorageFileStatics, Windows.Foundation.UniversalApiContract, 1.0), + static(Windows.Storage.IStorageFileStatics2, Windows.Foundation.UniversalApiContract, 10.0) + ] + runtimeclass StorageFile + { + [default] interface Windows.Storage.IStorageFile; + interface Windows.Storage.Streams.IInputStreamReference; + interface Windows.Storage.Streams.IRandomAccessStreamReference; + interface Windows.Storage.IStorageItem; + interface Windows.Storage.IStorageItemProperties; + [contract(Windows.Foundation.UniversalApiContract, 1.0)] interface Windows.Storage.IStorageItemProperties2; + [contract(Windows.Foundation.UniversalApiContract, 1.0)] interface Windows.Storage.IStorageItem2; + [contract(Windows.Foundation.UniversalApiContract, 1.0)] interface Windows.Storage.IStorageItemPropertiesWithProvider; + [contract(Windows.Foundation.UniversalApiContract, 1.0)] interface Windows.Storage.IStorageFilePropertiesWithAvailability; + [contract(Windows.Foundation.UniversalApiContract, 1.0)] interface Windows.Storage.IStorageFile2; + }
[ contract(Windows.Foundation.UniversalApiContract, 1.0), @@ -36,4 +162,13 @@ namespace Windows.Storage { { [default] interface Windows.Storage.IStorageFolder; } + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0) + ] + runtimeclass StorageStreamTransaction + { + [default] interface Windows.Storage.IStorageStreamTransaction; + interface Windows.Foundation.IClosable; + } }