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

431 lines
19 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
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.applicationmodel.core.apprestartfailurereason)
public typealias AppRestartFailureReason = __x_ABI_CWindows_CApplicationModel_CCore_CAppRestartFailureReason
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.applicationmodel.core.applistentry)
public final class AppListEntry : WinRTClass {
private typealias SwiftABI = __ABI_Windows_ApplicationModel_Core.IAppListEntry
private typealias CABI = __x_ABI_CWindows_CApplicationModel_CCore_CIAppListEntry
private lazy var _default: SwiftABI! = getInterfaceForCaching()
@_spi(WinRTInternal)
override public func _getABI<T>() -> UnsafeMutablePointer<T>? {
if T.self == CABI.self {
return RawPointer(_default)
}
return super._getABI()
}
@_spi(WinRTInternal)
public static func from(abi: ComPtr<__x_ABI_CWindows_CApplicationModel_CCore_CIAppListEntry>?) -> AppListEntry? {
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.applicationmodel.core.applistentry.launchasync)
public func launchAsync() throws -> WindowsFoundation.AnyIAsyncOperation<Bool>! {
try _default.LaunchAsyncImpl()
}
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.applicationmodel.core.applistentry.displayinfo)
public var displayInfo : UWP.AppDisplayInfo! {
get { try! _default.get_DisplayInfoImpl() }
}
private lazy var _IAppListEntry2: __ABI_Windows_ApplicationModel_Core.IAppListEntry2! = getInterfaceForCaching()
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.applicationmodel.core.applistentry.appusermodelid)
public var appUserModelId : String {
get { try! _IAppListEntry2.get_AppUserModelIdImpl() }
}
private lazy var _IAppListEntry3: __ABI_Windows_ApplicationModel_Core.IAppListEntry3! = getInterfaceForCaching()
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.applicationmodel.core.applistentry.launchforuserasync)
public func launchForUserAsync(_ user: UWP.User!) throws -> WindowsFoundation.AnyIAsyncOperation<Bool>! {
try _IAppListEntry3.LaunchForUserAsyncImpl(user)
}
deinit {
_default = nil
_IAppListEntry2 = nil
_IAppListEntry3 = nil
}
}
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.applicationmodel.core.coreapplicationview)
public final class CoreApplicationView : WinRTClass {
private typealias SwiftABI = __ABI_Windows_ApplicationModel_Core.ICoreApplicationView
private typealias CABI = __x_ABI_CWindows_CApplicationModel_CCore_CICoreApplicationView
private lazy var _default: SwiftABI! = getInterfaceForCaching()
@_spi(WinRTInternal)
override public func _getABI<T>() -> UnsafeMutablePointer<T>? {
if T.self == CABI.self {
return RawPointer(_default)
}
return super._getABI()
}
@_spi(WinRTInternal)
public static func from(abi: ComPtr<__x_ABI_CWindows_CApplicationModel_CCore_CICoreApplicationView>?) -> CoreApplicationView? {
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.applicationmodel.core.coreapplicationview.corewindow)
public var coreWindow : UWP.CoreWindow! {
get { try! _default.get_CoreWindowImpl() }
}
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.applicationmodel.core.coreapplicationview.ishosted)
public var isHosted : Bool {
get { try! _default.get_IsHostedImpl() }
}
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.applicationmodel.core.coreapplicationview.ismain)
public var isMain : Bool {
get { try! _default.get_IsMainImpl() }
}
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.applicationmodel.core.coreapplicationview.activated)
public lazy var activated : Event<TypedEventHandler<CoreApplicationView?, IActivatedEventArgs?>> = {
.init(
add: { [weak self] in
guard let this = self?._default else { return .init() }
return try! this.add_ActivatedImpl($0)
},
remove: { [weak self] in
try? self?._default.remove_ActivatedImpl($0)
}
)
}()
private lazy var _ICoreApplicationView2: __ABI_Windows_ApplicationModel_Core.ICoreApplicationView2! = getInterfaceForCaching()
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.applicationmodel.core.coreapplicationview.dispatcher)
public var dispatcher : UWP.CoreDispatcher! {
get { try! _ICoreApplicationView2.get_DispatcherImpl() }
}
private lazy var _ICoreApplicationView3: __ABI_Windows_ApplicationModel_Core.ICoreApplicationView3! = getInterfaceForCaching()
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.applicationmodel.core.coreapplicationview.iscomponent)
public var isComponent : Bool {
get { try! _ICoreApplicationView3.get_IsComponentImpl() }
}
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.applicationmodel.core.coreapplicationview.titlebar)
public var titleBar : CoreApplicationViewTitleBar! {
get { try! _ICoreApplicationView3.get_TitleBarImpl() }
}
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.applicationmodel.core.coreapplicationview.hostedviewclosing)
public lazy var hostedViewClosing : Event<TypedEventHandler<CoreApplicationView?, HostedViewClosingEventArgs?>> = {
.init(
add: { [weak self] in
guard let this = self?._ICoreApplicationView3 else { return .init() }
return try! this.add_HostedViewClosingImpl($0)
},
remove: { [weak self] in
try? self?._ICoreApplicationView3.remove_HostedViewClosingImpl($0)
}
)
}()
private lazy var _ICoreApplicationView5: __ABI_Windows_ApplicationModel_Core.ICoreApplicationView5! = getInterfaceForCaching()
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.applicationmodel.core.coreapplicationview.properties)
public var properties : WindowsFoundation.AnyIPropertySet! {
get { try! _ICoreApplicationView5.get_PropertiesImpl() }
}
private lazy var _ICoreApplicationView6: __ABI_Windows_ApplicationModel_Core.ICoreApplicationView6! = getInterfaceForCaching()
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.applicationmodel.core.coreapplicationview.dispatcherqueue)
public var dispatcherQueue : UWP.DispatcherQueue! {
get { try! _ICoreApplicationView6.get_DispatcherQueueImpl() }
}
deinit {
_default = nil
_ICoreApplicationView2 = nil
_ICoreApplicationView3 = nil
_ICoreApplicationView5 = nil
_ICoreApplicationView6 = nil
}
}
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.applicationmodel.core.coreapplicationviewtitlebar)
public final class CoreApplicationViewTitleBar : WinRTClass {
private typealias SwiftABI = __ABI_Windows_ApplicationModel_Core.ICoreApplicationViewTitleBar
private typealias CABI = __x_ABI_CWindows_CApplicationModel_CCore_CICoreApplicationViewTitleBar
private lazy var _default: SwiftABI! = getInterfaceForCaching()
@_spi(WinRTInternal)
override public func _getABI<T>() -> UnsafeMutablePointer<T>? {
if T.self == CABI.self {
return RawPointer(_default)
}
return super._getABI()
}
@_spi(WinRTInternal)
public static func from(abi: ComPtr<__x_ABI_CWindows_CApplicationModel_CCore_CICoreApplicationViewTitleBar>?) -> CoreApplicationViewTitleBar? {
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.applicationmodel.core.coreapplicationviewtitlebar.extendviewintotitlebar)
public var extendViewIntoTitleBar : Bool {
get { try! _default.get_ExtendViewIntoTitleBarImpl() }
set { try! _default.put_ExtendViewIntoTitleBarImpl(newValue) }
}
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.applicationmodel.core.coreapplicationviewtitlebar.height)
public var height : Double {
get { try! _default.get_HeightImpl() }
}
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.applicationmodel.core.coreapplicationviewtitlebar.isvisible)
public var isVisible : Bool {
get { try! _default.get_IsVisibleImpl() }
}
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.applicationmodel.core.coreapplicationviewtitlebar.systemoverlayleftinset)
public var systemOverlayLeftInset : Double {
get { try! _default.get_SystemOverlayLeftInsetImpl() }
}
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.applicationmodel.core.coreapplicationviewtitlebar.systemoverlayrightinset)
public var systemOverlayRightInset : Double {
get { try! _default.get_SystemOverlayRightInsetImpl() }
}
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.applicationmodel.core.coreapplicationviewtitlebar.isvisiblechanged)
public lazy var isVisibleChanged : Event<TypedEventHandler<CoreApplicationViewTitleBar?, Any?>> = {
.init(
add: { [weak self] in
guard let this = self?._default else { return .init() }
return try! this.add_IsVisibleChangedImpl($0)
},
remove: { [weak self] in
try? self?._default.remove_IsVisibleChangedImpl($0)
}
)
}()
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.applicationmodel.core.coreapplicationviewtitlebar.layoutmetricschanged)
public lazy var layoutMetricsChanged : Event<TypedEventHandler<CoreApplicationViewTitleBar?, Any?>> = {
.init(
add: { [weak self] in
guard let this = self?._default else { return .init() }
return try! this.add_LayoutMetricsChangedImpl($0)
},
remove: { [weak self] in
try? self?._default.remove_LayoutMetricsChangedImpl($0)
}
)
}()
deinit {
_default = nil
}
}
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.applicationmodel.core.hostedviewclosingeventargs)
public final class HostedViewClosingEventArgs : WinRTClass {
private typealias SwiftABI = __ABI_Windows_ApplicationModel_Core.IHostedViewClosingEventArgs
private typealias CABI = __x_ABI_CWindows_CApplicationModel_CCore_CIHostedViewClosingEventArgs
private lazy var _default: SwiftABI! = getInterfaceForCaching()
@_spi(WinRTInternal)
override public func _getABI<T>() -> UnsafeMutablePointer<T>? {
if T.self == CABI.self {
return RawPointer(_default)
}
return super._getABI()
}
@_spi(WinRTInternal)
public static func from(abi: ComPtr<__x_ABI_CWindows_CApplicationModel_CCore_CIHostedViewClosingEventArgs>?) -> HostedViewClosingEventArgs? {
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.applicationmodel.core.hostedviewclosingeventargs.getdeferral)
public func getDeferral() throws -> WindowsFoundation.Deferral! {
try _default.GetDeferralImpl()
}
deinit {
_default = nil
}
}
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.applicationmodel.core.unhandlederror)
public final class UnhandledError : WinRTClass {
private typealias SwiftABI = __ABI_Windows_ApplicationModel_Core.IUnhandledError
private typealias CABI = __x_ABI_CWindows_CApplicationModel_CCore_CIUnhandledError
private lazy var _default: SwiftABI! = getInterfaceForCaching()
@_spi(WinRTInternal)
override public func _getABI<T>() -> UnsafeMutablePointer<T>? {
if T.self == CABI.self {
return RawPointer(_default)
}
return super._getABI()
}
@_spi(WinRTInternal)
public static func from(abi: ComPtr<__x_ABI_CWindows_CApplicationModel_CCore_CIUnhandledError>?) -> UnhandledError? {
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.applicationmodel.core.unhandlederror.propagate)
public func propagate() throws {
try _default.PropagateImpl()
}
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.applicationmodel.core.unhandlederror.handled)
public var handled : Bool {
get { try! _default.get_HandledImpl() }
}
deinit {
_default = nil
}
}
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.applicationmodel.core.unhandlederrordetectedeventargs)
public final class UnhandledErrorDetectedEventArgs : WinRTClass {
private typealias SwiftABI = __ABI_Windows_ApplicationModel_Core.IUnhandledErrorDetectedEventArgs
private typealias CABI = __x_ABI_CWindows_CApplicationModel_CCore_CIUnhandledErrorDetectedEventArgs
private lazy var _default: SwiftABI! = getInterfaceForCaching()
@_spi(WinRTInternal)
override public func _getABI<T>() -> UnsafeMutablePointer<T>? {
if T.self == CABI.self {
return RawPointer(_default)
}
return super._getABI()
}
@_spi(WinRTInternal)
public static func from(abi: ComPtr<__x_ABI_CWindows_CApplicationModel_CCore_CIUnhandledErrorDetectedEventArgs>?) -> UnhandledErrorDetectedEventArgs? {
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.applicationmodel.core.unhandlederrordetectedeventargs.unhandlederror)
public var unhandledError : UnhandledError! {
get { try! _default.get_UnhandledErrorImpl() }
}
deinit {
_default = nil
}
}
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.applicationmodel.core.icoreapplicationunhandlederror)
public protocol ICoreApplicationUnhandledError : WinRTInterface {
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.applicationmodel.core.icoreapplicationunhandlederror.unhandlederrordetected)
var unhandledErrorDetected: Event<EventHandler<UnhandledErrorDetectedEventArgs?>> { get }
}
extension ICoreApplicationUnhandledError {
public func queryInterface(_ iid: WindowsFoundation.IID) -> IUnknownRef? {
switch iid {
case __ABI_Windows_ApplicationModel_Core.ICoreApplicationUnhandledErrorWrapper.IID:
let wrapper = __ABI_Windows_ApplicationModel_Core.ICoreApplicationUnhandledErrorWrapper(self)
return wrapper!.queryInterface(iid)
default: return nil
}
}
}
public typealias AnyICoreApplicationUnhandledError = any ICoreApplicationUnhandledError
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.applicationmodel.core.iframeworkview)
public protocol IFrameworkView : WinRTInterface {
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.applicationmodel.core.iframeworkview.initialize)
func initialize(_ applicationView: UWP.CoreApplicationView!) throws
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.applicationmodel.core.iframeworkview.setwindow)
func setWindow(_ window: UWP.CoreWindow!) throws
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.applicationmodel.core.iframeworkview.load)
func load(_ entryPoint: String) throws
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.applicationmodel.core.iframeworkview.run)
func run() throws
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.applicationmodel.core.iframeworkview.uninitialize)
func uninitialize() throws
}
extension IFrameworkView {
public func queryInterface(_ iid: WindowsFoundation.IID) -> IUnknownRef? {
switch iid {
case __ABI_Windows_ApplicationModel_Core.IFrameworkViewWrapper.IID:
let wrapper = __ABI_Windows_ApplicationModel_Core.IFrameworkViewWrapper(self)
return wrapper!.queryInterface(iid)
default: return nil
}
}
}
public typealias AnyIFrameworkView = any IFrameworkView
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.applicationmodel.core.iframeworkviewsource)
public protocol IFrameworkViewSource : WinRTInterface {
/// [Open Microsoft documentation](https://learn.microsoft.com/uwp/api/windows.applicationmodel.core.iframeworkviewsource.createview)
func createView() throws -> UWP.AnyIFrameworkView!
}
extension IFrameworkViewSource {
public func queryInterface(_ iid: WindowsFoundation.IID) -> IUnknownRef? {
switch iid {
case __ABI_Windows_ApplicationModel_Core.IFrameworkViewSourceWrapper.IID:
let wrapper = __ABI_Windows_ApplicationModel_Core.IFrameworkViewSourceWrapper(self)
return wrapper!.queryInterface(iid)
default: return nil
}
}
}
public typealias AnyIFrameworkViewSource = any IFrameworkViewSource
extension UWP.AppRestartFailureReason {
public static var restartPending : UWP.AppRestartFailureReason {
__x_ABI_CWindows_CApplicationModel_CCore_CAppRestartFailureReason_RestartPending
}
public static var notInForeground : UWP.AppRestartFailureReason {
__x_ABI_CWindows_CApplicationModel_CCore_CAppRestartFailureReason_NotInForeground
}
public static var invalidUser : UWP.AppRestartFailureReason {
__x_ABI_CWindows_CApplicationModel_CCore_CAppRestartFailureReason_InvalidUser
}
public static var other : UWP.AppRestartFailureReason {
__x_ABI_CWindows_CApplicationModel_CCore_CAppRestartFailureReason_Other
}
}
extension UWP.AppRestartFailureReason: @retroactive Hashable, @retroactive Codable {}