swift-uwp/Sources/UWP/Generated/Windows.ApplicationModel.Background+ABI.swift
2024-02-15 17:14:48 -08:00

803 lines
41 KiB
Swift

// WARNING: Please don't edit this file. It was generated by Swift/WinRT v0.0.1
// swiftlint:disable all
import Foundation
@_spi(WinRTInternal) @_spi(WinRTImplements) import WindowsFoundation
import CWinRT
private var IID___x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskCompletedEventArgs: WindowsFoundation.IID {
.init(Data1: 0x565D25CF, Data2: 0xF209, Data3: 0x48F4, Data4: ( 0x99,0x67,0x2B,0x18,0x4F,0x7B,0xFB,0xF0 ))// 565D25CF-F209-48F4-9967-2B184F7BFBF0
}
private var IID___x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskDeferral: WindowsFoundation.IID {
.init(Data1: 0x93CC156D, Data2: 0xAF27, Data3: 0x4DD3, Data4: ( 0x84,0x6E,0x24,0xEE,0x40,0xCA,0xDD,0x25 ))// 93CC156D-AF27-4DD3-846E-24EE40CADD25
}
private var IID___x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskInstance: WindowsFoundation.IID {
.init(Data1: 0x865BDA7A, Data2: 0x21D8, Data3: 0x4573, Data4: ( 0x8F,0x32,0x92,0x8A,0x1B,0x06,0x41,0xF6 ))// 865BDA7A-21D8-4573-8F32-928A1B0641F6
}
private var IID___x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskProgressEventArgs: WindowsFoundation.IID {
.init(Data1: 0xFB1468AC, Data2: 0x8332, Data3: 0x4D0A, Data4: ( 0x95,0x32,0x03,0xEA,0xE6,0x84,0xDA,0x31 ))// FB1468AC-8332-4D0A-9532-03EAE684DA31
}
private var IID___x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskRegistration: WindowsFoundation.IID {
.init(Data1: 0x10654CC2, Data2: 0xA26E, Data3: 0x43BF, Data4: ( 0x8C,0x12,0x1F,0xB4,0x0D,0xBF,0xBF,0xA0 ))// 10654CC2-A26E-43BF-8C12-1FB40DBFBFA0
}
private var IID___x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskRegistration2: WindowsFoundation.IID {
.init(Data1: 0x6138C703, Data2: 0xBB86, Data3: 0x4112, Data4: ( 0xAF,0xC3,0x7F,0x93,0x9B,0x16,0x6E,0x3B ))// 6138C703-BB86-4112-AFC3-7F939B166E3B
}
private var IID___x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskRegistration3: WindowsFoundation.IID {
.init(Data1: 0xFE338195, Data2: 0x9423, Data3: 0x4D8B, Data4: ( 0x83,0x0D,0xB1,0xDD,0x2C,0x7B,0xAD,0xD5 ))// FE338195-9423-4D8B-830D-B1DD2C7BADD5
}
private var IID___x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskRegistrationGroup: WindowsFoundation.IID {
.init(Data1: 0x2AB1919A, Data2: 0x871B, Data3: 0x4167, Data4: ( 0x8A,0x76,0x05,0x5C,0xD6,0x7B,0x5B,0x23 ))// 2AB1919A-871B-4167-8A76-055CD67B5B23
}
private var IID___x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskRegistrationGroupFactory: WindowsFoundation.IID {
.init(Data1: 0x83D92B69, Data2: 0x44CF, Data3: 0x4631, Data4: ( 0x97,0x40,0x03,0xC7,0xD8,0x74,0x1B,0xC5 ))// 83D92B69-44CF-4631-9740-03C7D8741BC5
}
private var IID___x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskRegistrationStatics: WindowsFoundation.IID {
.init(Data1: 0x4C542F69, Data2: 0xB000, Data3: 0x42BA, Data4: ( 0xA0,0x93,0x6A,0x56,0x3C,0x65,0xE3,0xF8 ))// 4C542F69-B000-42BA-A093-6A563C65E3F8
}
private var IID___x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskRegistrationStatics2: WindowsFoundation.IID {
.init(Data1: 0x174B671E, Data2: 0xB20D, Data3: 0x4FA9, Data4: ( 0xAD,0x9A,0xE9,0x3A,0xD6,0xC7,0x1E,0x01 ))// 174B671E-B20D-4FA9-AD9A-E93AD6C71E01
}
private var IID___x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTrigger: WindowsFoundation.IID {
.init(Data1: 0x84B3A058, Data2: 0x6027, Data3: 0x4B87, Data4: ( 0x97,0x90,0xBD,0xF3,0xF7,0x57,0xDB,0xD7 ))// 84B3A058-6027-4B87-9790-BDF3F757DBD7
}
private var IID___x_ABI_CWindows_CApplicationModel_CBackground_CIDeviceWatcherTrigger: WindowsFoundation.IID {
.init(Data1: 0xA4617FDD, Data2: 0x8573, Data3: 0x4260, Data4: ( 0xBE,0xFC,0x5B,0xEC,0x89,0xCB,0x69,0x3D ))// A4617FDD-8573-4260-BEFC-5BEC89CB693D
}
private var IID___x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskCanceledEventHandler: WindowsFoundation.IID {
.init(Data1: 0xA6C4BAC0, Data2: 0x51F8, Data3: 0x4C57, Data4: ( 0xAC,0x3F,0x15,0x6D,0xD1,0x68,0x0C,0x4F ))// A6C4BAC0-51F8-4C57-AC3F-156DD1680C4F
}
private var IID___x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskCompletedEventHandler: WindowsFoundation.IID {
.init(Data1: 0x5B38E929, Data2: 0xA086, Data3: 0x46A7, Data4: ( 0xA6,0x78,0x43,0x91,0x35,0x82,0x2B,0xCF ))// 5B38E929-A086-46A7-A678-439135822BCF
}
private var IID___x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskProgressEventHandler: WindowsFoundation.IID {
.init(Data1: 0x46E0683C, Data2: 0x8A88, Data3: 0x4C99, Data4: ( 0x80,0x4C,0x76,0x89,0x7F,0x62,0x77,0xA6 ))// 46E0683C-8A88-4C99-804C-76897F6277A6
}
public enum __ABI_Windows_ApplicationModel_Background {
public class IBackgroundTaskCompletedEventArgs: WindowsFoundation.IInspectable {
override public class var IID: WindowsFoundation.IID { IID___x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskCompletedEventArgs }
internal func get_InstanceIdImpl() throws -> Foundation.UUID {
var value: WindowsFoundation.GUID = .init()
_ = try perform(as: __x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskCompletedEventArgs.self) { pThis in
try CHECKED(pThis.pointee.lpVtbl.pointee.get_InstanceId(pThis, &value))
}
return .init(from: value)
}
internal func CheckResultImpl() throws {
_ = try perform(as: __x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskCompletedEventArgs.self) { pThis in
try CHECKED(pThis.pointee.lpVtbl.pointee.CheckResult(pThis))
}
}
}
public class IBackgroundTaskDeferral: WindowsFoundation.IInspectable {
override public class var IID: WindowsFoundation.IID { IID___x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskDeferral }
internal func CompleteImpl() throws {
_ = try perform(as: __x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskDeferral.self) { pThis in
try CHECKED(pThis.pointee.lpVtbl.pointee.Complete(pThis))
}
}
}
public class IBackgroundTaskInstance: WindowsFoundation.IInspectable {
override public class var IID: WindowsFoundation.IID { IID___x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskInstance }
open func get_InstanceIdImpl() throws -> Foundation.UUID {
var value: WindowsFoundation.GUID = .init()
_ = try perform(as: __x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskInstance.self) { pThis in
try CHECKED(pThis.pointee.lpVtbl.pointee.get_InstanceId(pThis, &value))
}
return .init(from: value)
}
open func get_TaskImpl() throws -> UWP.BackgroundTaskRegistration? {
let (task) = try ComPtrs.initialize { taskAbi in
_ = try perform(as: __x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskInstance.self) { pThis in
try CHECKED(pThis.pointee.lpVtbl.pointee.get_Task(pThis, &taskAbi))
}
}
return .from(abi: task)
}
open func get_ProgressImpl() throws -> UInt32 {
var value: UINT32 = 0
_ = try perform(as: __x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskInstance.self) { pThis in
try CHECKED(pThis.pointee.lpVtbl.pointee.get_Progress(pThis, &value))
}
return value
}
open func put_ProgressImpl(_ value: UInt32) throws {
_ = try perform(as: __x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskInstance.self) { pThis in
try CHECKED(pThis.pointee.lpVtbl.pointee.put_Progress(pThis, value))
}
}
open func get_TriggerDetailsImpl() throws -> Any? {
let (triggerDetails) = try ComPtrs.initialize { triggerDetailsAbi in
_ = try perform(as: __x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskInstance.self) { pThis in
try CHECKED(pThis.pointee.lpVtbl.pointee.get_TriggerDetails(pThis, &triggerDetailsAbi))
}
}
return __ABI_.AnyWrapper.unwrapFrom(abi: triggerDetails)
}
open func add_CanceledImpl(_ cancelHandler: UWP.BackgroundTaskCanceledEventHandler?) throws -> EventRegistrationToken {
var cookie: EventRegistrationToken = .init()
let cancelHandlerWrapper = __ABI_Windows_ApplicationModel_Background.BackgroundTaskCanceledEventHandlerWrapper(cancelHandler)
let _cancelHandler = try! cancelHandlerWrapper?.toABI { $0 }
_ = try perform(as: __x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskInstance.self) { pThis in
try CHECKED(pThis.pointee.lpVtbl.pointee.add_Canceled(pThis, _cancelHandler, &cookie))
}
return cookie
}
open func remove_CanceledImpl(_ cookie: EventRegistrationToken) throws {
_ = try perform(as: __x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskInstance.self) { pThis in
try CHECKED(pThis.pointee.lpVtbl.pointee.remove_Canceled(pThis, cookie))
}
}
open func get_SuspendedCountImpl() throws -> UInt32 {
var value: UINT32 = 0
_ = try perform(as: __x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskInstance.self) { pThis in
try CHECKED(pThis.pointee.lpVtbl.pointee.get_SuspendedCount(pThis, &value))
}
return value
}
open func GetDeferralImpl() throws -> UWP.BackgroundTaskDeferral? {
let (deferral) = try ComPtrs.initialize { deferralAbi in
_ = try perform(as: __x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskInstance.self) { pThis in
try CHECKED(pThis.pointee.lpVtbl.pointee.GetDeferral(pThis, &deferralAbi))
}
}
return .from(abi: deferral)
}
}
internal static var IBackgroundTaskInstanceVTable: __x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskInstanceVtbl = .init(
QueryInterface: { IBackgroundTaskInstanceWrapper.queryInterface($0, $1, $2) },
AddRef: { IBackgroundTaskInstanceWrapper.addRef($0) },
Release: { IBackgroundTaskInstanceWrapper.release($0) },
GetIids: {
let size = MemoryLayout<WindowsFoundation.IID>.size
let iids = CoTaskMemAlloc(UInt64(size) * 3).assumingMemoryBound(to: WindowsFoundation.IID.self)
iids[0] = IUnknown.IID
iids[1] = IInspectable.IID
iids[2] = __ABI_Windows_ApplicationModel_Background.IBackgroundTaskInstanceWrapper.IID
$1!.pointee = 3
$2!.pointee = iids
return S_OK
},
GetRuntimeClassName: {
_ = $0
let hstring = try! HString("Windows.ApplicationModel.Background.IBackgroundTaskInstance").detach()
$1!.pointee = hstring
return S_OK
},
GetTrustLevel: {
_ = $0
$1!.pointee = TrustLevel(rawValue: 0)
return S_OK
},
get_InstanceId: {
guard let __unwrapped__instance = IBackgroundTaskInstanceWrapper.tryUnwrapFrom(raw: $0) else { return E_INVALIDARG }
let value = __unwrapped__instance.instanceId
$1?.initialize(to: .init(from: value))
return S_OK
},
get_Task: {
guard let __unwrapped__instance = IBackgroundTaskInstanceWrapper.tryUnwrapFrom(raw: $0) else { return E_INVALIDARG }
let task = __unwrapped__instance.task
task?.copyTo($1)
return S_OK
},
get_Progress: {
guard let __unwrapped__instance = IBackgroundTaskInstanceWrapper.tryUnwrapFrom(raw: $0) else { return E_INVALIDARG }
let value = __unwrapped__instance.progress
$1?.initialize(to: value)
return S_OK
},
put_Progress: {
guard let __unwrapped__instance = IBackgroundTaskInstanceWrapper.tryUnwrapFrom(raw: $0) else { return E_INVALIDARG }
let value: UInt32 = $1
__unwrapped__instance.progress = value
return S_OK
},
get_TriggerDetails: {
guard let __unwrapped__instance = IBackgroundTaskInstanceWrapper.tryUnwrapFrom(raw: $0) else { return E_INVALIDARG }
let triggerDetails = __unwrapped__instance.triggerDetails
let triggerDetailsWrapper = __ABI_.AnyWrapper(triggerDetails)
triggerDetailsWrapper?.copyTo($1)
return S_OK
},
add_Canceled: {
guard let __unwrapped__instance = IBackgroundTaskInstanceWrapper.tryUnwrapFrom(raw: $0) else { return E_INVALIDARG }
guard let cancelHandler = __ABI_Windows_ApplicationModel_Background.BackgroundTaskCanceledEventHandlerWrapper.unwrapFrom(abi: ComPtr($1)) else { return E_INVALIDARG }
let cookie = __unwrapped__instance.canceled.addHandler(cancelHandler)
$2?.initialize(to: .from(swift: cookie))
return S_OK
},
remove_Canceled: {
guard let __unwrapped__instance = IBackgroundTaskInstanceWrapper.tryUnwrapFrom(raw: $0) else { return E_INVALIDARG }
let cookie: EventRegistrationToken = $1
__unwrapped__instance.canceled.removeHandler(cookie)
return S_OK
},
get_SuspendedCount: {
guard let __unwrapped__instance = IBackgroundTaskInstanceWrapper.tryUnwrapFrom(raw: $0) else { return E_INVALIDARG }
let value = __unwrapped__instance.suspendedCount
$1?.initialize(to: value)
return S_OK
},
GetDeferral: {
do {
guard let __unwrapped__instance = IBackgroundTaskInstanceWrapper.tryUnwrapFrom(raw: $0) else { return E_INVALIDARG }
let deferral = try __unwrapped__instance.getDeferral()
deferral?.copyTo($1)
return S_OK
} catch { return failWith(err: E_FAIL) }
}
)
public typealias IBackgroundTaskInstanceWrapper = InterfaceWrapperBase<__IMPL_Windows_ApplicationModel_Background.IBackgroundTaskInstanceBridge>
public class IBackgroundTaskProgressEventArgs: WindowsFoundation.IInspectable {
override public class var IID: WindowsFoundation.IID { IID___x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskProgressEventArgs }
internal func get_InstanceIdImpl() throws -> Foundation.UUID {
var value: WindowsFoundation.GUID = .init()
_ = try perform(as: __x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskProgressEventArgs.self) { pThis in
try CHECKED(pThis.pointee.lpVtbl.pointee.get_InstanceId(pThis, &value))
}
return .init(from: value)
}
internal func get_ProgressImpl() throws -> UInt32 {
var value: UINT32 = 0
_ = try perform(as: __x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskProgressEventArgs.self) { pThis in
try CHECKED(pThis.pointee.lpVtbl.pointee.get_Progress(pThis, &value))
}
return value
}
}
public class IBackgroundTaskRegistration: WindowsFoundation.IInspectable {
override public class var IID: WindowsFoundation.IID { IID___x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskRegistration }
open func get_TaskIdImpl() throws -> Foundation.UUID {
var value: WindowsFoundation.GUID = .init()
_ = try perform(as: __x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskRegistration.self) { pThis in
try CHECKED(pThis.pointee.lpVtbl.pointee.get_TaskId(pThis, &value))
}
return .init(from: value)
}
open func get_NameImpl() throws -> String {
var value: HSTRING?
_ = try perform(as: __x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskRegistration.self) { pThis in
try CHECKED(pThis.pointee.lpVtbl.pointee.get_Name(pThis, &value))
}
return .init(from: value)
}
open func add_ProgressImpl(_ handler: UWP.BackgroundTaskProgressEventHandler?) throws -> EventRegistrationToken {
var cookie: EventRegistrationToken = .init()
let handlerWrapper = __ABI_Windows_ApplicationModel_Background.BackgroundTaskProgressEventHandlerWrapper(handler)
let _handler = try! handlerWrapper?.toABI { $0 }
_ = try perform(as: __x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskRegistration.self) { pThis in
try CHECKED(pThis.pointee.lpVtbl.pointee.add_Progress(pThis, _handler, &cookie))
}
return cookie
}
open func remove_ProgressImpl(_ cookie: EventRegistrationToken) throws {
_ = try perform(as: __x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskRegistration.self) { pThis in
try CHECKED(pThis.pointee.lpVtbl.pointee.remove_Progress(pThis, cookie))
}
}
open func add_CompletedImpl(_ handler: UWP.BackgroundTaskCompletedEventHandler?) throws -> EventRegistrationToken {
var cookie: EventRegistrationToken = .init()
let handlerWrapper = __ABI_Windows_ApplicationModel_Background.BackgroundTaskCompletedEventHandlerWrapper(handler)
let _handler = try! handlerWrapper?.toABI { $0 }
_ = try perform(as: __x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskRegistration.self) { pThis in
try CHECKED(pThis.pointee.lpVtbl.pointee.add_Completed(pThis, _handler, &cookie))
}
return cookie
}
open func remove_CompletedImpl(_ cookie: EventRegistrationToken) throws {
_ = try perform(as: __x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskRegistration.self) { pThis in
try CHECKED(pThis.pointee.lpVtbl.pointee.remove_Completed(pThis, cookie))
}
}
open func UnregisterImpl(_ cancelTask: Bool) throws {
_ = try perform(as: __x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskRegistration.self) { pThis in
try CHECKED(pThis.pointee.lpVtbl.pointee.Unregister(pThis, .init(from: cancelTask)))
}
}
}
internal static var IBackgroundTaskRegistrationVTable: __x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskRegistrationVtbl = .init(
QueryInterface: { IBackgroundTaskRegistrationWrapper.queryInterface($0, $1, $2) },
AddRef: { IBackgroundTaskRegistrationWrapper.addRef($0) },
Release: { IBackgroundTaskRegistrationWrapper.release($0) },
GetIids: {
let size = MemoryLayout<WindowsFoundation.IID>.size
let iids = CoTaskMemAlloc(UInt64(size) * 3).assumingMemoryBound(to: WindowsFoundation.IID.self)
iids[0] = IUnknown.IID
iids[1] = IInspectable.IID
iids[2] = __ABI_Windows_ApplicationModel_Background.IBackgroundTaskRegistrationWrapper.IID
$1!.pointee = 3
$2!.pointee = iids
return S_OK
},
GetRuntimeClassName: {
_ = $0
let hstring = try! HString("Windows.ApplicationModel.Background.IBackgroundTaskRegistration").detach()
$1!.pointee = hstring
return S_OK
},
GetTrustLevel: {
_ = $0
$1!.pointee = TrustLevel(rawValue: 0)
return S_OK
},
get_TaskId: {
guard let __unwrapped__instance = IBackgroundTaskRegistrationWrapper.tryUnwrapFrom(raw: $0) else { return E_INVALIDARG }
let value = __unwrapped__instance.taskId
$1?.initialize(to: .init(from: value))
return S_OK
},
get_Name: {
guard let __unwrapped__instance = IBackgroundTaskRegistrationWrapper.tryUnwrapFrom(raw: $0) else { return E_INVALIDARG }
let value = __unwrapped__instance.name
$1?.initialize(to: try! HString(value).detach())
return S_OK
},
add_Progress: {
guard let __unwrapped__instance = IBackgroundTaskRegistrationWrapper.tryUnwrapFrom(raw: $0) else { return E_INVALIDARG }
guard let handler = __ABI_Windows_ApplicationModel_Background.BackgroundTaskProgressEventHandlerWrapper.unwrapFrom(abi: ComPtr($1)) else { return E_INVALIDARG }
let cookie = __unwrapped__instance.progress.addHandler(handler)
$2?.initialize(to: .from(swift: cookie))
return S_OK
},
remove_Progress: {
guard let __unwrapped__instance = IBackgroundTaskRegistrationWrapper.tryUnwrapFrom(raw: $0) else { return E_INVALIDARG }
let cookie: EventRegistrationToken = $1
__unwrapped__instance.progress.removeHandler(cookie)
return S_OK
},
add_Completed: {
guard let __unwrapped__instance = IBackgroundTaskRegistrationWrapper.tryUnwrapFrom(raw: $0) else { return E_INVALIDARG }
guard let handler = __ABI_Windows_ApplicationModel_Background.BackgroundTaskCompletedEventHandlerWrapper.unwrapFrom(abi: ComPtr($1)) else { return E_INVALIDARG }
let cookie = __unwrapped__instance.completed.addHandler(handler)
$2?.initialize(to: .from(swift: cookie))
return S_OK
},
remove_Completed: {
guard let __unwrapped__instance = IBackgroundTaskRegistrationWrapper.tryUnwrapFrom(raw: $0) else { return E_INVALIDARG }
let cookie: EventRegistrationToken = $1
__unwrapped__instance.completed.removeHandler(cookie)
return S_OK
},
Unregister: {
do {
guard let __unwrapped__instance = IBackgroundTaskRegistrationWrapper.tryUnwrapFrom(raw: $0) else { return E_INVALIDARG }
let cancelTask: Bool = .init(from: $1)
try __unwrapped__instance.unregister(cancelTask)
return S_OK
} catch { return failWith(err: E_FAIL) }
}
)
public typealias IBackgroundTaskRegistrationWrapper = InterfaceWrapperBase<__IMPL_Windows_ApplicationModel_Background.IBackgroundTaskRegistrationBridge>
public class IBackgroundTaskRegistration2: WindowsFoundation.IInspectable {
override public class var IID: WindowsFoundation.IID { IID___x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskRegistration2 }
open func get_TriggerImpl() throws -> UWP.AnyIBackgroundTrigger? {
let (value) = try ComPtrs.initialize { valueAbi in
_ = try perform(as: __x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskRegistration2.self) { pThis in
try CHECKED(pThis.pointee.lpVtbl.pointee.get_Trigger(pThis, &valueAbi))
}
}
return __ABI_Windows_ApplicationModel_Background.IBackgroundTriggerWrapper.unwrapFrom(abi: value)
}
}
internal static var IBackgroundTaskRegistration2VTable: __x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskRegistration2Vtbl = .init(
QueryInterface: { IBackgroundTaskRegistration2Wrapper.queryInterface($0, $1, $2) },
AddRef: { IBackgroundTaskRegistration2Wrapper.addRef($0) },
Release: { IBackgroundTaskRegistration2Wrapper.release($0) },
GetIids: {
let size = MemoryLayout<WindowsFoundation.IID>.size
let iids = CoTaskMemAlloc(UInt64(size) * 4).assumingMemoryBound(to: WindowsFoundation.IID.self)
iids[0] = IUnknown.IID
iids[1] = IInspectable.IID
iids[2] = __ABI_Windows_ApplicationModel_Background.IBackgroundTaskRegistration2Wrapper.IID
iids[3] = __ABI_Windows_ApplicationModel_Background.IBackgroundTaskRegistrationWrapper.IID
$1!.pointee = 4
$2!.pointee = iids
return S_OK
},
GetRuntimeClassName: {
_ = $0
let hstring = try! HString("Windows.ApplicationModel.Background.IBackgroundTaskRegistration2").detach()
$1!.pointee = hstring
return S_OK
},
GetTrustLevel: {
_ = $0
$1!.pointee = TrustLevel(rawValue: 0)
return S_OK
},
get_Trigger: {
guard let __unwrapped__instance = IBackgroundTaskRegistration2Wrapper.tryUnwrapFrom(raw: $0) else { return E_INVALIDARG }
let value = __unwrapped__instance.trigger
let valueWrapper = __ABI_Windows_ApplicationModel_Background.IBackgroundTriggerWrapper(value)
valueWrapper?.copyTo($1)
return S_OK
}
)
public typealias IBackgroundTaskRegistration2Wrapper = InterfaceWrapperBase<__IMPL_Windows_ApplicationModel_Background.IBackgroundTaskRegistration2Bridge>
public class IBackgroundTaskRegistration3: WindowsFoundation.IInspectable {
override public class var IID: WindowsFoundation.IID { IID___x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskRegistration3 }
open func get_TaskGroupImpl() throws -> UWP.BackgroundTaskRegistrationGroup? {
let (value) = try ComPtrs.initialize { valueAbi in
_ = try perform(as: __x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskRegistration3.self) { pThis in
try CHECKED(pThis.pointee.lpVtbl.pointee.get_TaskGroup(pThis, &valueAbi))
}
}
return .from(abi: value)
}
}
internal static var IBackgroundTaskRegistration3VTable: __x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskRegistration3Vtbl = .init(
QueryInterface: { IBackgroundTaskRegistration3Wrapper.queryInterface($0, $1, $2) },
AddRef: { IBackgroundTaskRegistration3Wrapper.addRef($0) },
Release: { IBackgroundTaskRegistration3Wrapper.release($0) },
GetIids: {
let size = MemoryLayout<WindowsFoundation.IID>.size
let iids = CoTaskMemAlloc(UInt64(size) * 4).assumingMemoryBound(to: WindowsFoundation.IID.self)
iids[0] = IUnknown.IID
iids[1] = IInspectable.IID
iids[2] = __ABI_Windows_ApplicationModel_Background.IBackgroundTaskRegistration3Wrapper.IID
iids[3] = __ABI_Windows_ApplicationModel_Background.IBackgroundTaskRegistrationWrapper.IID
$1!.pointee = 4
$2!.pointee = iids
return S_OK
},
GetRuntimeClassName: {
_ = $0
let hstring = try! HString("Windows.ApplicationModel.Background.IBackgroundTaskRegistration3").detach()
$1!.pointee = hstring
return S_OK
},
GetTrustLevel: {
_ = $0
$1!.pointee = TrustLevel(rawValue: 0)
return S_OK
},
get_TaskGroup: {
guard let __unwrapped__instance = IBackgroundTaskRegistration3Wrapper.tryUnwrapFrom(raw: $0) else { return E_INVALIDARG }
let value = __unwrapped__instance.taskGroup
value?.copyTo($1)
return S_OK
}
)
public typealias IBackgroundTaskRegistration3Wrapper = InterfaceWrapperBase<__IMPL_Windows_ApplicationModel_Background.IBackgroundTaskRegistration3Bridge>
public class IBackgroundTaskRegistrationGroup: WindowsFoundation.IInspectable {
override public class var IID: WindowsFoundation.IID { IID___x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskRegistrationGroup }
internal func get_IdImpl() throws -> String {
var value: HSTRING?
_ = try perform(as: __x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskRegistrationGroup.self) { pThis in
try CHECKED(pThis.pointee.lpVtbl.pointee.get_Id(pThis, &value))
}
return .init(from: value)
}
internal func get_NameImpl() throws -> String {
var value: HSTRING?
_ = try perform(as: __x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskRegistrationGroup.self) { pThis in
try CHECKED(pThis.pointee.lpVtbl.pointee.get_Name(pThis, &value))
}
return .init(from: value)
}
internal func add_BackgroundActivatedImpl(_ handler: TypedEventHandler<UWP.BackgroundTaskRegistrationGroup?, UWP.BackgroundActivatedEventArgs?>?) throws -> EventRegistrationToken {
var token: EventRegistrationToken = .init()
let handlerWrapper = UWP.__x_ABI_C__FITypedEventHandler_2___x_ABI_CWindows__CApplicationModel__CBackground__CBackgroundTaskRegistrationGroup___x_ABI_CWindows__CApplicationModel__CActivation__CBackgroundActivatedEventArgsWrapper(handler)
let _handler = try! handlerWrapper?.toABI { $0 }
_ = try perform(as: __x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskRegistrationGroup.self) { pThis in
try CHECKED(pThis.pointee.lpVtbl.pointee.add_BackgroundActivated(pThis, _handler, &token))
}
return token
}
internal func remove_BackgroundActivatedImpl(_ token: EventRegistrationToken) throws {
_ = try perform(as: __x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskRegistrationGroup.self) { pThis in
try CHECKED(pThis.pointee.lpVtbl.pointee.remove_BackgroundActivated(pThis, token))
}
}
internal func get_AllTasksImpl() throws -> WindowsFoundation.AnyIMapView<Foundation.UUID, UWP.BackgroundTaskRegistration?>? {
let (value) = try ComPtrs.initialize { valueAbi in
_ = try perform(as: __x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskRegistrationGroup.self) { pThis in
try CHECKED(pThis.pointee.lpVtbl.pointee.get_AllTasks(pThis, &valueAbi))
}
}
return UWP.__x_ABI_C__FIMapView_2_GUID___x_ABI_CWindows__CApplicationModel__CBackground__CBackgroundTaskRegistrationWrapper.unwrapFrom(abi: value)
}
}
public class IBackgroundTaskRegistrationGroupFactory: WindowsFoundation.IInspectable {
override public class var IID: WindowsFoundation.IID { IID___x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskRegistrationGroupFactory }
internal func CreateImpl(_ id: String) throws -> IBackgroundTaskRegistrationGroup {
let (group) = try ComPtrs.initialize { groupAbi in
let _id = try! HString(id)
_ = try perform(as: __x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskRegistrationGroupFactory.self) { pThis in
try CHECKED(pThis.pointee.lpVtbl.pointee.Create(pThis, _id.get(), &groupAbi))
}
}
return IBackgroundTaskRegistrationGroup(group!)
}
internal func CreateWithNameImpl(_ id: String, _ name: String) throws -> IBackgroundTaskRegistrationGroup {
let (group) = try ComPtrs.initialize { groupAbi in
let _id = try! HString(id)
let _name = try! HString(name)
_ = try perform(as: __x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskRegistrationGroupFactory.self) { pThis in
try CHECKED(pThis.pointee.lpVtbl.pointee.CreateWithName(pThis, _id.get(), _name.get(), &groupAbi))
}
}
return IBackgroundTaskRegistrationGroup(group!)
}
}
public class IBackgroundTaskRegistrationStatics: WindowsFoundation.IInspectable {
override public class var IID: WindowsFoundation.IID { IID___x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskRegistrationStatics }
internal func get_AllTasksImpl() throws -> WindowsFoundation.AnyIMapView<Foundation.UUID, UWP.AnyIBackgroundTaskRegistration?>? {
let (tasks) = try ComPtrs.initialize { tasksAbi in
_ = try perform(as: __x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskRegistrationStatics.self) { pThis in
try CHECKED(pThis.pointee.lpVtbl.pointee.get_AllTasks(pThis, &tasksAbi))
}
}
return UWP.__x_ABI_C__FIMapView_2_GUID___x_ABI_CWindows__CApplicationModel__CBackground__CIBackgroundTaskRegistrationWrapper.unwrapFrom(abi: tasks)
}
}
public class IBackgroundTaskRegistrationStatics2: WindowsFoundation.IInspectable {
override public class var IID: WindowsFoundation.IID { IID___x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskRegistrationStatics2 }
internal func get_AllTaskGroupsImpl() throws -> WindowsFoundation.AnyIMapView<String, UWP.BackgroundTaskRegistrationGroup?>? {
let (value) = try ComPtrs.initialize { valueAbi in
_ = try perform(as: __x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskRegistrationStatics2.self) { pThis in
try CHECKED(pThis.pointee.lpVtbl.pointee.get_AllTaskGroups(pThis, &valueAbi))
}
}
return UWP.__x_ABI_C__FIMapView_2_HSTRING___x_ABI_CWindows__CApplicationModel__CBackground__CBackgroundTaskRegistrationGroupWrapper.unwrapFrom(abi: value)
}
internal func GetTaskGroupImpl(_ groupId: String) throws -> UWP.BackgroundTaskRegistrationGroup? {
let (value) = try ComPtrs.initialize { valueAbi in
let _groupId = try! HString(groupId)
_ = try perform(as: __x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskRegistrationStatics2.self) { pThis in
try CHECKED(pThis.pointee.lpVtbl.pointee.GetTaskGroup(pThis, _groupId.get(), &valueAbi))
}
}
return .from(abi: value)
}
}
public class IBackgroundTrigger: WindowsFoundation.IInspectable {
override public class var IID: WindowsFoundation.IID { IID___x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTrigger }
}
internal static var IBackgroundTriggerVTable: __x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTriggerVtbl = .init(
QueryInterface: { IBackgroundTriggerWrapper.queryInterface($0, $1, $2) },
AddRef: { IBackgroundTriggerWrapper.addRef($0) },
Release: { IBackgroundTriggerWrapper.release($0) },
GetIids: {
let size = MemoryLayout<WindowsFoundation.IID>.size
let iids = CoTaskMemAlloc(UInt64(size) * 3).assumingMemoryBound(to: WindowsFoundation.IID.self)
iids[0] = IUnknown.IID
iids[1] = IInspectable.IID
iids[2] = __ABI_Windows_ApplicationModel_Background.IBackgroundTriggerWrapper.IID
$1!.pointee = 3
$2!.pointee = iids
return S_OK
},
GetRuntimeClassName: {
_ = $0
let hstring = try! HString("Windows.ApplicationModel.Background.IBackgroundTrigger").detach()
$1!.pointee = hstring
return S_OK
},
GetTrustLevel: {
_ = $0
$1!.pointee = TrustLevel(rawValue: 0)
return S_OK
}
)
public typealias IBackgroundTriggerWrapper = InterfaceWrapperBase<__IMPL_Windows_ApplicationModel_Background.IBackgroundTriggerBridge>
public class IDeviceWatcherTrigger: WindowsFoundation.IInspectable {
override public class var IID: WindowsFoundation.IID { IID___x_ABI_CWindows_CApplicationModel_CBackground_CIDeviceWatcherTrigger }
}
}
// MARK - BackgroundTaskCanceledEventHandler
extension __ABI_Windows_ApplicationModel_Background {
public class BackgroundTaskCanceledEventHandler: WindowsFoundation.IUnknown {
override public class var IID: WindowsFoundation.IID { IID___x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskCanceledEventHandler }
open func InvokeImpl(_ sender: UWP.AnyIBackgroundTaskInstance?, _ reason: UWP.BackgroundTaskCancellationReason) throws {
let senderWrapper = __ABI_Windows_ApplicationModel_Background.IBackgroundTaskInstanceWrapper(sender)
let _sender = try! senderWrapper?.toABI { $0 }
_ = try perform(as: __x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskCanceledEventHandler.self) { pThis in
try CHECKED(pThis.pointee.lpVtbl.pointee.Invoke(pThis, _sender, reason))
}
}
}
typealias BackgroundTaskCanceledEventHandlerWrapper = InterfaceWrapperBase<__IMPL_Windows_ApplicationModel_Background.BackgroundTaskCanceledEventHandlerBridge>
internal static var BackgroundTaskCanceledEventHandlerVTable: __x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskCanceledEventHandlerVtbl = .init(
QueryInterface: { BackgroundTaskCanceledEventHandlerWrapper.queryInterface($0, $1, $2) },
AddRef: { BackgroundTaskCanceledEventHandlerWrapper.addRef($0) },
Release: { BackgroundTaskCanceledEventHandlerWrapper.release($0) },
Invoke: {
guard let __unwrapped__instance = BackgroundTaskCanceledEventHandlerWrapper.tryUnwrapFrom(raw: $0) else { return E_INVALIDARG }
let sender: UWP.AnyIBackgroundTaskInstance? = __ABI_Windows_ApplicationModel_Background.IBackgroundTaskInstanceWrapper.unwrapFrom(abi: ComPtr($1))
let reason: UWP.BackgroundTaskCancellationReason = $2
__unwrapped__instance(sender, reason)
return S_OK
}
)
}
public extension WinRTDelegateBridge where CABI == __x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskCanceledEventHandler {
static func makeAbi() -> CABI {
let vtblPtr = withUnsafeMutablePointer(to: &__ABI_Windows_ApplicationModel_Background.BackgroundTaskCanceledEventHandlerVTable) { $0 }
return .init(lpVtbl:vtblPtr)
}
}
// MARK - BackgroundTaskCompletedEventHandler
extension __ABI_Windows_ApplicationModel_Background {
public class BackgroundTaskCompletedEventHandler: WindowsFoundation.IUnknown {
override public class var IID: WindowsFoundation.IID { IID___x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskCompletedEventHandler }
open func InvokeImpl(_ sender: UWP.BackgroundTaskRegistration?, _ args: UWP.BackgroundTaskCompletedEventArgs?) throws {
_ = try perform(as: __x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskCompletedEventHandler.self) { pThis in
try CHECKED(pThis.pointee.lpVtbl.pointee.Invoke(pThis, RawPointer(sender), RawPointer(args)))
}
}
}
typealias BackgroundTaskCompletedEventHandlerWrapper = InterfaceWrapperBase<__IMPL_Windows_ApplicationModel_Background.BackgroundTaskCompletedEventHandlerBridge>
internal static var BackgroundTaskCompletedEventHandlerVTable: __x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskCompletedEventHandlerVtbl = .init(
QueryInterface: { BackgroundTaskCompletedEventHandlerWrapper.queryInterface($0, $1, $2) },
AddRef: { BackgroundTaskCompletedEventHandlerWrapper.addRef($0) },
Release: { BackgroundTaskCompletedEventHandlerWrapper.release($0) },
Invoke: {
guard let __unwrapped__instance = BackgroundTaskCompletedEventHandlerWrapper.tryUnwrapFrom(raw: $0) else { return E_INVALIDARG }
let sender: UWP.BackgroundTaskRegistration? = .from(abi: ComPtr($1))
let args: UWP.BackgroundTaskCompletedEventArgs? = .from(abi: ComPtr($2))
__unwrapped__instance(sender, args)
return S_OK
}
)
}
public extension WinRTDelegateBridge where CABI == __x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskCompletedEventHandler {
static func makeAbi() -> CABI {
let vtblPtr = withUnsafeMutablePointer(to: &__ABI_Windows_ApplicationModel_Background.BackgroundTaskCompletedEventHandlerVTable) { $0 }
return .init(lpVtbl:vtblPtr)
}
}
// MARK - BackgroundTaskProgressEventHandler
extension __ABI_Windows_ApplicationModel_Background {
public class BackgroundTaskProgressEventHandler: WindowsFoundation.IUnknown {
override public class var IID: WindowsFoundation.IID { IID___x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskProgressEventHandler }
open func InvokeImpl(_ sender: UWP.BackgroundTaskRegistration?, _ args: UWP.BackgroundTaskProgressEventArgs?) throws {
_ = try perform(as: __x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskProgressEventHandler.self) { pThis in
try CHECKED(pThis.pointee.lpVtbl.pointee.Invoke(pThis, RawPointer(sender), RawPointer(args)))
}
}
}
typealias BackgroundTaskProgressEventHandlerWrapper = InterfaceWrapperBase<__IMPL_Windows_ApplicationModel_Background.BackgroundTaskProgressEventHandlerBridge>
internal static var BackgroundTaskProgressEventHandlerVTable: __x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskProgressEventHandlerVtbl = .init(
QueryInterface: { BackgroundTaskProgressEventHandlerWrapper.queryInterface($0, $1, $2) },
AddRef: { BackgroundTaskProgressEventHandlerWrapper.addRef($0) },
Release: { BackgroundTaskProgressEventHandlerWrapper.release($0) },
Invoke: {
guard let __unwrapped__instance = BackgroundTaskProgressEventHandlerWrapper.tryUnwrapFrom(raw: $0) else { return E_INVALIDARG }
let sender: UWP.BackgroundTaskRegistration? = .from(abi: ComPtr($1))
let args: UWP.BackgroundTaskProgressEventArgs? = .from(abi: ComPtr($2))
__unwrapped__instance(sender, args)
return S_OK
}
)
}
public extension WinRTDelegateBridge where CABI == __x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskProgressEventHandler {
static func makeAbi() -> CABI {
let vtblPtr = withUnsafeMutablePointer(to: &__ABI_Windows_ApplicationModel_Background.BackgroundTaskProgressEventHandlerVTable) { $0 }
return .init(lpVtbl:vtblPtr)
}
}