79 lines
3.2 KiB
Swift
79 lines
3.2 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
|
|
|
|
public enum __IMPL_Microsoft_UI {
|
|
public enum IClosableNotifierBridge : AbiInterfaceBridge {
|
|
public typealias CABI = __x_ABI_CMicrosoft_CUI_CIClosableNotifier
|
|
public typealias SwiftABI = __ABI_Microsoft_UI.IClosableNotifier
|
|
public typealias SwiftProjection = AnyIClosableNotifier
|
|
public static func from(abi: ComPtr<CABI>?) -> SwiftProjection? {
|
|
guard let abi = abi else { return nil }
|
|
return IClosableNotifierImpl(abi)
|
|
}
|
|
|
|
public static func makeAbi() -> CABI {
|
|
let vtblPtr = withUnsafeMutablePointer(to: &__ABI_Microsoft_UI.IClosableNotifierVTable) { $0 }
|
|
return .init(lpVtbl: vtblPtr)
|
|
}
|
|
}
|
|
|
|
fileprivate class IClosableNotifierImpl: IClosableNotifier, WinRTAbiImpl {
|
|
fileprivate typealias Bridge = IClosableNotifierBridge
|
|
fileprivate let _default: Bridge.SwiftABI
|
|
fileprivate var thisPtr: WindowsFoundation.IInspectable { _default }
|
|
fileprivate init(_ fromAbi: ComPtr<Bridge.CABI>) {
|
|
_default = Bridge.SwiftABI(fromAbi)
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/windows/windows-app-sdk/api/winrt/microsoft.ui.iclosablenotifier.isclosed)
|
|
fileprivate var isClosed : Bool {
|
|
get { try! _default.get_IsClosedImpl() }
|
|
}
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/windows/windows-app-sdk/api/winrt/microsoft.ui.iclosablenotifier.closed)
|
|
fileprivate lazy var closed : Event<ClosableNotifierHandler> = {
|
|
.init(
|
|
add: { [weak self] in
|
|
guard let this = self?._default else { return .init() }
|
|
return try! this.add_ClosedImpl($0)
|
|
},
|
|
remove: { [weak self] in
|
|
try? self?._default.remove_ClosedImpl($0)
|
|
}
|
|
)
|
|
}()
|
|
|
|
/// [Open Microsoft documentation](https://learn.microsoft.com/windows/windows-app-sdk/api/winrt/microsoft.ui.iclosablenotifier.frameworkclosed)
|
|
fileprivate lazy var frameworkClosed : Event<ClosableNotifierHandler> = {
|
|
.init(
|
|
add: { [weak self] in
|
|
guard let this = self?._default else { return .init() }
|
|
return try! this.add_FrameworkClosedImpl($0)
|
|
},
|
|
remove: { [weak self] in
|
|
try? self?._default.remove_FrameworkClosedImpl($0)
|
|
}
|
|
)
|
|
}()
|
|
|
|
}
|
|
|
|
public class ClosableNotifierHandlerBridge : WinRTDelegateBridge {
|
|
public typealias Handler = ClosableNotifierHandler
|
|
public typealias CABI = __x_ABI_CMicrosoft_CUI_CIClosableNotifierHandler
|
|
public typealias SwiftABI = __ABI_Microsoft_UI.ClosableNotifierHandler
|
|
|
|
public static func from(abi: ComPtr<CABI>?) -> Handler? {
|
|
guard let abi = abi else { return nil }
|
|
let _default = SwiftABI(abi)
|
|
let handler: Handler = { () in
|
|
try! _default.InvokeImpl()
|
|
}
|
|
return handler
|
|
}
|
|
}
|
|
}
|