swift-windowsappsdk/Sources/WinAppSDK/Microsoft.Windows.AppLifecycle+ABI.swift
2024-02-13 23:50:08 -08:00

206 lines
11 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 UWP
@_spi(WinRTInternal) @_spi(WinRTImplements) import WindowsFoundation
import CWinRT
private var IID___x_ABI_CMicrosoft_CWindows_CAppLifecycle_CIActivationRegistrationManagerStatics: WindowsFoundation.IID {
.init(Data1: 0x5AC4E92E, Data2: 0x017B, Data3: 0x5D68, Data4: ( 0x81,0x98,0xF6,0x86,0x36,0xAB,0x99,0xD3 ))// 5AC4E92E-017B-5D68-8198-F68636AB99D3
}
private var IID___x_ABI_CMicrosoft_CWindows_CAppLifecycle_CIAppActivationArguments: WindowsFoundation.IID {
.init(Data1: 0x14F99EAF, Data2: 0x1580, Data3: 0x5062, Data4: ( 0xBD,0xC8,0xD5,0xD1,0xC3,0x11,0x38,0xFB ))// 14F99EAF-1580-5062-BDC8-D5D1C31138FB
}
private var IID___x_ABI_CMicrosoft_CWindows_CAppLifecycle_CIAppInstance: WindowsFoundation.IID {
.init(Data1: 0x75766AE4, Data2: 0x0239, Data3: 0x5A26, Data4: ( 0xB9,0xDA,0xD5,0xBF,0xC7,0x5A,0x48,0x66 ))// 75766AE4-0239-5A26-B9DA-D5BFC75A4866
}
private var IID___x_ABI_CMicrosoft_CWindows_CAppLifecycle_CIAppInstanceStatics: WindowsFoundation.IID {
.init(Data1: 0x4F414B25, Data2: 0x8330, Data3: 0x5A9B, Data4: ( 0xBB,0xC1,0x82,0x29,0xD4,0x79,0x64,0x9D ))// 4F414B25-8330-5A9B-BBC1-8229D479649D
}
private var IID___x_ABI_CMicrosoft_CWindows_CAppLifecycle_CIAppInstanceStatics2: WindowsFoundation.IID {
.init(Data1: 0xFE9F1885, Data2: 0x7160, Data3: 0x5397, Data4: ( 0xBA,0x9B,0x58,0x90,0xB2,0x4F,0xDC,0x04 ))// FE9F1885-7160-5397-BA9B-5890B24FDC04
}
public enum __ABI_Microsoft_Windows_AppLifecycle {
public class IActivationRegistrationManagerStatics: WindowsFoundation.IInspectable {
override public class var IID: WindowsFoundation.IID { IID___x_ABI_CMicrosoft_CWindows_CAppLifecycle_CIActivationRegistrationManagerStatics }
internal func RegisterForProtocolActivationImpl(_ scheme: String, _ logo: String, _ displayName: String, _ exePath: String) throws {
let _scheme = try! HString(scheme)
let _logo = try! HString(logo)
let _displayName = try! HString(displayName)
let _exePath = try! HString(exePath)
_ = try perform(as: __x_ABI_CMicrosoft_CWindows_CAppLifecycle_CIActivationRegistrationManagerStatics.self) { pThis in
try CHECKED(pThis.pointee.lpVtbl.pointee.RegisterForProtocolActivation(pThis, _scheme.get(), _logo.get(), _displayName.get(), _exePath.get()))
}
}
internal func RegisterForStartupActivationImpl(_ taskId: String, _ exePath: String) throws {
let _taskId = try! HString(taskId)
let _exePath = try! HString(exePath)
_ = try perform(as: __x_ABI_CMicrosoft_CWindows_CAppLifecycle_CIActivationRegistrationManagerStatics.self) { pThis in
try CHECKED(pThis.pointee.lpVtbl.pointee.RegisterForStartupActivation(pThis, _taskId.get(), _exePath.get()))
}
}
internal func UnregisterForProtocolActivationImpl(_ scheme: String, _ exePath: String) throws {
let _scheme = try! HString(scheme)
let _exePath = try! HString(exePath)
_ = try perform(as: __x_ABI_CMicrosoft_CWindows_CAppLifecycle_CIActivationRegistrationManagerStatics.self) { pThis in
try CHECKED(pThis.pointee.lpVtbl.pointee.UnregisterForProtocolActivation(pThis, _scheme.get(), _exePath.get()))
}
}
internal func UnregisterForStartupActivationImpl(_ taskId: String) throws {
let _taskId = try! HString(taskId)
_ = try perform(as: __x_ABI_CMicrosoft_CWindows_CAppLifecycle_CIActivationRegistrationManagerStatics.self) { pThis in
try CHECKED(pThis.pointee.lpVtbl.pointee.UnregisterForStartupActivation(pThis, _taskId.get()))
}
}
}
public class IAppActivationArguments: WindowsFoundation.IInspectable {
override public class var IID: WindowsFoundation.IID { IID___x_ABI_CMicrosoft_CWindows_CAppLifecycle_CIAppActivationArguments }
internal func get_KindImpl() throws -> WinAppSDK.ExtendedActivationKind {
var value: __x_ABI_CMicrosoft_CWindows_CAppLifecycle_CExtendedActivationKind = .init(0)
_ = try perform(as: __x_ABI_CMicrosoft_CWindows_CAppLifecycle_CIAppActivationArguments.self) { pThis in
try CHECKED(pThis.pointee.lpVtbl.pointee.get_Kind(pThis, &value))
}
return value
}
internal func get_DataImpl() throws -> Any? {
let (value) = try ComPtrs.initialize { valueAbi in
_ = try perform(as: __x_ABI_CMicrosoft_CWindows_CAppLifecycle_CIAppActivationArguments.self) { pThis in
try CHECKED(pThis.pointee.lpVtbl.pointee.get_Data(pThis, &valueAbi))
}
}
return __ABI_.AnyWrapper.unwrapFrom(abi: value)
}
}
public class IAppInstance: WindowsFoundation.IInspectable {
override public class var IID: WindowsFoundation.IID { IID___x_ABI_CMicrosoft_CWindows_CAppLifecycle_CIAppInstance }
internal func UnregisterKeyImpl() throws {
_ = try perform(as: __x_ABI_CMicrosoft_CWindows_CAppLifecycle_CIAppInstance.self) { pThis in
try CHECKED(pThis.pointee.lpVtbl.pointee.UnregisterKey(pThis))
}
}
internal func RedirectActivationToAsyncImpl(_ args: WinAppSDK.AppActivationArguments?) throws -> WindowsFoundation.AnyIAsyncAction? {
let (operation) = try ComPtrs.initialize { operationAbi in
_ = try perform(as: __x_ABI_CMicrosoft_CWindows_CAppLifecycle_CIAppInstance.self) { pThis in
try CHECKED(pThis.pointee.lpVtbl.pointee.RedirectActivationToAsync(pThis, RawPointer(args), &operationAbi))
}
}
return __ABI_Windows_Foundation.IAsyncActionWrapper.unwrapFrom(abi: operation)
}
internal func GetActivatedEventArgsImpl() throws -> WinAppSDK.AppActivationArguments? {
let (result) = try ComPtrs.initialize { resultAbi in
_ = try perform(as: __x_ABI_CMicrosoft_CWindows_CAppLifecycle_CIAppInstance.self) { pThis in
try CHECKED(pThis.pointee.lpVtbl.pointee.GetActivatedEventArgs(pThis, &resultAbi))
}
}
return .from(abi: result)
}
internal func add_ActivatedImpl(_ handler: EventHandler<WinAppSDK.AppActivationArguments?>?) throws -> EventRegistrationToken {
var token: EventRegistrationToken = .init()
let handlerWrapper = WinAppSDK.__x_ABI_C__FIEventHandler_1___x_ABI_CMicrosoft__CWindows__CAppLifecycle__CAppActivationArgumentsWrapper(handler)
let _handler = try! handlerWrapper?.toABI { $0 }
_ = try perform(as: __x_ABI_CMicrosoft_CWindows_CAppLifecycle_CIAppInstance.self) { pThis in
try CHECKED(pThis.pointee.lpVtbl.pointee.add_Activated(pThis, _handler, &token))
}
return token
}
internal func remove_ActivatedImpl(_ token: EventRegistrationToken) throws {
_ = try perform(as: __x_ABI_CMicrosoft_CWindows_CAppLifecycle_CIAppInstance.self) { pThis in
try CHECKED(pThis.pointee.lpVtbl.pointee.remove_Activated(pThis, token))
}
}
internal func get_KeyImpl() throws -> String {
var value: HSTRING?
_ = try perform(as: __x_ABI_CMicrosoft_CWindows_CAppLifecycle_CIAppInstance.self) { pThis in
try CHECKED(pThis.pointee.lpVtbl.pointee.get_Key(pThis, &value))
}
return .init(from: value)
}
internal func get_IsCurrentImpl() throws -> Bool {
var value: boolean = 0
_ = try perform(as: __x_ABI_CMicrosoft_CWindows_CAppLifecycle_CIAppInstance.self) { pThis in
try CHECKED(pThis.pointee.lpVtbl.pointee.get_IsCurrent(pThis, &value))
}
return .init(from: value)
}
internal func get_ProcessIdImpl() throws -> UInt32 {
var value: UINT32 = 0
_ = try perform(as: __x_ABI_CMicrosoft_CWindows_CAppLifecycle_CIAppInstance.self) { pThis in
try CHECKED(pThis.pointee.lpVtbl.pointee.get_ProcessId(pThis, &value))
}
return value
}
}
public class IAppInstanceStatics: WindowsFoundation.IInspectable {
override public class var IID: WindowsFoundation.IID { IID___x_ABI_CMicrosoft_CWindows_CAppLifecycle_CIAppInstanceStatics }
internal func GetCurrentImpl() throws -> WinAppSDK.AppInstance? {
let (result) = try ComPtrs.initialize { resultAbi in
_ = try perform(as: __x_ABI_CMicrosoft_CWindows_CAppLifecycle_CIAppInstanceStatics.self) { pThis in
try CHECKED(pThis.pointee.lpVtbl.pointee.GetCurrent(pThis, &resultAbi))
}
}
return .from(abi: result)
}
internal func GetInstancesImpl() throws -> WindowsFoundation.AnyIVector<WinAppSDK.AppInstance?>? {
let (result) = try ComPtrs.initialize { resultAbi in
_ = try perform(as: __x_ABI_CMicrosoft_CWindows_CAppLifecycle_CIAppInstanceStatics.self) { pThis in
try CHECKED(pThis.pointee.lpVtbl.pointee.GetInstances(pThis, &resultAbi))
}
}
return WinAppSDK.__x_ABI_C__FIVector_1___x_ABI_CMicrosoft__CWindows__CAppLifecycle__CAppInstanceWrapper.unwrapFrom(abi: result)
}
internal func FindOrRegisterForKeyImpl(_ key: String) throws -> WinAppSDK.AppInstance? {
let (result) = try ComPtrs.initialize { resultAbi in
let _key = try! HString(key)
_ = try perform(as: __x_ABI_CMicrosoft_CWindows_CAppLifecycle_CIAppInstanceStatics.self) { pThis in
try CHECKED(pThis.pointee.lpVtbl.pointee.FindOrRegisterForKey(pThis, _key.get(), &resultAbi))
}
}
return .from(abi: result)
}
}
public class IAppInstanceStatics2: WindowsFoundation.IInspectable {
override public class var IID: WindowsFoundation.IID { IID___x_ABI_CMicrosoft_CWindows_CAppLifecycle_CIAppInstanceStatics2 }
internal func RestartImpl(_ arguments: String) throws -> UWP.AppRestartFailureReason {
var result: __x_ABI_CWindows_CApplicationModel_CCore_CAppRestartFailureReason = .init(0)
let _arguments = try! HString(arguments)
_ = try perform(as: __x_ABI_CMicrosoft_CWindows_CAppLifecycle_CIAppInstanceStatics2.self) { pThis in
try CHECKED(pThis.pointee.lpVtbl.pointee.Restart(pThis, _arguments.get(), &result))
}
return result
}
}
}