From d45c0ee103feaef0fb92e411869e3d955fa64f92 Mon Sep 17 00:00:00 2001 From: Josh Date: Tue, 28 Apr 2026 02:43:57 -0700 Subject: [PATCH] Add `Windows.Storage.ApplicationData` bindings This also requires `Windows.Storage.StorageFolder`. --- Sources/UWP/Generated/UWP+Generics.swift | 744 ++++++++++++++++++ Sources/UWP/Generated/UWP+MakeFromAbi.swift | 20 + .../UWP/Generated/Windows.Storage+ABI.swift | 360 +++++++++ .../UWP/Generated/Windows.Storage+Impl.swift | 14 + Sources/UWP/Generated/Windows.Storage.swift | 301 +++++++ projections.json | 2 + 6 files changed, 1441 insertions(+) diff --git a/Sources/UWP/Generated/UWP+Generics.swift b/Sources/UWP/Generated/UWP+Generics.swift index 64fd25c..2e9da13 100644 --- a/Sources/UWP/Generated/UWP+Generics.swift +++ b/Sources/UWP/Generated/UWP+Generics.swift @@ -2555,6 +2555,57 @@ internal class __x_ABI_C__FIAsyncOperationCompletedHandler_1___x_ABI_CWindows__C return handler } } +private var IID___x_ABI_C__FIAsyncOperationCompletedHandler_1___x_ABI_CWindows__CStorage__CApplicationData: WindowsFoundation.IID { + .init(Data1: 0xabafe590, Data2: 0x65fe, Data3: 0x520a, Data4: ( 0x9d,0x7c,0x6a,0xb5,0xf1,0x88,0x22,0x37 ))// abafe590-65fe-520a-9d7c-6ab5f1882237 +} + +internal extension WinRTDelegateBridge where CABI == __x_ABI_C__FIAsyncOperationCompletedHandler_1___x_ABI_CWindows__CStorage__CApplicationData { + static func makeAbi() -> CABI { + let vtblPtr = withUnsafeMutablePointer(to: &UWP.__x_ABI_C__FIAsyncOperationCompletedHandler_1___x_ABI_CWindows__CStorage__CApplicationDataVTable) { $0 } + return .init(lpVtbl:vtblPtr) + } +} + +internal var __x_ABI_C__FIAsyncOperationCompletedHandler_1___x_ABI_CWindows__CStorage__CApplicationDataVTable: __x_ABI_C__FIAsyncOperationCompletedHandler_1___x_ABI_CWindows__CStorage__CApplicationDataVtbl = .init( + QueryInterface: { __x_ABI_C__FIAsyncOperationCompletedHandler_1___x_ABI_CWindows__CStorage__CApplicationDataWrapper.queryInterface($0, $1, $2) }, + AddRef: { __x_ABI_C__FIAsyncOperationCompletedHandler_1___x_ABI_CWindows__CStorage__CApplicationDataWrapper.addRef($0) }, + Release: { __x_ABI_C__FIAsyncOperationCompletedHandler_1___x_ABI_CWindows__CStorage__CApplicationDataWrapper.release($0) }, + Invoke: { + guard let __unwrapped__instance = __x_ABI_C__FIAsyncOperationCompletedHandler_1___x_ABI_CWindows__CStorage__CApplicationDataWrapper.tryUnwrapFrom(raw: $0) else { return E_INVALIDARG } + let asyncInfo: WindowsFoundation.AnyIAsyncOperation? = UWP.__x_ABI_C__FIAsyncOperation_1___x_ABI_CWindows__CStorage__CApplicationDataWrapper.unwrapFrom(abi: ComPtr($1)) + let asyncStatus: WindowsFoundation.AsyncStatus = $2 + __unwrapped__instance(asyncInfo, asyncStatus) + return S_OK + } +) +typealias __x_ABI_C__FIAsyncOperationCompletedHandler_1___x_ABI_CWindows__CStorage__CApplicationDataWrapper = InterfaceWrapperBase +internal class AsyncOperationCompletedHandlerApplicationData: WindowsFoundation.IUnknown { + override public class var IID: WindowsFoundation.IID { IID___x_ABI_C__FIAsyncOperationCompletedHandler_1___x_ABI_CWindows__CStorage__CApplicationData } + + internal func InvokeImpl(_ asyncInfo: WindowsFoundation.AnyIAsyncOperation?, _ asyncStatus: WindowsFoundation.AsyncStatus) throws { + let asyncInfoWrapper = UWP.__x_ABI_C__FIAsyncOperation_1___x_ABI_CWindows__CStorage__CApplicationDataWrapper(asyncInfo) + let _asyncInfo = try! asyncInfoWrapper?.toABI { $0 } + _ = try perform(as: __x_ABI_C__FIAsyncOperationCompletedHandler_1___x_ABI_CWindows__CStorage__CApplicationData.self) { pThis in + try CHECKED(pThis.pointee.lpVtbl.pointee.Invoke(pThis, _asyncInfo, asyncStatus)) + } + } + +} + +internal class __x_ABI_C__FIAsyncOperationCompletedHandler_1___x_ABI_CWindows__CStorage__CApplicationDataBridge : WinRTDelegateBridge { + internal typealias Handler = WindowsFoundation.AsyncOperationCompletedHandler + internal typealias CABI = __x_ABI_C__FIAsyncOperationCompletedHandler_1___x_ABI_CWindows__CStorage__CApplicationData + internal typealias SwiftABI = UWP.AsyncOperationCompletedHandlerApplicationData + + internal static func from(abi: ComPtr?) -> Handler? { + guard let abi = abi else { return nil } + let _default = SwiftABI(abi) + let handler: Handler = { (asyncInfo, asyncStatus) in + try! _default.InvokeImpl(asyncInfo, asyncStatus) + } + return handler + } +} private var IID___x_ABI_C__FIAsyncOperationCompletedHandler_1___x_ABI_CWindows__CStorage__CFileProperties__CBasicProperties: WindowsFoundation.IID { .init(Data1: 0xc8659aae, Data2: 0x4926, Data3: 0x52ad, Data4: ( 0x8f,0x60,0xd8,0x9f,0xe5,0xa8,0xdf,0x5f ))// c8659aae-4926-52ad-8f60-d89fe5a8df5f } @@ -7339,6 +7390,93 @@ fileprivate class __x_ABI_C__FIIterable_1___x_ABI_C__FIKeyValuePair_2_HSTRING___ public func queryInterface(_ iid: WindowsFoundation.IID) -> IUnknownRef? { nil } } +private var IID___x_ABI_C__FIIterable_1___x_ABI_C__FIKeyValuePair_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainer: WindowsFoundation.IID { + .init(Data1: 0xa785be1d, Data2: 0x159e, Data3: 0x53ad, Data4: ( 0x95,0x53,0x59,0x8b,0x03,0xdc,0xa0,0x48 ))// a785be1d-159e-53ad-9553-598b03dca048 +} + +internal var __x_ABI_C__FIIterable_1___x_ABI_C__FIKeyValuePair_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainerVTable: __x_ABI_C__FIIterable_1___x_ABI_C__FIKeyValuePair_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainerVtbl = .init( + QueryInterface: { __x_ABI_C__FIIterable_1___x_ABI_C__FIKeyValuePair_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainerWrapper.queryInterface($0, $1, $2) }, + AddRef: { __x_ABI_C__FIIterable_1___x_ABI_C__FIKeyValuePair_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainerWrapper.addRef($0) }, + Release: { __x_ABI_C__FIIterable_1___x_ABI_C__FIKeyValuePair_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainerWrapper.release($0) }, + GetIids: { + let size = MemoryLayout.size + let iids = CoTaskMemAlloc(UInt64(size) * 3).assumingMemoryBound(to: WindowsFoundation.IID.self) + iids[0] = IUnknown.IID + iids[1] = IInspectable.IID + iids[2] = UWP.__x_ABI_C__FIIterable_1___x_ABI_C__FIKeyValuePair_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainerWrapper.IID + $1!.pointee = 3 + $2!.pointee = iids + return S_OK + }, + + GetRuntimeClassName: { + _ = $0 + let hstring = try! HString("Windows.Foundation.Collections.IIterable`1>").detach() + $1!.pointee = hstring + return S_OK + }, + + GetTrustLevel: { + _ = $0 + $1!.pointee = TrustLevel(rawValue: 0) + return S_OK + }, + + First: { + guard let __unwrapped__instance = __x_ABI_C__FIIterable_1___x_ABI_C__FIKeyValuePair_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainerWrapper.tryUnwrapFrom(raw: $0) else { return E_INVALIDARG } + let result = __unwrapped__instance.first() + let resultWrapper = UWP.__x_ABI_C__FIIterator_1___x_ABI_C__FIKeyValuePair_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainerWrapper(result) + resultWrapper?.copyTo($1) + return S_OK + } +) +typealias __x_ABI_C__FIIterable_1___x_ABI_C__FIKeyValuePair_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainerWrapper = InterfaceWrapperBase +internal class IIterableIKeyValuePairString_ApplicationDataContainer: WindowsFoundation.IInspectable { + override public class var IID: WindowsFoundation.IID { IID___x_ABI_C__FIIterable_1___x_ABI_C__FIKeyValuePair_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainer } + + internal func FirstImpl() throws -> WindowsFoundation.AnyIIterator?>? { + let (result) = try ComPtrs.initialize { resultAbi in + _ = try perform(as: __x_ABI_C__FIIterable_1___x_ABI_C__FIKeyValuePair_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainer.self) { pThis in + try CHECKED(pThis.pointee.lpVtbl.pointee.First(pThis, &resultAbi)) + } + } + return UWP.__x_ABI_C__FIIterator_1___x_ABI_C__FIKeyValuePair_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainerWrapper.unwrapFrom(abi: result) + } + +} + +internal enum __x_ABI_C__FIIterable_1___x_ABI_C__FIKeyValuePair_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainerBridge : AbiInterfaceBridge { + internal typealias CABI = __x_ABI_C__FIIterable_1___x_ABI_C__FIKeyValuePair_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainer + internal typealias SwiftABI = IIterableIKeyValuePairString_ApplicationDataContainer + internal typealias SwiftProjection = WindowsFoundation.AnyIIterable?> + internal static func from(abi: ComPtr?) -> SwiftProjection? { + guard let abi = abi else { return nil } + return __x_ABI_C__FIIterable_1___x_ABI_C__FIKeyValuePair_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainerImpl(abi) + } + + internal static func makeAbi() -> CABI { + let vtblPtr = withUnsafeMutablePointer(to: &__x_ABI_C__FIIterable_1___x_ABI_C__FIKeyValuePair_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainerVTable) { $0 } + return .init(lpVtbl: vtblPtr) + } +} + +fileprivate class __x_ABI_C__FIIterable_1___x_ABI_C__FIKeyValuePair_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainerImpl : IIterable, AbiInterfaceImpl { + typealias T = WindowsFoundation.AnyIKeyValuePair? + typealias Bridge = __x_ABI_C__FIIterable_1___x_ABI_C__FIKeyValuePair_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainerBridge + let _default: Bridge.SwiftABI + init(_ fromAbi: ComPtr) { + _default = Bridge.SwiftABI(fromAbi) + } + + // MARK: WinRT + /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.foundation.collections.iiterable-1.first) + fileprivate func first() -> WindowsFoundation.AnyIIterator?>? { + try! _default.FirstImpl() + } + + public func queryInterface(_ iid: WindowsFoundation.IID) -> IUnknownRef? { nil } +} + private var IID___x_ABI_C__FIIterable_1___x_ABI_C__FIKeyValuePair_2_HSTRING___x_ABI_CWindows__CStorage__CStreams__CRandomAccessStreamReference: WindowsFoundation.IID { .init(Data1: 0xc9729ba7, Data2: 0x5e20, Data3: 0x569d, Data4: ( 0xa3,0xd1,0x97,0xa4,0xe6,0x53,0xe5,0xbb ))// c9729ba7-5e20-569d-a3d1-97a4e653e5bb } @@ -16805,6 +16943,135 @@ fileprivate class __x_ABI_C__FIIterator_1___x_ABI_C__FIKeyValuePair_2_HSTRING___ public func queryInterface(_ iid: WindowsFoundation.IID) -> IUnknownRef? { nil } } +private var IID___x_ABI_C__FIIterator_1___x_ABI_C__FIKeyValuePair_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainer: WindowsFoundation.IID { + .init(Data1: 0xaf3c131d, Data2: 0x67aa, Data3: 0x5c8d, Data4: ( 0xae,0x0e,0x27,0x2b,0xa2,0x4a,0xe7,0x4f ))// af3c131d-67aa-5c8d-ae0e-272ba24ae74f +} + +internal var __x_ABI_C__FIIterator_1___x_ABI_C__FIKeyValuePair_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainerVTable: __x_ABI_C__FIIterator_1___x_ABI_C__FIKeyValuePair_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainerVtbl = .init( + QueryInterface: { __x_ABI_C__FIIterator_1___x_ABI_C__FIKeyValuePair_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainerWrapper.queryInterface($0, $1, $2) }, + AddRef: { __x_ABI_C__FIIterator_1___x_ABI_C__FIKeyValuePair_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainerWrapper.addRef($0) }, + Release: { __x_ABI_C__FIIterator_1___x_ABI_C__FIKeyValuePair_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainerWrapper.release($0) }, + GetIids: { + let size = MemoryLayout.size + let iids = CoTaskMemAlloc(UInt64(size) * 3).assumingMemoryBound(to: WindowsFoundation.IID.self) + iids[0] = IUnknown.IID + iids[1] = IInspectable.IID + iids[2] = UWP.__x_ABI_C__FIIterator_1___x_ABI_C__FIKeyValuePair_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainerWrapper.IID + $1!.pointee = 3 + $2!.pointee = iids + return S_OK + }, + + GetRuntimeClassName: { + _ = $0 + let hstring = try! HString("Windows.Foundation.Collections.IIterator`1>").detach() + $1!.pointee = hstring + return S_OK + }, + + GetTrustLevel: { + _ = $0 + $1!.pointee = TrustLevel(rawValue: 0) + return S_OK + }, + + get_Current: { + guard let __unwrapped__instance = __x_ABI_C__FIIterator_1___x_ABI_C__FIKeyValuePair_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainerWrapper.tryUnwrapFrom(raw: $0) else { return E_INVALIDARG } + let result = __unwrapped__instance.current + let resultWrapper = UWP.__x_ABI_C__FIKeyValuePair_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainerWrapper(result) + resultWrapper?.copyTo($1) + return S_OK + }, + + get_HasCurrent: { + guard let __unwrapped__instance = __x_ABI_C__FIIterator_1___x_ABI_C__FIKeyValuePair_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainerWrapper.tryUnwrapFrom(raw: $0) else { return E_INVALIDARG } + let result = __unwrapped__instance.hasCurrent + $1?.initialize(to: .init(from: result)) + return S_OK + }, + + MoveNext: { + guard let __unwrapped__instance = __x_ABI_C__FIIterator_1___x_ABI_C__FIKeyValuePair_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainerWrapper.tryUnwrapFrom(raw: $0) else { return E_INVALIDARG } + let result = __unwrapped__instance.moveNext() + $1?.initialize(to: .init(from: result)) + return S_OK + }, + + GetMany: { _, _, _, _ in return failWith(err: E_NOTIMPL) } +) +typealias __x_ABI_C__FIIterator_1___x_ABI_C__FIKeyValuePair_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainerWrapper = InterfaceWrapperBase +internal class IIteratorIKeyValuePairString_ApplicationDataContainer: WindowsFoundation.IInspectable { + override public class var IID: WindowsFoundation.IID { IID___x_ABI_C__FIIterator_1___x_ABI_C__FIKeyValuePair_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainer } + + internal func get_CurrentImpl() throws -> WindowsFoundation.AnyIKeyValuePair? { + let (result) = try ComPtrs.initialize { resultAbi in + _ = try perform(as: __x_ABI_C__FIIterator_1___x_ABI_C__FIKeyValuePair_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainer.self) { pThis in + try CHECKED(pThis.pointee.lpVtbl.pointee.get_Current(pThis, &resultAbi)) + } + } + return UWP.__x_ABI_C__FIKeyValuePair_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainerWrapper.unwrapFrom(abi: result) + } + + internal func get_HasCurrentImpl() throws -> Bool { + var result: boolean = 0 + _ = try perform(as: __x_ABI_C__FIIterator_1___x_ABI_C__FIKeyValuePair_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainer.self) { pThis in + try CHECKED(pThis.pointee.lpVtbl.pointee.get_HasCurrent(pThis, &result)) + } + return .init(from: result) + } + + internal func MoveNextImpl() throws -> Bool { + var result: boolean = 0 + _ = try perform(as: __x_ABI_C__FIIterator_1___x_ABI_C__FIKeyValuePair_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainer.self) { pThis in + try CHECKED(pThis.pointee.lpVtbl.pointee.MoveNext(pThis, &result)) + } + return .init(from: result) + } + +} + +internal enum __x_ABI_C__FIIterator_1___x_ABI_C__FIKeyValuePair_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainerBridge : AbiInterfaceBridge { + internal typealias CABI = __x_ABI_C__FIIterator_1___x_ABI_C__FIKeyValuePair_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainer + internal typealias SwiftABI = IIteratorIKeyValuePairString_ApplicationDataContainer + internal typealias SwiftProjection = WindowsFoundation.AnyIIterator?> + internal static func from(abi: ComPtr?) -> SwiftProjection? { + guard let abi = abi else { return nil } + return __x_ABI_C__FIIterator_1___x_ABI_C__FIKeyValuePair_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainerImpl(abi) + } + + internal static func makeAbi() -> CABI { + let vtblPtr = withUnsafeMutablePointer(to: &__x_ABI_C__FIIterator_1___x_ABI_C__FIKeyValuePair_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainerVTable) { $0 } + return .init(lpVtbl: vtblPtr) + } +} + +fileprivate class __x_ABI_C__FIIterator_1___x_ABI_C__FIKeyValuePair_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainerImpl : IIterator, AbiInterfaceImpl { + typealias T = WindowsFoundation.AnyIKeyValuePair? + typealias Bridge = __x_ABI_C__FIIterator_1___x_ABI_C__FIKeyValuePair_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainerBridge + let _default: Bridge.SwiftABI + init(_ fromAbi: ComPtr) { + _default = Bridge.SwiftABI(fromAbi) + } + + // MARK: WinRT + /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.foundation.collections.iiterator-1.movenext) + fileprivate func moveNext() -> Bool { + try! _default.MoveNextImpl() + } + + /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.foundation.collections.iiterator-1.current) + fileprivate var current : WindowsFoundation.AnyIKeyValuePair? { + get { try! _default.get_CurrentImpl() } + } + + /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.foundation.collections.iiterator-1.hascurrent) + fileprivate var hasCurrent : Bool { + get { try! _default.get_HasCurrentImpl() } + } + + public func queryInterface(_ iid: WindowsFoundation.IID) -> IUnknownRef? { nil } +} + private var IID___x_ABI_C__FIIterator_1___x_ABI_C__FIKeyValuePair_2_HSTRING___x_ABI_CWindows__CStorage__CStreams__CRandomAccessStreamReference: WindowsFoundation.IID { .init(Data1: 0x9419af53, Data2: 0xacb8, Data3: 0x5328, Data4: ( 0x88,0x53,0x70,0xba,0x87,0xeb,0x6a,0xd5 ))// 9419af53-acb8-5328-8853-70ba87eb6ad5 } @@ -26976,6 +27243,113 @@ fileprivate class __x_ABI_C__FIKeyValuePair_2_HSTRING___x_ABI_CWindows__CGraphic public func queryInterface(_ iid: WindowsFoundation.IID) -> IUnknownRef? { nil } } +private var IID___x_ABI_C__FIKeyValuePair_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainer: WindowsFoundation.IID { + .init(Data1: 0x5adbc543, Data2: 0x2170, Data3: 0x5ad9, Data4: ( 0xb3,0x5e,0x96,0x8c,0xdb,0x78,0xfb,0x30 ))// 5adbc543-2170-5ad9-b35e-968cdb78fb30 +} + +internal var __x_ABI_C__FIKeyValuePair_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainerVTable: __x_ABI_C__FIKeyValuePair_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainerVtbl = .init( + QueryInterface: { __x_ABI_C__FIKeyValuePair_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainerWrapper.queryInterface($0, $1, $2) }, + AddRef: { __x_ABI_C__FIKeyValuePair_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainerWrapper.addRef($0) }, + Release: { __x_ABI_C__FIKeyValuePair_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainerWrapper.release($0) }, + GetIids: { + let size = MemoryLayout.size + let iids = CoTaskMemAlloc(UInt64(size) * 3).assumingMemoryBound(to: WindowsFoundation.IID.self) + iids[0] = IUnknown.IID + iids[1] = IInspectable.IID + iids[2] = UWP.__x_ABI_C__FIKeyValuePair_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainerWrapper.IID + $1!.pointee = 3 + $2!.pointee = iids + return S_OK + }, + + GetRuntimeClassName: { + _ = $0 + let hstring = try! HString("Windows.Foundation.Collections.IKeyValuePair`2").detach() + $1!.pointee = hstring + return S_OK + }, + + GetTrustLevel: { + _ = $0 + $1!.pointee = TrustLevel(rawValue: 0) + return S_OK + }, + + get_Key: { + guard let __unwrapped__instance = __x_ABI_C__FIKeyValuePair_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainerWrapper.tryUnwrapFrom(raw: $0) else { return E_INVALIDARG } + let result = __unwrapped__instance.key + $1?.initialize(to: try! HString(result).detach()) + return S_OK + }, + + get_Value: { + guard let __unwrapped__instance = __x_ABI_C__FIKeyValuePair_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainerWrapper.tryUnwrapFrom(raw: $0) else { return E_INVALIDARG } + let result = __unwrapped__instance.value + result?.copyTo($1) + return S_OK + } +) +typealias __x_ABI_C__FIKeyValuePair_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainerWrapper = InterfaceWrapperBase +internal class IKeyValuePairString_ApplicationDataContainer: WindowsFoundation.IInspectable { + override public class var IID: WindowsFoundation.IID { IID___x_ABI_C__FIKeyValuePair_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainer } + + internal func get_KeyImpl() throws -> String { + var result: HSTRING? + _ = try perform(as: __x_ABI_C__FIKeyValuePair_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainer.self) { pThis in + try CHECKED(pThis.pointee.lpVtbl.pointee.get_Key(pThis, &result)) + } + return .init(from: result) + } + + internal func get_ValueImpl() throws -> UWP.ApplicationDataContainer? { + let (result) = try ComPtrs.initialize { resultAbi in + _ = try perform(as: __x_ABI_C__FIKeyValuePair_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainer.self) { pThis in + try CHECKED(pThis.pointee.lpVtbl.pointee.get_Value(pThis, &resultAbi)) + } + } + return .from(abi: result) + } + +} + +internal enum __x_ABI_C__FIKeyValuePair_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainerBridge : AbiInterfaceBridge { + internal typealias CABI = __x_ABI_C__FIKeyValuePair_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainer + internal typealias SwiftABI = IKeyValuePairString_ApplicationDataContainer + internal typealias SwiftProjection = WindowsFoundation.AnyIKeyValuePair + internal static func from(abi: ComPtr?) -> SwiftProjection? { + guard let abi = abi else { return nil } + return __x_ABI_C__FIKeyValuePair_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainerImpl(abi) + } + + internal static func makeAbi() -> CABI { + let vtblPtr = withUnsafeMutablePointer(to: &__x_ABI_C__FIKeyValuePair_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainerVTable) { $0 } + return .init(lpVtbl: vtblPtr) + } +} + +fileprivate class __x_ABI_C__FIKeyValuePair_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainerImpl : IKeyValuePair, AbiInterfaceImpl { + typealias K = String + typealias V = UWP.ApplicationDataContainer? + typealias Bridge = __x_ABI_C__FIKeyValuePair_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainerBridge + let _default: Bridge.SwiftABI + init(_ fromAbi: ComPtr) { + _default = Bridge.SwiftABI(fromAbi) + } + + // MARK: WinRT + /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.foundation.collections.ikeyvaluepair-2.key) + fileprivate var key : String { + get { try! _default.get_KeyImpl() } + } + + /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.foundation.collections.ikeyvaluepair-2.value) + fileprivate var value : UWP.ApplicationDataContainer? { + get { try! _default.get_ValueImpl() } + } + + public func queryInterface(_ iid: WindowsFoundation.IID) -> IUnknownRef? { nil } +} + private var IID___x_ABI_C__FIKeyValuePair_2_HSTRING___x_ABI_CWindows__CStorage__CStreams__CRandomAccessStreamReference: WindowsFoundation.IID { .init(Data1: 0xe5195792, Data2: 0xaeab, Data3: 0x56e8, Data4: ( 0xbd,0x30,0x13,0x72,0xc4,0x34,0x0b,0xf6 ))// e5195792-aeab-56e8-bd30-1372c4340bf6 } @@ -28788,6 +29162,172 @@ fileprivate class __x_ABI_C__FIMapView_2_HSTRING___x_ABI_CWindows__CGraphics__CI public func queryInterface(_ iid: WindowsFoundation.IID) -> IUnknownRef? { nil } } +private var IID___x_ABI_C__FIMapView_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainer: WindowsFoundation.IID { + .init(Data1: 0x13624f8d, Data2: 0x85cc, Data3: 0x5780, Data4: ( 0xa7,0x8d,0x64,0xdb,0xa5,0x8f,0x2c,0x3c ))// 13624f8d-85cc-5780-a78d-64dba58f2c3c +} + +internal var __x_ABI_C__FIMapView_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainerVTable: __x_ABI_C__FIMapView_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainerVtbl = .init( + QueryInterface: { __x_ABI_C__FIMapView_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainerWrapper.queryInterface($0, $1, $2) }, + AddRef: { __x_ABI_C__FIMapView_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainerWrapper.addRef($0) }, + Release: { __x_ABI_C__FIMapView_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainerWrapper.release($0) }, + GetIids: { + let size = MemoryLayout.size + let iids = CoTaskMemAlloc(UInt64(size) * 4).assumingMemoryBound(to: WindowsFoundation.IID.self) + iids[0] = IUnknown.IID + iids[1] = IInspectable.IID + iids[2] = UWP.__x_ABI_C__FIMapView_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainerWrapper.IID + iids[3] = UWP.__x_ABI_C__FIIterable_1___x_ABI_C__FIKeyValuePair_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainerWrapper.IID + $1!.pointee = 4 + $2!.pointee = iids + return S_OK + }, + + GetRuntimeClassName: { + _ = $0 + let hstring = try! HString("Windows.Foundation.Collections.IMapView`2").detach() + $1!.pointee = hstring + return S_OK + }, + + GetTrustLevel: { + _ = $0 + $1!.pointee = TrustLevel(rawValue: 0) + return S_OK + }, + + Lookup: { + guard let __unwrapped__instance = __x_ABI_C__FIMapView_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainerWrapper.tryUnwrapFrom(raw: $0) else { return E_INVALIDARG } + let key: String = .init(from: $1) + let result = __unwrapped__instance.lookup(key) + result?.copyTo($2) + return S_OK + }, + + get_Size: { + guard let __unwrapped__instance = __x_ABI_C__FIMapView_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainerWrapper.tryUnwrapFrom(raw: $0) else { return E_INVALIDARG } + let result = __unwrapped__instance.size + $1?.initialize(to: result) + return S_OK + }, + + HasKey: { + guard let __unwrapped__instance = __x_ABI_C__FIMapView_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainerWrapper.tryUnwrapFrom(raw: $0) else { return E_INVALIDARG } + let key: String = .init(from: $1) + let result = __unwrapped__instance.hasKey(key) + $2?.initialize(to: .init(from: result)) + return S_OK + }, + + Split: { + guard let __unwrapped__instance = __x_ABI_C__FIMapView_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainerWrapper.tryUnwrapFrom(raw: $0) else { return E_INVALIDARG } + var first: WindowsFoundation.AnyIMapView? + var second: WindowsFoundation.AnyIMapView? + __unwrapped__instance.split(&first, &second) + let firstWrapper = UWP.__x_ABI_C__FIMapView_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainerWrapper(first) + firstWrapper?.copyTo($1) + let secondWrapper = UWP.__x_ABI_C__FIMapView_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainerWrapper(second) + secondWrapper?.copyTo($2) + return S_OK + } +) +typealias __x_ABI_C__FIMapView_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainerWrapper = InterfaceWrapperBase +internal class IMapViewString_ApplicationDataContainer: WindowsFoundation.IInspectable { + override public class var IID: WindowsFoundation.IID { IID___x_ABI_C__FIMapView_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainer } + + internal func LookupImpl(_ key: String) throws -> UWP.ApplicationDataContainer? { + let (result) = try ComPtrs.initialize { resultAbi in + let _key = try! HString(key) + _ = try perform(as: __x_ABI_C__FIMapView_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainer.self) { pThis in + try CHECKED(pThis.pointee.lpVtbl.pointee.Lookup(pThis, _key.get(), &resultAbi)) + } + } + return .from(abi: result) + } + + internal func get_SizeImpl() throws -> UInt32 { + var result: UINT32 = 0 + _ = try perform(as: __x_ABI_C__FIMapView_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainer.self) { pThis in + try CHECKED(pThis.pointee.lpVtbl.pointee.get_Size(pThis, &result)) + } + return result + } + + internal func HasKeyImpl(_ key: String) throws -> Bool { + var result: boolean = 0 + let _key = try! HString(key) + _ = try perform(as: __x_ABI_C__FIMapView_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainer.self) { pThis in + try CHECKED(pThis.pointee.lpVtbl.pointee.HasKey(pThis, _key.get(), &result)) + } + return .init(from: result) + } + + internal func SplitImpl(_ first: inout WindowsFoundation.AnyIMapView?, _ second: inout WindowsFoundation.AnyIMapView?) throws { + let (_first, _second) = try ComPtrs.initialize { (_firstAbi, _secondAbi) in + _ = try perform(as: __x_ABI_C__FIMapView_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainer.self) { pThis in + try CHECKED(pThis.pointee.lpVtbl.pointee.Split(pThis, &_firstAbi, &_secondAbi)) + } + } + first = UWP.__x_ABI_C__FIMapView_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainerWrapper.unwrapFrom(abi: _first) + second = UWP.__x_ABI_C__FIMapView_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainerWrapper.unwrapFrom(abi: _second) + } + +} + +internal enum __x_ABI_C__FIMapView_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainerBridge : AbiInterfaceBridge { + internal typealias CABI = __x_ABI_C__FIMapView_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainer + internal typealias SwiftABI = IMapViewString_ApplicationDataContainer + internal typealias SwiftProjection = WindowsFoundation.AnyIMapView + internal static func from(abi: ComPtr?) -> SwiftProjection? { + guard let abi = abi else { return nil } + return __x_ABI_C__FIMapView_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainerImpl(abi) + } + + internal static func makeAbi() -> CABI { + let vtblPtr = withUnsafeMutablePointer(to: &__x_ABI_C__FIMapView_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainerVTable) { $0 } + return .init(lpVtbl: vtblPtr) + } +} + +fileprivate class __x_ABI_C__FIMapView_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainerImpl : IMapView, AbiInterfaceImpl { + typealias T = WindowsFoundation.AnyIKeyValuePair? + typealias K = String + typealias V = UWP.ApplicationDataContainer? + typealias Bridge = __x_ABI_C__FIMapView_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainerBridge + let _default: Bridge.SwiftABI + init(_ fromAbi: ComPtr) { + _default = Bridge.SwiftABI(fromAbi) + } + + // MARK: WinRT + /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.foundation.collections.imapview-2.lookup) + fileprivate func lookup(_ key: String) -> UWP.ApplicationDataContainer? { + try! _default.LookupImpl(key) + } + + /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.foundation.collections.imapview-2.haskey) + fileprivate func hasKey(_ key: String) -> Bool { + try! _default.HasKeyImpl(key) + } + + /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.foundation.collections.imapview-2.split) + fileprivate func split(_ first: inout WindowsFoundation.AnyIMapView?, _ second: inout WindowsFoundation.AnyIMapView?) { + try! _default.SplitImpl(&first, &second) + } + + /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.foundation.collections.imapview-2.size) + fileprivate var size : UInt32 { + get { try! _default.get_SizeImpl() } + } + + private lazy var _IIterable: IIterableIKeyValuePairString_ApplicationDataContainer! = getInterfaceForCaching() + /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.foundation.collections.imapview-2.first) + fileprivate func first() -> WindowsFoundation.AnyIIterator?>? { + try! _IIterable.FirstImpl() + } + + public func queryInterface(_ iid: WindowsFoundation.IID) -> IUnknownRef? { nil } +} + private var IID___x_ABI_C__FIMapView_2_HSTRING___x_ABI_CWindows__CStorage__CStreams__CRandomAccessStreamReference: WindowsFoundation.IID { .init(Data1: 0x0a4ce7a5, Data2: 0xdfe0, Data3: 0x5796, Data4: ( 0xa4,0x38,0xef,0xfd,0xfa,0xa3,0x1f,0x1b ))// 0a4ce7a5-dfe0-5796-a438-effdfaa31f1b } @@ -64596,6 +65136,159 @@ fileprivate class __x_ABI_C__FIAsyncOperation_1___x_ABI_CWindows__CSecurity__CEn public func queryInterface(_ iid: WindowsFoundation.IID) -> IUnknownRef? { nil } } +private var IID___x_ABI_C__FIAsyncOperation_1___x_ABI_CWindows__CStorage__CApplicationData: WindowsFoundation.IID { + .init(Data1: 0x31456b58, Data2: 0xa5cb, Data3: 0x5c5b, Data4: ( 0xbd,0x6e,0xcc,0xce,0x3a,0x7b,0xf4,0xb4 ))// 31456b58-a5cb-5c5b-bd6e-ccce3a7bf4b4 +} + +internal var __x_ABI_C__FIAsyncOperation_1___x_ABI_CWindows__CStorage__CApplicationDataVTable: __x_ABI_C__FIAsyncOperation_1___x_ABI_CWindows__CStorage__CApplicationDataVtbl = .init( + QueryInterface: { __x_ABI_C__FIAsyncOperation_1___x_ABI_CWindows__CStorage__CApplicationDataWrapper.queryInterface($0, $1, $2) }, + AddRef: { __x_ABI_C__FIAsyncOperation_1___x_ABI_CWindows__CStorage__CApplicationDataWrapper.addRef($0) }, + Release: { __x_ABI_C__FIAsyncOperation_1___x_ABI_CWindows__CStorage__CApplicationDataWrapper.release($0) }, + GetIids: { + let size = MemoryLayout.size + let iids = CoTaskMemAlloc(UInt64(size) * 4).assumingMemoryBound(to: WindowsFoundation.IID.self) + iids[0] = IUnknown.IID + iids[1] = IInspectable.IID + iids[2] = UWP.__x_ABI_C__FIAsyncOperation_1___x_ABI_CWindows__CStorage__CApplicationDataWrapper.IID + iids[3] = __ABI_Windows_Foundation.IAsyncInfoWrapper.IID + $1!.pointee = 4 + $2!.pointee = iids + return S_OK + }, + + GetRuntimeClassName: { + _ = $0 + let hstring = try! HString("Windows.Foundation.IAsyncOperation`1").detach() + $1!.pointee = hstring + return S_OK + }, + + GetTrustLevel: { + _ = $0 + $1!.pointee = TrustLevel(rawValue: 0) + return S_OK + }, + + put_Completed: { + guard let __unwrapped__instance = __x_ABI_C__FIAsyncOperation_1___x_ABI_CWindows__CStorage__CApplicationDataWrapper.tryUnwrapFrom(raw: $0) else { return E_INVALIDARG } + guard let handler = UWP.__x_ABI_C__FIAsyncOperationCompletedHandler_1___x_ABI_CWindows__CStorage__CApplicationDataWrapper.unwrapFrom(abi: ComPtr($1)) else { return E_INVALIDARG } + __unwrapped__instance.completed = handler + return S_OK + }, + + get_Completed: { + guard let __unwrapped__instance = __x_ABI_C__FIAsyncOperation_1___x_ABI_CWindows__CStorage__CApplicationDataWrapper.tryUnwrapFrom(raw: $0) else { return E_INVALIDARG } + let result = __unwrapped__instance.completed + let resultWrapper = UWP.__x_ABI_C__FIAsyncOperationCompletedHandler_1___x_ABI_CWindows__CStorage__CApplicationDataWrapper(result) + resultWrapper?.copyTo($1) + return S_OK + }, + + GetResults: { + do { + guard let __unwrapped__instance = __x_ABI_C__FIAsyncOperation_1___x_ABI_CWindows__CStorage__CApplicationDataWrapper.tryUnwrapFrom(raw: $0) else { return E_INVALIDARG } + let result = try __unwrapped__instance.getResults() + result?.copyTo($1) + return S_OK + } catch { return failWith(err: E_FAIL) } + } +) +typealias __x_ABI_C__FIAsyncOperation_1___x_ABI_CWindows__CStorage__CApplicationDataWrapper = InterfaceWrapperBase +internal class IAsyncOperationApplicationData: WindowsFoundation.IInspectable { + override public class var IID: WindowsFoundation.IID { IID___x_ABI_C__FIAsyncOperation_1___x_ABI_CWindows__CStorage__CApplicationData } + + internal func put_CompletedImpl(_ handler: AsyncOperationCompletedHandler?) throws { + let handlerWrapper = UWP.__x_ABI_C__FIAsyncOperationCompletedHandler_1___x_ABI_CWindows__CStorage__CApplicationDataWrapper(handler) + let _handler = try! handlerWrapper?.toABI { $0 } + _ = try perform(as: __x_ABI_C__FIAsyncOperation_1___x_ABI_CWindows__CStorage__CApplicationData.self) { pThis in + try CHECKED(pThis.pointee.lpVtbl.pointee.put_Completed(pThis, _handler)) + } + } + + internal func get_CompletedImpl() throws -> AsyncOperationCompletedHandler? { + let (result) = try ComPtrs.initialize { resultAbi in + _ = try perform(as: __x_ABI_C__FIAsyncOperation_1___x_ABI_CWindows__CStorage__CApplicationData.self) { pThis in + try CHECKED(pThis.pointee.lpVtbl.pointee.get_Completed(pThis, &resultAbi)) + } + } + return UWP.__x_ABI_C__FIAsyncOperationCompletedHandler_1___x_ABI_CWindows__CStorage__CApplicationDataWrapper.unwrapFrom(abi: result) + } + + internal func GetResultsImpl() throws -> UWP.ApplicationData? { + let (result) = try ComPtrs.initialize { resultAbi in + _ = try perform(as: __x_ABI_C__FIAsyncOperation_1___x_ABI_CWindows__CStorage__CApplicationData.self) { pThis in + try CHECKED(pThis.pointee.lpVtbl.pointee.GetResults(pThis, &resultAbi)) + } + } + return .from(abi: result) + } + +} + +internal enum __x_ABI_C__FIAsyncOperation_1___x_ABI_CWindows__CStorage__CApplicationDataBridge : AbiInterfaceBridge { + internal typealias CABI = __x_ABI_C__FIAsyncOperation_1___x_ABI_CWindows__CStorage__CApplicationData + internal typealias SwiftABI = IAsyncOperationApplicationData + internal typealias SwiftProjection = WindowsFoundation.AnyIAsyncOperation + internal static func from(abi: ComPtr?) -> SwiftProjection? { + guard let abi = abi else { return nil } + return __x_ABI_C__FIAsyncOperation_1___x_ABI_CWindows__CStorage__CApplicationDataImpl(abi) + } + + internal static func makeAbi() -> CABI { + let vtblPtr = withUnsafeMutablePointer(to: &__x_ABI_C__FIAsyncOperation_1___x_ABI_CWindows__CStorage__CApplicationDataVTable) { $0 } + return .init(lpVtbl: vtblPtr) + } +} + +fileprivate class __x_ABI_C__FIAsyncOperation_1___x_ABI_CWindows__CStorage__CApplicationDataImpl : IAsyncOperation, AbiInterfaceImpl { + typealias TResult = UWP.ApplicationData? + typealias Bridge = __x_ABI_C__FIAsyncOperation_1___x_ABI_CWindows__CStorage__CApplicationDataBridge + let _default: Bridge.SwiftABI + init(_ fromAbi: ComPtr) { + _default = Bridge.SwiftABI(fromAbi) + } + + // MARK: WinRT + /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.foundation.iasyncoperation-1.getresults) + fileprivate func getResults() throws -> UWP.ApplicationData? { + try _default.GetResultsImpl() + } + + /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.foundation.iasyncoperation-1.completed) + fileprivate var completed : AsyncOperationCompletedHandler? { + get { try! _default.get_CompletedImpl() } + set { try! _default.put_CompletedImpl(newValue) } + } + + private lazy var _IAsyncInfo: __ABI_Windows_Foundation.IAsyncInfo! = getInterfaceForCaching() + /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.foundation.iasyncoperation-1.cancel) + fileprivate func cancel() throws { + try _IAsyncInfo.CancelImpl() + } + + /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.foundation.iasyncoperation-1.close) + fileprivate func close() throws { + try _IAsyncInfo.CloseImpl() + } + + /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.foundation.iasyncoperation-1.errorcode) + fileprivate var errorCode : HRESULT { + get { try! _IAsyncInfo.get_ErrorCodeImpl() } + } + + /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.foundation.iasyncoperation-1.id) + fileprivate var id : UInt32 { + get { try! _IAsyncInfo.get_IdImpl() } + } + + /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.foundation.iasyncoperation-1.status) + fileprivate var status : WindowsFoundation.AsyncStatus { + get { try! _IAsyncInfo.get_StatusImpl() } + } + + public func queryInterface(_ iid: WindowsFoundation.IID) -> IUnknownRef? { nil } +} + private var IID___x_ABI_C__FIAsyncOperation_1___x_ABI_CWindows__CStorage__CFileProperties__CBasicProperties: WindowsFoundation.IID { .init(Data1: 0x5186131a, Data2: 0x4467, Data3: 0x504b, Data4: ( 0x97,0x7a,0x07,0x85,0xa8,0x23,0x04,0x85 ))// 5186131a-4467-504b-977a-0785a8230485 } @@ -72571,6 +73264,57 @@ internal class __x_ABI_C__FITypedEventHandler_2___x_ABI_CWindows__CNetworking__C return handler } } +private var IID___x_ABI_C__FITypedEventHandler_2___x_ABI_CWindows__CStorage__CApplicationData_IInspectable: WindowsFoundation.IID { + .init(Data1: 0xb5348b3b, Data2: 0x5081, Data3: 0x5ae9, Data4: ( 0x8f,0xa3,0x4d,0x22,0xd6,0x8f,0xb0,0xea ))// b5348b3b-5081-5ae9-8fa3-4d22d68fb0ea +} + +internal extension WinRTDelegateBridge where CABI == __x_ABI_C__FITypedEventHandler_2___x_ABI_CWindows__CStorage__CApplicationData_IInspectable { + static func makeAbi() -> CABI { + let vtblPtr = withUnsafeMutablePointer(to: &UWP.__x_ABI_C__FITypedEventHandler_2___x_ABI_CWindows__CStorage__CApplicationData_IInspectableVTable) { $0 } + return .init(lpVtbl:vtblPtr) + } +} + +internal var __x_ABI_C__FITypedEventHandler_2___x_ABI_CWindows__CStorage__CApplicationData_IInspectableVTable: __x_ABI_C__FITypedEventHandler_2___x_ABI_CWindows__CStorage__CApplicationData_IInspectableVtbl = .init( + QueryInterface: { __x_ABI_C__FITypedEventHandler_2___x_ABI_CWindows__CStorage__CApplicationData_IInspectableWrapper.queryInterface($0, $1, $2) }, + AddRef: { __x_ABI_C__FITypedEventHandler_2___x_ABI_CWindows__CStorage__CApplicationData_IInspectableWrapper.addRef($0) }, + Release: { __x_ABI_C__FITypedEventHandler_2___x_ABI_CWindows__CStorage__CApplicationData_IInspectableWrapper.release($0) }, + Invoke: { + guard let __unwrapped__instance = __x_ABI_C__FITypedEventHandler_2___x_ABI_CWindows__CStorage__CApplicationData_IInspectableWrapper.tryUnwrapFrom(raw: $0) else { return E_INVALIDARG } + let sender: UWP.ApplicationData? = .from(abi: ComPtr($1)) + let args: Any? = __ABI_.AnyWrapper.unwrapFrom(abi: ComPtr($2)) + __unwrapped__instance(sender, args) + return S_OK + } +) +typealias __x_ABI_C__FITypedEventHandler_2___x_ABI_CWindows__CStorage__CApplicationData_IInspectableWrapper = InterfaceWrapperBase +internal class TypedEventHandlerApplicationData_Any: WindowsFoundation.IUnknown { + override public class var IID: WindowsFoundation.IID { IID___x_ABI_C__FITypedEventHandler_2___x_ABI_CWindows__CStorage__CApplicationData_IInspectable } + + internal func InvokeImpl(_ sender: UWP.ApplicationData?, _ args: Any?) throws { + let argsWrapper = __ABI_.AnyWrapper(args) + let _args = try! argsWrapper?.toABI { $0 } + _ = try perform(as: __x_ABI_C__FITypedEventHandler_2___x_ABI_CWindows__CStorage__CApplicationData_IInspectable.self) { pThis in + try CHECKED(pThis.pointee.lpVtbl.pointee.Invoke(pThis, RawPointer(sender), _args)) + } + } + +} + +internal class __x_ABI_C__FITypedEventHandler_2___x_ABI_CWindows__CStorage__CApplicationData_IInspectableBridge : WinRTDelegateBridge { + internal typealias Handler = WindowsFoundation.TypedEventHandler + internal typealias CABI = __x_ABI_C__FITypedEventHandler_2___x_ABI_CWindows__CStorage__CApplicationData_IInspectable + internal typealias SwiftABI = UWP.TypedEventHandlerApplicationData_Any + + internal static func from(abi: ComPtr?) -> Handler? { + guard let abi = abi else { return nil } + let _default = SwiftABI(abi) + let handler: Handler = { (sender, args) in + try! _default.InvokeImpl(sender, args) + } + return handler + } +} private var IID___x_ABI_C__FITypedEventHandler_2___x_ABI_CWindows__CStorage__CSearch__CIStorageQueryResultBase_IInspectable: WindowsFoundation.IID { .init(Data1: 0x4ba22861, Data2: 0x00c4, Data3: 0x597f, Data4: ( 0xb6,0xbf,0x3a,0xf5,0x16,0xf3,0xb8,0x70 ))// 4ba22861-00c4-597f-b6bf-3af516f3b870 } diff --git a/Sources/UWP/Generated/UWP+MakeFromAbi.swift b/Sources/UWP/Generated/UWP+MakeFromAbi.swift index 21c3138..ef6287d 100644 --- a/Sources/UWP/Generated/UWP+MakeFromAbi.swift +++ b/Sources/UWP/Generated/UWP+MakeFromAbi.swift @@ -1539,6 +1539,22 @@ fileprivate func makeSubjectAlternativeNameInfoFrom(abi: WindowsFoundation.IInsp return SubjectAlternativeNameInfo(fromAbi: abi) } +fileprivate func makeApplicationDataFrom(abi: WindowsFoundation.IInspectable) -> Any { + return ApplicationData(fromAbi: abi) +} + +fileprivate func makeApplicationDataContainerFrom(abi: WindowsFoundation.IInspectable) -> Any { + return ApplicationDataContainer(fromAbi: abi) +} + +fileprivate func makeSetVersionDeferralFrom(abi: WindowsFoundation.IInspectable) -> Any { + return SetVersionDeferral(fromAbi: abi) +} + +fileprivate func makeSetVersionRequestFrom(abi: WindowsFoundation.IInspectable) -> Any { + return SetVersionRequest(fromAbi: abi) +} + fileprivate func makeStorageFileFrom(abi: WindowsFoundation.IInspectable) -> Any { return StorageFile(fromAbi: abi) } @@ -2751,6 +2767,10 @@ public class __MakeFromAbi: MakeFromAbi { case "ChainBuildingParameters": return makeChainBuildingParametersFrom(abi: abi) case "ChainValidationParameters": return makeChainValidationParametersFrom(abi: abi) case "SubjectAlternativeNameInfo": return makeSubjectAlternativeNameInfoFrom(abi: abi) + case "ApplicationData": return makeApplicationDataFrom(abi: abi) + case "ApplicationDataContainer": return makeApplicationDataContainerFrom(abi: abi) + case "SetVersionDeferral": return makeSetVersionDeferralFrom(abi: abi) + case "SetVersionRequest": return makeSetVersionRequestFrom(abi: abi) case "StorageFile": return makeStorageFileFrom(abi: abi) case "StorageFolder": return makeStorageFolderFrom(abi: abi) case "StorageLibraryChange": return makeStorageLibraryChangeFrom(abi: abi) diff --git a/Sources/UWP/Generated/Windows.Storage+ABI.swift b/Sources/UWP/Generated/Windows.Storage+ABI.swift index c4d1f71..325ec41 100644 --- a/Sources/UWP/Generated/Windows.Storage+ABI.swift +++ b/Sources/UWP/Generated/Windows.Storage+ABI.swift @@ -4,6 +4,38 @@ import Foundation @_spi(WinRTInternal) @_spi(WinRTImplements) import WindowsFoundation import CWinRT +private var IID___x_ABI_CWindows_CStorage_CIApplicationData: WindowsFoundation.IID { + .init(Data1: 0xC3DA6FB7, Data2: 0xB744, Data3: 0x4B45, Data4: ( 0xB0,0xB8,0x22,0x3A,0x09,0x38,0xD0,0xDC ))// C3DA6FB7-B744-4B45-B0B8-223A0938D0DC +} + +private var IID___x_ABI_CWindows_CStorage_CIApplicationData2: WindowsFoundation.IID { + .init(Data1: 0x9E65CD69, Data2: 0x0BA3, Data3: 0x4E32, Data4: ( 0xBE,0x29,0xB0,0x2D,0xE6,0x60,0x76,0x38 ))// 9E65CD69-0BA3-4E32-BE29-B02DE6607638 +} + +private var IID___x_ABI_CWindows_CStorage_CIApplicationData3: WindowsFoundation.IID { + .init(Data1: 0xDC222CF4, Data2: 0x2772, Data3: 0x4C1D, Data4: ( 0xAA,0x2C,0xC9,0xF7,0x43,0xAD,0xE8,0xD1 ))// DC222CF4-2772-4C1D-AA2C-C9F743ADE8D1 +} + +private var IID___x_ABI_CWindows_CStorage_CIApplicationDataContainer: WindowsFoundation.IID { + .init(Data1: 0xC5AEFD1E, Data2: 0xF467, Data3: 0x40BA, Data4: ( 0x85,0x66,0xAB,0x64,0x0A,0x44,0x1E,0x1D ))// C5AEFD1E-F467-40BA-8566-AB640A441E1D +} + +private var IID___x_ABI_CWindows_CStorage_CIApplicationDataStatics: WindowsFoundation.IID { + .init(Data1: 0x5612147B, Data2: 0xE843, Data3: 0x45E3, Data4: ( 0x94,0xD8,0x06,0x16,0x9E,0x3C,0x8E,0x17 ))// 5612147B-E843-45E3-94D8-06169E3C8E17 +} + +private var IID___x_ABI_CWindows_CStorage_CIApplicationDataStatics2: WindowsFoundation.IID { + .init(Data1: 0xCD606211, Data2: 0xCF49, Data3: 0x40A4, Data4: ( 0xA4,0x7C,0xC7,0xF0,0xDB,0xBA,0x81,0x07 ))// CD606211-CF49-40A4-A47C-C7F0DBBA8107 +} + +private var IID___x_ABI_CWindows_CStorage_CISetVersionDeferral: WindowsFoundation.IID { + .init(Data1: 0x033508A2, Data2: 0x781A, Data3: 0x437A, Data4: ( 0xB0,0x78,0x3F,0x32,0xBA,0xDC,0xFE,0x47 ))// 033508A2-781A-437A-B078-3F32BADCFE47 +} + +private var IID___x_ABI_CWindows_CStorage_CISetVersionRequest: WindowsFoundation.IID { + .init(Data1: 0xB9C76B9B, Data2: 0x1056, Data3: 0x4E69, Data4: ( 0x83,0x30,0x16,0x26,0x19,0x95,0x6F,0x9B ))// B9C76B9B-1056-4E69-8330-162619956F9B +} + private var IID___x_ABI_CWindows_CStorage_CIStorageFile: WindowsFoundation.IID { .init(Data1: 0xFA3F6186, Data2: 0x4214, Data3: 0x428C, Data4: ( 0xA6,0x4C,0x14,0xC9,0xAC,0x73,0x15,0xEA ))// FA3F6186-4214-428C-A64C-14C9AC7315EA } @@ -84,11 +116,305 @@ private var IID___x_ABI_CWindows_CStorage_CIStreamedFileDataRequest: WindowsFoun .init(Data1: 0x1673FCCE, Data2: 0xDABD, Data3: 0x4D50, Data4: ( 0xBE,0xEE,0x18,0x0B,0x8A,0x81,0x91,0xB6 ))// 1673FCCE-DABD-4D50-BEEE-180B8A8191B6 } +private var IID___x_ABI_CWindows_CStorage_CIApplicationDataSetVersionHandler: WindowsFoundation.IID { + .init(Data1: 0xA05791E6, Data2: 0xCC9F, Data3: 0x4687, Data4: ( 0xAC,0xAB,0xA3,0x64,0xFD,0x78,0x54,0x63 ))// A05791E6-CC9F-4687-ACAB-A364FD785463 +} + private var IID___x_ABI_CWindows_CStorage_CIStreamedFileDataRequestedHandler: WindowsFoundation.IID { .init(Data1: 0xFEF6A824, Data2: 0x2FE1, Data3: 0x4D07, Data4: ( 0xA3,0x5B,0xB7,0x7C,0x50,0xB5,0xF4,0xCC ))// FEF6A824-2FE1-4D07-A35B-B77C50B5F4CC } public enum __ABI_Windows_Storage { + public class IApplicationData: WindowsFoundation.IInspectable { + override public class var IID: WindowsFoundation.IID { IID___x_ABI_CWindows_CStorage_CIApplicationData } + + internal func get_VersionImpl() throws -> UInt32 { + var value: UINT32 = 0 + _ = try perform(as: __x_ABI_CWindows_CStorage_CIApplicationData.self) { pThis in + try CHECKED(pThis.pointee.lpVtbl.pointee.get_Version(pThis, &value)) + } + return value + } + + internal func SetVersionAsyncImpl(_ desiredVersion: UInt32, _ handler: UWP.ApplicationDataSetVersionHandler?) throws -> WindowsFoundation.AnyIAsyncAction? { + let (setVersionOperation) = try ComPtrs.initialize { setVersionOperationAbi in + let handlerWrapper = __ABI_Windows_Storage.ApplicationDataSetVersionHandlerWrapper(handler) + let _handler = try! handlerWrapper?.toABI { $0 } + _ = try perform(as: __x_ABI_CWindows_CStorage_CIApplicationData.self) { pThis in + try CHECKED(pThis.pointee.lpVtbl.pointee.SetVersionAsync(pThis, desiredVersion, _handler, &setVersionOperationAbi)) + } + } + return __ABI_Windows_Foundation.IAsyncActionWrapper.unwrapFrom(abi: setVersionOperation) + } + + internal func ClearAllAsyncImpl() throws -> WindowsFoundation.AnyIAsyncAction? { + let (clearOperation) = try ComPtrs.initialize { clearOperationAbi in + _ = try perform(as: __x_ABI_CWindows_CStorage_CIApplicationData.self) { pThis in + try CHECKED(pThis.pointee.lpVtbl.pointee.ClearAllAsync(pThis, &clearOperationAbi)) + } + } + return __ABI_Windows_Foundation.IAsyncActionWrapper.unwrapFrom(abi: clearOperation) + } + + internal func ClearAsyncImpl(_ locality: UWP.ApplicationDataLocality) throws -> WindowsFoundation.AnyIAsyncAction? { + let (clearOperation) = try ComPtrs.initialize { clearOperationAbi in + _ = try perform(as: __x_ABI_CWindows_CStorage_CIApplicationData.self) { pThis in + try CHECKED(pThis.pointee.lpVtbl.pointee.ClearAsync(pThis, locality, &clearOperationAbi)) + } + } + return __ABI_Windows_Foundation.IAsyncActionWrapper.unwrapFrom(abi: clearOperation) + } + + internal func get_LocalSettingsImpl() throws -> UWP.ApplicationDataContainer? { + let (value) = try ComPtrs.initialize { valueAbi in + _ = try perform(as: __x_ABI_CWindows_CStorage_CIApplicationData.self) { pThis in + try CHECKED(pThis.pointee.lpVtbl.pointee.get_LocalSettings(pThis, &valueAbi)) + } + } + return .from(abi: value) + } + + internal func get_RoamingSettingsImpl() throws -> UWP.ApplicationDataContainer? { + let (value) = try ComPtrs.initialize { valueAbi in + _ = try perform(as: __x_ABI_CWindows_CStorage_CIApplicationData.self) { pThis in + try CHECKED(pThis.pointee.lpVtbl.pointee.get_RoamingSettings(pThis, &valueAbi)) + } + } + return .from(abi: value) + } + + internal func get_LocalFolderImpl() throws -> UWP.StorageFolder? { + let (value) = try ComPtrs.initialize { valueAbi in + _ = try perform(as: __x_ABI_CWindows_CStorage_CIApplicationData.self) { pThis in + try CHECKED(pThis.pointee.lpVtbl.pointee.get_LocalFolder(pThis, &valueAbi)) + } + } + return .from(abi: value) + } + + internal func get_RoamingFolderImpl() throws -> UWP.StorageFolder? { + let (value) = try ComPtrs.initialize { valueAbi in + _ = try perform(as: __x_ABI_CWindows_CStorage_CIApplicationData.self) { pThis in + try CHECKED(pThis.pointee.lpVtbl.pointee.get_RoamingFolder(pThis, &valueAbi)) + } + } + return .from(abi: value) + } + + internal func get_TemporaryFolderImpl() throws -> UWP.StorageFolder? { + let (value) = try ComPtrs.initialize { valueAbi in + _ = try perform(as: __x_ABI_CWindows_CStorage_CIApplicationData.self) { pThis in + try CHECKED(pThis.pointee.lpVtbl.pointee.get_TemporaryFolder(pThis, &valueAbi)) + } + } + return .from(abi: value) + } + + internal func add_DataChangedImpl(_ handler: TypedEventHandler?) throws -> EventRegistrationToken { + var token: EventRegistrationToken = .init() + let handlerWrapper = UWP.__x_ABI_C__FITypedEventHandler_2___x_ABI_CWindows__CStorage__CApplicationData_IInspectableWrapper(handler) + let _handler = try! handlerWrapper?.toABI { $0 } + _ = try perform(as: __x_ABI_CWindows_CStorage_CIApplicationData.self) { pThis in + try CHECKED(pThis.pointee.lpVtbl.pointee.add_DataChanged(pThis, _handler, &token)) + } + return token + } + + internal func remove_DataChangedImpl(_ token: EventRegistrationToken) throws { + _ = try perform(as: __x_ABI_CWindows_CStorage_CIApplicationData.self) { pThis in + try CHECKED(pThis.pointee.lpVtbl.pointee.remove_DataChanged(pThis, token)) + } + } + + internal func SignalDataChangedImpl() throws { + _ = try perform(as: __x_ABI_CWindows_CStorage_CIApplicationData.self) { pThis in + try CHECKED(pThis.pointee.lpVtbl.pointee.SignalDataChanged(pThis)) + } + } + + internal func get_RoamingStorageQuotaImpl() throws -> UInt64 { + var value: UINT64 = 0 + _ = try perform(as: __x_ABI_CWindows_CStorage_CIApplicationData.self) { pThis in + try CHECKED(pThis.pointee.lpVtbl.pointee.get_RoamingStorageQuota(pThis, &value)) + } + return value + } + + } + + public class IApplicationData2: WindowsFoundation.IInspectable { + override public class var IID: WindowsFoundation.IID { IID___x_ABI_CWindows_CStorage_CIApplicationData2 } + + internal func get_LocalCacheFolderImpl() throws -> UWP.StorageFolder? { + let (value) = try ComPtrs.initialize { valueAbi in + _ = try perform(as: __x_ABI_CWindows_CStorage_CIApplicationData2.self) { pThis in + try CHECKED(pThis.pointee.lpVtbl.pointee.get_LocalCacheFolder(pThis, &valueAbi)) + } + } + return .from(abi: value) + } + + } + + public class IApplicationData3: WindowsFoundation.IInspectable { + override public class var IID: WindowsFoundation.IID { IID___x_ABI_CWindows_CStorage_CIApplicationData3 } + + internal func GetPublisherCacheFolderImpl(_ folderName: String) throws -> UWP.StorageFolder? { + let (value) = try ComPtrs.initialize { valueAbi in + let _folderName = try! HString(folderName) + _ = try perform(as: __x_ABI_CWindows_CStorage_CIApplicationData3.self) { pThis in + try CHECKED(pThis.pointee.lpVtbl.pointee.GetPublisherCacheFolder(pThis, _folderName.get(), &valueAbi)) + } + } + return .from(abi: value) + } + + internal func ClearPublisherCacheFolderAsyncImpl(_ folderName: String) throws -> WindowsFoundation.AnyIAsyncAction? { + let (clearOperation) = try ComPtrs.initialize { clearOperationAbi in + let _folderName = try! HString(folderName) + _ = try perform(as: __x_ABI_CWindows_CStorage_CIApplicationData3.self) { pThis in + try CHECKED(pThis.pointee.lpVtbl.pointee.ClearPublisherCacheFolderAsync(pThis, _folderName.get(), &clearOperationAbi)) + } + } + return __ABI_Windows_Foundation.IAsyncActionWrapper.unwrapFrom(abi: clearOperation) + } + + internal func get_SharedLocalFolderImpl() throws -> UWP.StorageFolder? { + let (value) = try ComPtrs.initialize { valueAbi in + _ = try perform(as: __x_ABI_CWindows_CStorage_CIApplicationData3.self) { pThis in + try CHECKED(pThis.pointee.lpVtbl.pointee.get_SharedLocalFolder(pThis, &valueAbi)) + } + } + return .from(abi: value) + } + + } + + public class IApplicationDataContainer: WindowsFoundation.IInspectable { + override public class var IID: WindowsFoundation.IID { IID___x_ABI_CWindows_CStorage_CIApplicationDataContainer } + + internal func get_NameImpl() throws -> String { + var value: HSTRING? + _ = try perform(as: __x_ABI_CWindows_CStorage_CIApplicationDataContainer.self) { pThis in + try CHECKED(pThis.pointee.lpVtbl.pointee.get_Name(pThis, &value)) + } + return .init(from: value) + } + + internal func get_LocalityImpl() throws -> UWP.ApplicationDataLocality { + var value: __x_ABI_CWindows_CStorage_CApplicationDataLocality = .init(0) + _ = try perform(as: __x_ABI_CWindows_CStorage_CIApplicationDataContainer.self) { pThis in + try CHECKED(pThis.pointee.lpVtbl.pointee.get_Locality(pThis, &value)) + } + return value + } + + internal func get_ValuesImpl() throws -> WindowsFoundation.AnyIPropertySet? { + let (value) = try ComPtrs.initialize { valueAbi in + _ = try perform(as: __x_ABI_CWindows_CStorage_CIApplicationDataContainer.self) { pThis in + try CHECKED(pThis.pointee.lpVtbl.pointee.get_Values(pThis, &valueAbi)) + } + } + return __ABI_Windows_Foundation_Collections.IPropertySetWrapper.unwrapFrom(abi: value) + } + + internal func get_ContainersImpl() throws -> WindowsFoundation.AnyIMapView? { + let (value) = try ComPtrs.initialize { valueAbi in + _ = try perform(as: __x_ABI_CWindows_CStorage_CIApplicationDataContainer.self) { pThis in + try CHECKED(pThis.pointee.lpVtbl.pointee.get_Containers(pThis, &valueAbi)) + } + } + return UWP.__x_ABI_C__FIMapView_2_HSTRING___x_ABI_CWindows__CStorage__CApplicationDataContainerWrapper.unwrapFrom(abi: value) + } + + internal func CreateContainerImpl(_ name: String, _ disposition: UWP.ApplicationDataCreateDisposition) throws -> UWP.ApplicationDataContainer? { + let (container) = try ComPtrs.initialize { containerAbi in + let _name = try! HString(name) + _ = try perform(as: __x_ABI_CWindows_CStorage_CIApplicationDataContainer.self) { pThis in + try CHECKED(pThis.pointee.lpVtbl.pointee.CreateContainer(pThis, _name.get(), disposition, &containerAbi)) + } + } + return .from(abi: container) + } + + internal func DeleteContainerImpl(_ name: String) throws { + let _name = try! HString(name) + _ = try perform(as: __x_ABI_CWindows_CStorage_CIApplicationDataContainer.self) { pThis in + try CHECKED(pThis.pointee.lpVtbl.pointee.DeleteContainer(pThis, _name.get())) + } + } + + } + + public class IApplicationDataStatics: WindowsFoundation.IInspectable { + override public class var IID: WindowsFoundation.IID { IID___x_ABI_CWindows_CStorage_CIApplicationDataStatics } + + internal func get_CurrentImpl() throws -> UWP.ApplicationData? { + let (value) = try ComPtrs.initialize { valueAbi in + _ = try perform(as: __x_ABI_CWindows_CStorage_CIApplicationDataStatics.self) { pThis in + try CHECKED(pThis.pointee.lpVtbl.pointee.get_Current(pThis, &valueAbi)) + } + } + return .from(abi: value) + } + + } + + public class IApplicationDataStatics2: WindowsFoundation.IInspectable { + override public class var IID: WindowsFoundation.IID { IID___x_ABI_CWindows_CStorage_CIApplicationDataStatics2 } + + internal func GetForUserAsyncImpl(_ user: UWP.User?) throws -> WindowsFoundation.AnyIAsyncOperation? { + let (getForUserOperation) = try ComPtrs.initialize { getForUserOperationAbi in + _ = try perform(as: __x_ABI_CWindows_CStorage_CIApplicationDataStatics2.self) { pThis in + try CHECKED(pThis.pointee.lpVtbl.pointee.GetForUserAsync(pThis, RawPointer(user), &getForUserOperationAbi)) + } + } + return UWP.__x_ABI_C__FIAsyncOperation_1___x_ABI_CWindows__CStorage__CApplicationDataWrapper.unwrapFrom(abi: getForUserOperation) + } + + } + + public class ISetVersionDeferral: WindowsFoundation.IInspectable { + override public class var IID: WindowsFoundation.IID { IID___x_ABI_CWindows_CStorage_CISetVersionDeferral } + + internal func CompleteImpl() throws { + _ = try perform(as: __x_ABI_CWindows_CStorage_CISetVersionDeferral.self) { pThis in + try CHECKED(pThis.pointee.lpVtbl.pointee.Complete(pThis)) + } + } + + } + + public class ISetVersionRequest: WindowsFoundation.IInspectable { + override public class var IID: WindowsFoundation.IID { IID___x_ABI_CWindows_CStorage_CISetVersionRequest } + + internal func get_CurrentVersionImpl() throws -> UInt32 { + var currentVersion: UINT32 = 0 + _ = try perform(as: __x_ABI_CWindows_CStorage_CISetVersionRequest.self) { pThis in + try CHECKED(pThis.pointee.lpVtbl.pointee.get_CurrentVersion(pThis, ¤tVersion)) + } + return currentVersion + } + + internal func get_DesiredVersionImpl() throws -> UInt32 { + var desiredVersion: UINT32 = 0 + _ = try perform(as: __x_ABI_CWindows_CStorage_CISetVersionRequest.self) { pThis in + try CHECKED(pThis.pointee.lpVtbl.pointee.get_DesiredVersion(pThis, &desiredVersion)) + } + return desiredVersion + } + + internal func GetDeferralImpl() throws -> UWP.SetVersionDeferral? { + let (deferral) = try ComPtrs.initialize { deferralAbi in + _ = try perform(as: __x_ABI_CWindows_CStorage_CISetVersionRequest.self) { pThis in + try CHECKED(pThis.pointee.lpVtbl.pointee.GetDeferral(pThis, &deferralAbi)) + } + } + return .from(abi: deferral) + } + + } + public class IStorageFile: WindowsFoundation.IInspectable { override public class var IID: WindowsFoundation.IID { IID___x_ABI_CWindows_CStorage_CIStorageFile } @@ -1717,6 +2043,40 @@ public enum __ABI_Windows_Storage { public typealias IStreamedFileDataRequestWrapper = InterfaceWrapperBase<__IMPL_Windows_Storage.IStreamedFileDataRequestBridge> } +// MARK - ApplicationDataSetVersionHandler +extension __ABI_Windows_Storage { + public class ApplicationDataSetVersionHandler: WindowsFoundation.IUnknown { + override public class var IID: WindowsFoundation.IID { IID___x_ABI_CWindows_CStorage_CIApplicationDataSetVersionHandler } + + open func InvokeImpl(_ setVersionRequest: UWP.SetVersionRequest?) throws { + _ = try perform(as: __x_ABI_CWindows_CStorage_CIApplicationDataSetVersionHandler.self) { pThis in + try CHECKED(pThis.pointee.lpVtbl.pointee.Invoke(pThis, RawPointer(setVersionRequest))) + } + } + + } + + + typealias ApplicationDataSetVersionHandlerWrapper = InterfaceWrapperBase<__IMPL_Windows_Storage.ApplicationDataSetVersionHandlerBridge> + internal static var ApplicationDataSetVersionHandlerVTable: __x_ABI_CWindows_CStorage_CIApplicationDataSetVersionHandlerVtbl = .init( + QueryInterface: { ApplicationDataSetVersionHandlerWrapper.queryInterface($0, $1, $2) }, + AddRef: { ApplicationDataSetVersionHandlerWrapper.addRef($0) }, + Release: { ApplicationDataSetVersionHandlerWrapper.release($0) }, + Invoke: { + guard let __unwrapped__instance = ApplicationDataSetVersionHandlerWrapper.tryUnwrapFrom(raw: $0) else { return E_INVALIDARG } + let setVersionRequest: UWP.SetVersionRequest? = .from(abi: ComPtr($1)) + __unwrapped__instance(setVersionRequest) + return S_OK + } + ) +} +public extension WinRTDelegateBridge where CABI == __x_ABI_CWindows_CStorage_CIApplicationDataSetVersionHandler { + static func makeAbi() -> CABI { + let vtblPtr = withUnsafeMutablePointer(to: &__ABI_Windows_Storage.ApplicationDataSetVersionHandlerVTable) { $0 } + return .init(lpVtbl:vtblPtr) + } +} + // MARK - StreamedFileDataRequestedHandler extension __ABI_Windows_Storage { public class StreamedFileDataRequestedHandler: WindowsFoundation.IUnknown { diff --git a/Sources/UWP/Generated/Windows.Storage+Impl.swift b/Sources/UWP/Generated/Windows.Storage+Impl.swift index 7087dcd..f701d00 100644 --- a/Sources/UWP/Generated/Windows.Storage+Impl.swift +++ b/Sources/UWP/Generated/Windows.Storage+Impl.swift @@ -767,6 +767,20 @@ public enum __IMPL_Windows_Storage { } + public class ApplicationDataSetVersionHandlerBridge : WinRTDelegateBridge { + public typealias Handler = ApplicationDataSetVersionHandler + public typealias CABI = __x_ABI_CWindows_CStorage_CIApplicationDataSetVersionHandler + public typealias SwiftABI = __ABI_Windows_Storage.ApplicationDataSetVersionHandler + + public static func from(abi: ComPtr?) -> Handler? { + guard let abi = abi else { return nil } + let _default = SwiftABI(abi) + let handler: Handler = { (setVersionRequest) in + try! _default.InvokeImpl(setVersionRequest) + } + return handler + } + } public class StreamedFileDataRequestedHandlerBridge : WinRTDelegateBridge { public typealias Handler = StreamedFileDataRequestedHandler public typealias CABI = __x_ABI_CWindows_CStorage_CIStreamedFileDataRequestedHandler diff --git a/Sources/UWP/Generated/Windows.Storage.swift b/Sources/UWP/Generated/Windows.Storage.swift index 375159e..3e28479 100644 --- a/Sources/UWP/Generated/Windows.Storage.swift +++ b/Sources/UWP/Generated/Windows.Storage.swift @@ -4,6 +4,10 @@ import Foundation @_spi(WinRTInternal) @_spi(WinRTImplements) import WindowsFoundation import CWinRT +/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.applicationdatacreatedisposition) +public typealias ApplicationDataCreateDisposition = __x_ABI_CWindows_CStorage_CApplicationDataCreateDisposition +/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.applicationdatalocality) +public typealias ApplicationDataLocality = __x_ABI_CWindows_CStorage_CApplicationDataLocality /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.creationcollisionoption) public typealias CreationCollisionOption = __x_ABI_CWindows_CStorage_CCreationCollisionOption /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.fileaccessmode) @@ -22,6 +26,276 @@ public typealias StorageLibraryChangeType = __x_ABI_CWindows_CStorage_CStorageLi public typealias StorageOpenOptions = __x_ABI_CWindows_CStorage_CStorageOpenOptions /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.streamedfilefailuremode) public typealias StreamedFileFailureMode = __x_ABI_CWindows_CStorage_CStreamedFileFailureMode +/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.applicationdata) +public final class ApplicationData : WinRTClass { + private typealias SwiftABI = __ABI_Windows_Storage.IApplicationData + private typealias CABI = __x_ABI_CWindows_CStorage_CIApplicationData + private lazy var _default: SwiftABI! = getInterfaceForCaching() + @_spi(WinRTInternal) + override public func _getABI() -> UnsafeMutablePointer? { + if T.self == CABI.self { + return RawPointer(_default) + } + return super._getABI() + } + + @_spi(WinRTInternal) + public static func from(abi: ComPtr<__x_ABI_CWindows_CStorage_CIApplicationData>?) -> ApplicationData? { + guard let abi = abi else { return nil } + return .init(fromAbi: WindowsFoundation.IInspectable(abi)) + } + + @_spi(WinRTInternal) + public init(fromAbi: WindowsFoundation.IInspectable) { + super.init(fromAbi) + } + + private static let _IApplicationDataStatics: __ABI_Windows_Storage.IApplicationDataStatics = try! RoGetActivationFactory(HString("Windows.Storage.ApplicationData")) + /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.applicationdata.current) + public static var current : ApplicationData! { + get { try! _IApplicationDataStatics.get_CurrentImpl() } + } + + private static let _IApplicationDataStatics2: __ABI_Windows_Storage.IApplicationDataStatics2 = try! RoGetActivationFactory(HString("Windows.Storage.ApplicationData")) + /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.applicationdata.getforuserasync) + public static func getForUserAsync(_ user: UWP.User!) -> WindowsFoundation.AnyIAsyncOperation! { + return try! _IApplicationDataStatics2.GetForUserAsyncImpl(user) + } + + /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.applicationdata.setversionasync) + public func setVersionAsync(_ desiredVersion: UInt32, _ handler: ApplicationDataSetVersionHandler!) throws -> WindowsFoundation.AnyIAsyncAction! { + try _default.SetVersionAsyncImpl(desiredVersion, handler) + } + + /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.applicationdata.clearasync) + public func clearAsync() throws -> WindowsFoundation.AnyIAsyncAction! { + try _default.ClearAllAsyncImpl() + } + + /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.applicationdata.clearasync) + public func clearAsync(_ locality: ApplicationDataLocality) throws -> WindowsFoundation.AnyIAsyncAction! { + try _default.ClearAsyncImpl(locality) + } + + /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.applicationdata.signaldatachanged) + public func signalDataChanged() throws { + try _default.SignalDataChangedImpl() + } + + /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.applicationdata.localfolder) + public var localFolder : StorageFolder! { + get { try! _default.get_LocalFolderImpl() } + } + + /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.applicationdata.localsettings) + public var localSettings : ApplicationDataContainer! { + get { try! _default.get_LocalSettingsImpl() } + } + + /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.applicationdata.roamingfolder) + public var roamingFolder : StorageFolder! { + get { try! _default.get_RoamingFolderImpl() } + } + + /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.applicationdata.roamingsettings) + public var roamingSettings : ApplicationDataContainer! { + get { try! _default.get_RoamingSettingsImpl() } + } + + /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.applicationdata.roamingstoragequota) + public var roamingStorageQuota : UInt64 { + get { try! _default.get_RoamingStorageQuotaImpl() } + } + + /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.applicationdata.temporaryfolder) + public var temporaryFolder : StorageFolder! { + get { try! _default.get_TemporaryFolderImpl() } + } + + /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.applicationdata.version) + public var version : UInt32 { + get { try! _default.get_VersionImpl() } + } + + /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.applicationdata.datachanged) + public lazy var dataChanged : Event> = { + .init( + add: { [weak self] in + guard let this = self?._default else { return .init() } + return try! this.add_DataChangedImpl($0) + }, + remove: { [weak self] in + try? self?._default.remove_DataChangedImpl($0) + } + ) + }() + + private lazy var _IApplicationData2: __ABI_Windows_Storage.IApplicationData2! = getInterfaceForCaching() + /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.applicationdata.localcachefolder) + public var localCacheFolder : StorageFolder! { + get { try! _IApplicationData2.get_LocalCacheFolderImpl() } + } + + private lazy var _IApplicationData3: __ABI_Windows_Storage.IApplicationData3! = getInterfaceForCaching() + /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.applicationdata.getpublishercachefolder) + public func getPublisherCacheFolder(_ folderName: String) throws -> StorageFolder! { + try _IApplicationData3.GetPublisherCacheFolderImpl(folderName) + } + + /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.applicationdata.clearpublishercachefolderasync) + public func clearPublisherCacheFolderAsync(_ folderName: String) throws -> WindowsFoundation.AnyIAsyncAction! { + try _IApplicationData3.ClearPublisherCacheFolderAsyncImpl(folderName) + } + + /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.applicationdata.sharedlocalfolder) + public var sharedLocalFolder : StorageFolder! { + get { try! _IApplicationData3.get_SharedLocalFolderImpl() } + } + + deinit { + _default = nil + _IApplicationData2 = nil + _IApplicationData3 = nil + } +} + +/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.applicationdatacontainer) +public final class ApplicationDataContainer : WinRTClass { + private typealias SwiftABI = __ABI_Windows_Storage.IApplicationDataContainer + private typealias CABI = __x_ABI_CWindows_CStorage_CIApplicationDataContainer + private lazy var _default: SwiftABI! = getInterfaceForCaching() + @_spi(WinRTInternal) + override public func _getABI() -> UnsafeMutablePointer? { + if T.self == CABI.self { + return RawPointer(_default) + } + return super._getABI() + } + + @_spi(WinRTInternal) + public static func from(abi: ComPtr<__x_ABI_CWindows_CStorage_CIApplicationDataContainer>?) -> ApplicationDataContainer? { + guard let abi = abi else { return nil } + return .init(fromAbi: WindowsFoundation.IInspectable(abi)) + } + + @_spi(WinRTInternal) + public init(fromAbi: WindowsFoundation.IInspectable) { + super.init(fromAbi) + } + + /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.applicationdatacontainer.createcontainer) + public func createContainer(_ name: String, _ disposition: ApplicationDataCreateDisposition) throws -> ApplicationDataContainer! { + try _default.CreateContainerImpl(name, disposition) + } + + /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.applicationdatacontainer.deletecontainer) + public func deleteContainer(_ name: String) throws { + try _default.DeleteContainerImpl(name) + } + + /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.applicationdatacontainer.containers) + public var containers : WindowsFoundation.AnyIMapView! { + get { try! _default.get_ContainersImpl() } + } + + /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.applicationdatacontainer.locality) + public var locality : ApplicationDataLocality { + get { try! _default.get_LocalityImpl() } + } + + /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.applicationdatacontainer.name) + public var name : String { + get { try! _default.get_NameImpl() } + } + + /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.applicationdatacontainer.values) + public var values : WindowsFoundation.AnyIPropertySet! { + get { try! _default.get_ValuesImpl() } + } + + deinit { + _default = nil + } +} + +/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.setversiondeferral) +public final class SetVersionDeferral : WinRTClass { + private typealias SwiftABI = __ABI_Windows_Storage.ISetVersionDeferral + private typealias CABI = __x_ABI_CWindows_CStorage_CISetVersionDeferral + private lazy var _default: SwiftABI! = getInterfaceForCaching() + @_spi(WinRTInternal) + override public func _getABI() -> UnsafeMutablePointer? { + if T.self == CABI.self { + return RawPointer(_default) + } + return super._getABI() + } + + @_spi(WinRTInternal) + public static func from(abi: ComPtr<__x_ABI_CWindows_CStorage_CISetVersionDeferral>?) -> SetVersionDeferral? { + guard let abi = abi else { return nil } + return .init(fromAbi: WindowsFoundation.IInspectable(abi)) + } + + @_spi(WinRTInternal) + public init(fromAbi: WindowsFoundation.IInspectable) { + super.init(fromAbi) + } + + /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.setversiondeferral.complete) + public func complete() throws { + try _default.CompleteImpl() + } + + deinit { + _default = nil + } +} + +/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.setversionrequest) +public final class SetVersionRequest : WinRTClass { + private typealias SwiftABI = __ABI_Windows_Storage.ISetVersionRequest + private typealias CABI = __x_ABI_CWindows_CStorage_CISetVersionRequest + private lazy var _default: SwiftABI! = getInterfaceForCaching() + @_spi(WinRTInternal) + override public func _getABI() -> UnsafeMutablePointer? { + if T.self == CABI.self { + return RawPointer(_default) + } + return super._getABI() + } + + @_spi(WinRTInternal) + public static func from(abi: ComPtr<__x_ABI_CWindows_CStorage_CISetVersionRequest>?) -> SetVersionRequest? { + guard let abi = abi else { return nil } + return .init(fromAbi: WindowsFoundation.IInspectable(abi)) + } + + @_spi(WinRTInternal) + public init(fromAbi: WindowsFoundation.IInspectable) { + super.init(fromAbi) + } + + /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.setversionrequest.getdeferral) + public func getDeferral() throws -> SetVersionDeferral! { + try _default.GetDeferralImpl() + } + + /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.setversionrequest.currentversion) + public var currentVersion : UInt32 { + get { try! _default.get_CurrentVersionImpl() } + } + + /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.setversionrequest.desiredversion) + public var desiredVersion : UInt32 { + get { try! _default.get_DesiredVersionImpl() } + } + + deinit { + _default = nil + } +} + /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.storagefile) public final class StorageFile : WinRTClass, IStorageItem, UWP.IRandomAccessStreamReference, UWP.IInputStreamReference, IStorageFile, IStorageItemProperties, IStorageItemProperties2, IStorageItem2, IStorageItemPropertiesWithProvider, IStorageFilePropertiesWithAvailability, IStorageFile2 { private typealias SwiftABI = __ABI_Windows_Storage.IStorageFile @@ -905,6 +1179,7 @@ public final class StreamedFileDataRequest : WinRTClass, WindowsFoundation.IClos } } +public typealias ApplicationDataSetVersionHandler = (SetVersionRequest?) -> () public typealias StreamedFileDataRequestedHandler = (StreamedFileDataRequest?) -> () /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.storage.istoragefile) public protocol IStorageFile : IStorageItem, UWP.IRandomAccessStreamReference, UWP.IInputStreamReference { @@ -1203,6 +1478,32 @@ extension IStreamedFileDataRequest { } public typealias AnyIStreamedFileDataRequest = any IStreamedFileDataRequest +extension UWP.ApplicationDataCreateDisposition { + public static var always : UWP.ApplicationDataCreateDisposition { + __x_ABI_CWindows_CStorage_CApplicationDataCreateDisposition_Always + } + public static var existing : UWP.ApplicationDataCreateDisposition { + __x_ABI_CWindows_CStorage_CApplicationDataCreateDisposition_Existing + } +} +extension UWP.ApplicationDataCreateDisposition: @retroactive Hashable, @retroactive Codable {} + +extension UWP.ApplicationDataLocality { + public static var local : UWP.ApplicationDataLocality { + __x_ABI_CWindows_CStorage_CApplicationDataLocality_Local + } + public static var roaming : UWP.ApplicationDataLocality { + __x_ABI_CWindows_CStorage_CApplicationDataLocality_Roaming + } + public static var temporary : UWP.ApplicationDataLocality { + __x_ABI_CWindows_CStorage_CApplicationDataLocality_Temporary + } + public static var localCache : UWP.ApplicationDataLocality { + __x_ABI_CWindows_CStorage_CApplicationDataLocality_LocalCache + } +} +extension UWP.ApplicationDataLocality: @retroactive Hashable, @retroactive Codable {} + extension UWP.CreationCollisionOption { public static var generateUniqueName : UWP.CreationCollisionOption { __x_ABI_CWindows_CStorage_CCreationCollisionOption_GenerateUniqueName diff --git a/projections.json b/projections.json index e9759f6..8bc8156 100644 --- a/projections.json +++ b/projections.json @@ -22,6 +22,8 @@ "Windows.Media.Core.MediaSource", "Windows.Media.Render", "Windows.Media.Playback.MediaPlayer", + "Windows.Storage.ApplicationData", + "Windows.Storage.StorageFolder", "Windows.Storage.Streams", "Windows.Storage.Pickers", "Windows.System.Launcher",