// 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 public enum __IMPL_Windows_ApplicationModel_Background { public enum IBackgroundTaskInstanceBridge : AbiInterfaceBridge { public typealias CABI = __x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskInstance public typealias SwiftABI = __ABI_Windows_ApplicationModel_Background.IBackgroundTaskInstance public typealias SwiftProjection = AnyIBackgroundTaskInstance public static func from(abi: ComPtr?) -> SwiftProjection? { guard let abi = abi else { return nil } return IBackgroundTaskInstanceImpl(abi) } public static func makeAbi() -> CABI { let vtblPtr = withUnsafeMutablePointer(to: &__ABI_Windows_ApplicationModel_Background.IBackgroundTaskInstanceVTable) { $0 } return .init(lpVtbl: vtblPtr) } } fileprivate class IBackgroundTaskInstanceImpl: IBackgroundTaskInstance, WinRTAbiImpl { fileprivate typealias Bridge = IBackgroundTaskInstanceBridge fileprivate let _default: Bridge.SwiftABI fileprivate var thisPtr: WindowsFoundation.IInspectable { _default } fileprivate init(_ fromAbi: ComPtr) { _default = Bridge.SwiftABI(fromAbi) } /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.applicationmodel.background.ibackgroundtaskinstance.getdeferral) fileprivate func getDeferral() throws -> BackgroundTaskDeferral! { try _default.GetDeferralImpl() } /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.applicationmodel.background.ibackgroundtaskinstance.instanceid) fileprivate var instanceId : Foundation.UUID { get { try! _default.get_InstanceIdImpl() } } /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.applicationmodel.background.ibackgroundtaskinstance.progress) fileprivate var progress : UInt32 { get { try! _default.get_ProgressImpl() } set { try! _default.put_ProgressImpl(newValue) } } /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.applicationmodel.background.ibackgroundtaskinstance.suspendedcount) fileprivate var suspendedCount : UInt32 { get { try! _default.get_SuspendedCountImpl() } } /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.applicationmodel.background.ibackgroundtaskinstance.task) fileprivate var task : BackgroundTaskRegistration! { get { try! _default.get_TaskImpl() } } /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.applicationmodel.background.ibackgroundtaskinstance.triggerdetails) fileprivate var triggerDetails : Any! { get { try! _default.get_TriggerDetailsImpl() } } /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.applicationmodel.background.ibackgroundtaskinstance.canceled) fileprivate lazy var canceled : Event = { .init( add: { [weak self] in guard let this = self?._default else { return .init() } return try! this.add_CanceledImpl($0) }, remove: { [weak self] in try? self?._default.remove_CanceledImpl($0) } ) }() } public enum IBackgroundTaskRegistrationBridge : AbiInterfaceBridge { public typealias CABI = __x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskRegistration public typealias SwiftABI = __ABI_Windows_ApplicationModel_Background.IBackgroundTaskRegistration public typealias SwiftProjection = AnyIBackgroundTaskRegistration public static func from(abi: ComPtr?) -> SwiftProjection? { guard let abi = abi else { return nil } return IBackgroundTaskRegistrationImpl(abi) } public static func makeAbi() -> CABI { let vtblPtr = withUnsafeMutablePointer(to: &__ABI_Windows_ApplicationModel_Background.IBackgroundTaskRegistrationVTable) { $0 } return .init(lpVtbl: vtblPtr) } } fileprivate class IBackgroundTaskRegistrationImpl: IBackgroundTaskRegistration, WinRTAbiImpl { fileprivate typealias Bridge = IBackgroundTaskRegistrationBridge fileprivate let _default: Bridge.SwiftABI fileprivate var thisPtr: WindowsFoundation.IInspectable { _default } fileprivate init(_ fromAbi: ComPtr) { _default = Bridge.SwiftABI(fromAbi) } /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.applicationmodel.background.ibackgroundtaskregistration.unregister) fileprivate func unregister(_ cancelTask: Bool) throws { try _default.UnregisterImpl(cancelTask) } /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.applicationmodel.background.ibackgroundtaskregistration.name) fileprivate var name : String { get { try! _default.get_NameImpl() } } /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.applicationmodel.background.ibackgroundtaskregistration.taskid) fileprivate var taskId : Foundation.UUID { get { try! _default.get_TaskIdImpl() } } /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.applicationmodel.background.ibackgroundtaskregistration.completed) fileprivate lazy var completed : Event = { .init( add: { [weak self] in guard let this = self?._default else { return .init() } return try! this.add_CompletedImpl($0) }, remove: { [weak self] in try? self?._default.remove_CompletedImpl($0) } ) }() /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.applicationmodel.background.ibackgroundtaskregistration.progress) fileprivate lazy var progress : Event = { .init( add: { [weak self] in guard let this = self?._default else { return .init() } return try! this.add_ProgressImpl($0) }, remove: { [weak self] in try? self?._default.remove_ProgressImpl($0) } ) }() } public enum IBackgroundTaskRegistration2Bridge : AbiInterfaceBridge { public typealias CABI = __x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskRegistration2 public typealias SwiftABI = __ABI_Windows_ApplicationModel_Background.IBackgroundTaskRegistration2 public typealias SwiftProjection = AnyIBackgroundTaskRegistration2 public static func from(abi: ComPtr?) -> SwiftProjection? { guard let abi = abi else { return nil } return IBackgroundTaskRegistration2Impl(abi) } public static func makeAbi() -> CABI { let vtblPtr = withUnsafeMutablePointer(to: &__ABI_Windows_ApplicationModel_Background.IBackgroundTaskRegistration2VTable) { $0 } return .init(lpVtbl: vtblPtr) } } fileprivate class IBackgroundTaskRegistration2Impl: IBackgroundTaskRegistration2, WinRTAbiImpl { fileprivate typealias Bridge = IBackgroundTaskRegistration2Bridge fileprivate let _default: Bridge.SwiftABI fileprivate var thisPtr: WindowsFoundation.IInspectable { _default } fileprivate init(_ fromAbi: ComPtr) { _default = Bridge.SwiftABI(fromAbi) } /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.applicationmodel.background.ibackgroundtaskregistration2.trigger) fileprivate var trigger : AnyIBackgroundTrigger! { get { try! _default.get_TriggerImpl() } } private lazy var _IBackgroundTaskRegistration: __ABI_Windows_ApplicationModel_Background.IBackgroundTaskRegistration! = getInterfaceForCaching() /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.applicationmodel.background.ibackgroundtaskregistration2.unregister) fileprivate func unregister(_ cancelTask: Bool) throws { try _IBackgroundTaskRegistration.UnregisterImpl(cancelTask) } /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.applicationmodel.background.ibackgroundtaskregistration2.name) fileprivate var name : String { get { try! _IBackgroundTaskRegistration.get_NameImpl() } } /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.applicationmodel.background.ibackgroundtaskregistration2.taskid) fileprivate var taskId : Foundation.UUID { get { try! _IBackgroundTaskRegistration.get_TaskIdImpl() } } /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.applicationmodel.background.ibackgroundtaskregistration2.completed) fileprivate lazy var completed : Event = { .init( add: { [weak self] in guard let this = self?._IBackgroundTaskRegistration else { return .init() } return try! this.add_CompletedImpl($0) }, remove: { [weak self] in try? self?._IBackgroundTaskRegistration.remove_CompletedImpl($0) } ) }() /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.applicationmodel.background.ibackgroundtaskregistration2.progress) fileprivate lazy var progress : Event = { .init( add: { [weak self] in guard let this = self?._IBackgroundTaskRegistration else { return .init() } return try! this.add_ProgressImpl($0) }, remove: { [weak self] in try? self?._IBackgroundTaskRegistration.remove_ProgressImpl($0) } ) }() } public enum IBackgroundTaskRegistration3Bridge : AbiInterfaceBridge { public typealias CABI = __x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskRegistration3 public typealias SwiftABI = __ABI_Windows_ApplicationModel_Background.IBackgroundTaskRegistration3 public typealias SwiftProjection = AnyIBackgroundTaskRegistration3 public static func from(abi: ComPtr?) -> SwiftProjection? { guard let abi = abi else { return nil } return IBackgroundTaskRegistration3Impl(abi) } public static func makeAbi() -> CABI { let vtblPtr = withUnsafeMutablePointer(to: &__ABI_Windows_ApplicationModel_Background.IBackgroundTaskRegistration3VTable) { $0 } return .init(lpVtbl: vtblPtr) } } fileprivate class IBackgroundTaskRegistration3Impl: IBackgroundTaskRegistration3, WinRTAbiImpl { fileprivate typealias Bridge = IBackgroundTaskRegistration3Bridge fileprivate let _default: Bridge.SwiftABI fileprivate var thisPtr: WindowsFoundation.IInspectable { _default } fileprivate init(_ fromAbi: ComPtr) { _default = Bridge.SwiftABI(fromAbi) } /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.applicationmodel.background.ibackgroundtaskregistration3.taskgroup) fileprivate var taskGroup : BackgroundTaskRegistrationGroup! { get { try! _default.get_TaskGroupImpl() } } private lazy var _IBackgroundTaskRegistration: __ABI_Windows_ApplicationModel_Background.IBackgroundTaskRegistration! = getInterfaceForCaching() /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.applicationmodel.background.ibackgroundtaskregistration3.unregister) fileprivate func unregister(_ cancelTask: Bool) throws { try _IBackgroundTaskRegistration.UnregisterImpl(cancelTask) } /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.applicationmodel.background.ibackgroundtaskregistration3.name) fileprivate var name : String { get { try! _IBackgroundTaskRegistration.get_NameImpl() } } /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.applicationmodel.background.ibackgroundtaskregistration3.taskid) fileprivate var taskId : Foundation.UUID { get { try! _IBackgroundTaskRegistration.get_TaskIdImpl() } } /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.applicationmodel.background.ibackgroundtaskregistration3.completed) fileprivate lazy var completed : Event = { .init( add: { [weak self] in guard let this = self?._IBackgroundTaskRegistration else { return .init() } return try! this.add_CompletedImpl($0) }, remove: { [weak self] in try? self?._IBackgroundTaskRegistration.remove_CompletedImpl($0) } ) }() /// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.applicationmodel.background.ibackgroundtaskregistration3.progress) fileprivate lazy var progress : Event = { .init( add: { [weak self] in guard let this = self?._IBackgroundTaskRegistration else { return .init() } return try! this.add_ProgressImpl($0) }, remove: { [weak self] in try? self?._IBackgroundTaskRegistration.remove_ProgressImpl($0) } ) }() } public enum IBackgroundTriggerBridge : AbiInterfaceBridge { public typealias CABI = __x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTrigger public typealias SwiftABI = __ABI_Windows_ApplicationModel_Background.IBackgroundTrigger public typealias SwiftProjection = AnyIBackgroundTrigger public static func from(abi: ComPtr?) -> SwiftProjection? { guard let abi = abi else { return nil } return IBackgroundTriggerImpl(abi) } public static func makeAbi() -> CABI { let vtblPtr = withUnsafeMutablePointer(to: &__ABI_Windows_ApplicationModel_Background.IBackgroundTriggerVTable) { $0 } return .init(lpVtbl: vtblPtr) } } fileprivate class IBackgroundTriggerImpl: IBackgroundTrigger, WinRTAbiImpl { fileprivate typealias Bridge = IBackgroundTriggerBridge fileprivate let _default: Bridge.SwiftABI fileprivate var thisPtr: WindowsFoundation.IInspectable { _default } fileprivate init(_ fromAbi: ComPtr) { _default = Bridge.SwiftABI(fromAbi) } } public class BackgroundTaskCanceledEventHandlerBridge : WinRTDelegateBridge { public typealias Handler = BackgroundTaskCanceledEventHandler public typealias CABI = __x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskCanceledEventHandler public typealias SwiftABI = __ABI_Windows_ApplicationModel_Background.BackgroundTaskCanceledEventHandler public static func from(abi: ComPtr?) -> Handler? { guard let abi = abi else { return nil } let _default = SwiftABI(abi) let handler: Handler = { (sender, reason) in try! _default.InvokeImpl(sender, reason) } return handler } } public class BackgroundTaskCompletedEventHandlerBridge : WinRTDelegateBridge { public typealias Handler = BackgroundTaskCompletedEventHandler public typealias CABI = __x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskCompletedEventHandler public typealias SwiftABI = __ABI_Windows_ApplicationModel_Background.BackgroundTaskCompletedEventHandler public 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 } } public class BackgroundTaskProgressEventHandlerBridge : WinRTDelegateBridge { public typealias Handler = BackgroundTaskProgressEventHandler public typealias CABI = __x_ABI_CWindows_CApplicationModel_CBackground_CIBackgroundTaskProgressEventHandler public typealias SwiftABI = __ABI_Windows_ApplicationModel_Background.BackgroundTaskProgressEventHandler public 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 } } }