swift-windowsappsdk/Sources/WinAppSDK/Microsoft.Windows.ApplicationModel.Resources.swift
2024-02-13 23:50:08 -08:00

337 lines
17 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/windows/windows-app-sdk/api/winrt/microsoft.windows.applicationmodel.resources.resourcecandidatekind)
public typealias ResourceCandidateKind = __x_ABI_CMicrosoft_CWindows_CApplicationModel_CResources_CResourceCandidateKind
/// [Open Microsoft documentation](https://learn.microsoft.com/windows/windows-app-sdk/api/winrt/microsoft.windows.applicationmodel.resources.resourcecandidate)
public final class ResourceCandidate : WinRTClass {
private typealias SwiftABI = __ABI_Microsoft_Windows_ApplicationModel_Resources.IResourceCandidate
private typealias CABI = __x_ABI_CMicrosoft_CWindows_CApplicationModel_CResources_CIResourceCandidate
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_CMicrosoft_CWindows_CApplicationModel_CResources_CIResourceCandidate>?) -> ResourceCandidate? {
guard let abi = abi else { return nil }
return .init(fromAbi: WindowsFoundation.IInspectable(abi))
}
@_spi(WinRTInternal)
public init(fromAbi: WindowsFoundation.IInspectable) {
super.init(fromAbi)
}
private static let _IResourceCandidateFactory: __ABI_Microsoft_Windows_ApplicationModel_Resources.IResourceCandidateFactory = try! RoGetActivationFactory(HString("Microsoft.Windows.ApplicationModel.Resources.ResourceCandidate"))
public init(_ kind: ResourceCandidateKind, _ data: String) {
super.init(try! Self._IResourceCandidateFactory.CreateInstanceImpl(kind, data))
}
/// [Open Microsoft documentation](https://learn.microsoft.com/windows/windows-app-sdk/api/winrt/microsoft.windows.applicationmodel.resources.resourcecandidate.kind)
public var kind : ResourceCandidateKind {
get { try! _default.get_KindImpl() }
}
/// [Open Microsoft documentation](https://learn.microsoft.com/windows/windows-app-sdk/api/winrt/microsoft.windows.applicationmodel.resources.resourcecandidate.qualifiervalues)
public var qualifierValues : WindowsFoundation.AnyIMapView<String, String>! {
get { try! _default.get_QualifierValuesImpl() }
}
/// [Open Microsoft documentation](https://learn.microsoft.com/windows/windows-app-sdk/api/winrt/microsoft.windows.applicationmodel.resources.resourcecandidate.valueasstring)
public var valueAsString : String {
get { try! _default.get_ValueAsStringImpl() }
}
deinit {
_default = nil
}
}
/// [Open Microsoft documentation](https://learn.microsoft.com/windows/windows-app-sdk/api/winrt/microsoft.windows.applicationmodel.resources.resourcecontext)
public final class ResourceContext : WinRTClass, IResourceContext {
private typealias SwiftABI = __ABI_Microsoft_Windows_ApplicationModel_Resources.IResourceContext
private typealias CABI = __x_ABI_CMicrosoft_CWindows_CApplicationModel_CResources_CIResourceContext
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_CMicrosoft_CWindows_CApplicationModel_CResources_CIResourceContext>?) -> ResourceContext? {
guard let abi = abi else { return nil }
return .init(fromAbi: WindowsFoundation.IInspectable(abi))
}
@_spi(WinRTInternal)
public init(fromAbi: WindowsFoundation.IInspectable) {
super.init(fromAbi)
}
override public func queryInterface(_ iid: WindowsFoundation.IID) -> IUnknownRef? {
return super.queryInterface(iid)
}
private lazy var _IResourceContext2: __ABI_Microsoft_Windows_ApplicationModel_Resources.IResourceContext2! = getInterfaceForCaching()
/// [Open Microsoft documentation](https://learn.microsoft.com/windows/windows-app-sdk/api/winrt/microsoft.windows.applicationmodel.resources.resourcecontext.qualifiervalues)
public var qualifierValues : WindowsFoundation.AnyIMap<String, String>! {
get { try! _default.get_QualifierValuesImpl() }
}
deinit {
_IResourceContext2 = nil
_default = nil
}
}
/// [Open Microsoft documentation](https://learn.microsoft.com/windows/windows-app-sdk/api/winrt/microsoft.windows.applicationmodel.resources.resourcemanager)
public final class ResourceManager : WinRTClass, IResourceManager {
private typealias SwiftABI = __ABI_Microsoft_Windows_ApplicationModel_Resources.IResourceManager
private typealias CABI = __x_ABI_CMicrosoft_CWindows_CApplicationModel_CResources_CIResourceManager
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_CMicrosoft_CWindows_CApplicationModel_CResources_CIResourceManager>?) -> ResourceManager? {
guard let abi = abi else { return nil }
return .init(fromAbi: WindowsFoundation.IInspectable(abi))
}
@_spi(WinRTInternal)
public init(fromAbi: WindowsFoundation.IInspectable) {
super.init(fromAbi)
}
override public func queryInterface(_ iid: WindowsFoundation.IID) -> IUnknownRef? {
return super.queryInterface(iid)
}
override public init() {
super.init(try! RoActivateInstance(HString("Microsoft.Windows.ApplicationModel.Resources.ResourceManager")))
}
private static let _IResourceManagerFactory: __ABI_Microsoft_Windows_ApplicationModel_Resources.IResourceManagerFactory = try! RoGetActivationFactory(HString("Microsoft.Windows.ApplicationModel.Resources.ResourceManager"))
public init(_ fileName: String) {
super.init(try! Self._IResourceManagerFactory.CreateInstanceImpl(fileName))
}
private lazy var _IResourceManager2: __ABI_Microsoft_Windows_ApplicationModel_Resources.IResourceManager2! = getInterfaceForCaching()
/// [Open Microsoft documentation](https://learn.microsoft.com/windows/windows-app-sdk/api/winrt/microsoft.windows.applicationmodel.resources.resourcemanager.createresourcecontext)
public func createResourceContext() throws -> ResourceContext! {
try _default.CreateResourceContextImpl()
}
/// [Open Microsoft documentation](https://learn.microsoft.com/windows/windows-app-sdk/api/winrt/microsoft.windows.applicationmodel.resources.resourcemanager.mainresourcemap)
public var mainResourceMap : ResourceMap! {
get { try! _default.get_MainResourceMapImpl() }
}
/// [Open Microsoft documentation](https://learn.microsoft.com/windows/windows-app-sdk/api/winrt/microsoft.windows.applicationmodel.resources.resourcemanager.resourcenotfound)
public lazy var resourceNotFound : Event<TypedEventHandler<ResourceManager?, ResourceNotFoundEventArgs?>> = {
.init(
add: { [weak self] in
guard let this = self?._default else { return .init() }
return try! this.add_ResourceNotFoundImpl($0)
},
remove: { [weak self] in
try? self?._default.remove_ResourceNotFoundImpl($0)
}
)
}()
deinit {
_IResourceManager2 = nil
_default = nil
}
}
/// [Open Microsoft documentation](https://learn.microsoft.com/windows/windows-app-sdk/api/winrt/microsoft.windows.applicationmodel.resources.resourcemap)
public final class ResourceMap : WinRTClass {
private typealias SwiftABI = __ABI_Microsoft_Windows_ApplicationModel_Resources.IResourceMap
private typealias CABI = __x_ABI_CMicrosoft_CWindows_CApplicationModel_CResources_CIResourceMap
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_CMicrosoft_CWindows_CApplicationModel_CResources_CIResourceMap>?) -> ResourceMap? {
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/windows/windows-app-sdk/api/winrt/microsoft.windows.applicationmodel.resources.resourcemap.getsubtree)
public func getSubtree(_ reference: String) throws -> ResourceMap! {
try _default.GetSubtreeImpl(reference)
}
/// [Open Microsoft documentation](https://learn.microsoft.com/windows/windows-app-sdk/api/winrt/microsoft.windows.applicationmodel.resources.resourcemap.trygetsubtree)
public func tryGetSubtree(_ reference: String) throws -> ResourceMap! {
try _default.TryGetSubtreeImpl(reference)
}
/// [Open Microsoft documentation](https://learn.microsoft.com/windows/windows-app-sdk/api/winrt/microsoft.windows.applicationmodel.resources.resourcemap.getvalue)
public func getValue(_ resource: String) throws -> ResourceCandidate! {
try _default.GetValueImpl(resource)
}
/// [Open Microsoft documentation](https://learn.microsoft.com/windows/windows-app-sdk/api/winrt/microsoft.windows.applicationmodel.resources.resourcemap.getvalue)
public func getValue(_ resource: String, _ context: ResourceContext!) throws -> ResourceCandidate! {
try _default.GetValueWithContextImpl(resource, context)
}
/// [Open Microsoft documentation](https://learn.microsoft.com/windows/windows-app-sdk/api/winrt/microsoft.windows.applicationmodel.resources.resourcemap.getvaluebyindex)
public func getValueByIndex(_ index: UInt32) throws -> WindowsFoundation.AnyIKeyValuePair<String, ResourceCandidate?>! {
try _default.GetValueByIndexImpl(index)
}
/// [Open Microsoft documentation](https://learn.microsoft.com/windows/windows-app-sdk/api/winrt/microsoft.windows.applicationmodel.resources.resourcemap.getvaluebyindex)
public func getValueByIndex(_ index: UInt32, _ context: ResourceContext!) throws -> WindowsFoundation.AnyIKeyValuePair<String, ResourceCandidate?>! {
try _default.GetValueByIndexWithContextImpl(index, context)
}
/// [Open Microsoft documentation](https://learn.microsoft.com/windows/windows-app-sdk/api/winrt/microsoft.windows.applicationmodel.resources.resourcemap.trygetvalue)
public func tryGetValue(_ resource: String) throws -> ResourceCandidate! {
try _default.TryGetValueImpl(resource)
}
/// [Open Microsoft documentation](https://learn.microsoft.com/windows/windows-app-sdk/api/winrt/microsoft.windows.applicationmodel.resources.resourcemap.trygetvalue)
public func tryGetValue(_ resource: String, _ context: ResourceContext!) throws -> ResourceCandidate! {
try _default.TryGetValueWithContextImpl(resource, context)
}
/// [Open Microsoft documentation](https://learn.microsoft.com/windows/windows-app-sdk/api/winrt/microsoft.windows.applicationmodel.resources.resourcemap.resourcecount)
public var resourceCount : UInt32 {
get { try! _default.get_ResourceCountImpl() }
}
deinit {
_default = nil
}
}
/// [Open Microsoft documentation](https://learn.microsoft.com/windows/windows-app-sdk/api/winrt/microsoft.windows.applicationmodel.resources.resourcenotfoundeventargs)
public final class ResourceNotFoundEventArgs : WinRTClass {
private typealias SwiftABI = __ABI_Microsoft_Windows_ApplicationModel_Resources.IResourceNotFoundEventArgs
private typealias CABI = __x_ABI_CMicrosoft_CWindows_CApplicationModel_CResources_CIResourceNotFoundEventArgs
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_CMicrosoft_CWindows_CApplicationModel_CResources_CIResourceNotFoundEventArgs>?) -> ResourceNotFoundEventArgs? {
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/windows/windows-app-sdk/api/winrt/microsoft.windows.applicationmodel.resources.resourcenotfoundeventargs.setresolvedcandidate)
public func setResolvedCandidate(_ candidate: ResourceCandidate!) throws {
try _default.SetResolvedCandidateImpl(candidate)
}
/// [Open Microsoft documentation](https://learn.microsoft.com/windows/windows-app-sdk/api/winrt/microsoft.windows.applicationmodel.resources.resourcenotfoundeventargs.context)
public var context : ResourceContext! {
get { try! _default.get_ContextImpl() }
}
/// [Open Microsoft documentation](https://learn.microsoft.com/windows/windows-app-sdk/api/winrt/microsoft.windows.applicationmodel.resources.resourcenotfoundeventargs.name)
public var name : String {
get { try! _default.get_NameImpl() }
}
deinit {
_default = nil
}
}
/// [Open Microsoft documentation](https://learn.microsoft.com/windows/windows-app-sdk/api/winrt/microsoft.windows.applicationmodel.resources.iresourcecontext)
public protocol IResourceContext : WinRTInterface {
/// [Open Microsoft documentation](https://learn.microsoft.com/windows/windows-app-sdk/api/winrt/microsoft.windows.applicationmodel.resources.iresourcecontext.qualifiervalues)
var qualifierValues: WindowsFoundation.AnyIMap<String, String>! { get }
}
extension IResourceContext {
public func queryInterface(_ iid: WindowsFoundation.IID) -> IUnknownRef? {
switch iid {
case __ABI_Microsoft_Windows_ApplicationModel_Resources.IResourceContextWrapper.IID:
let wrapper = __ABI_Microsoft_Windows_ApplicationModel_Resources.IResourceContextWrapper(self)
return wrapper!.queryInterface(iid)
default: return nil
}
}
}
public typealias AnyIResourceContext = any IResourceContext
/// [Open Microsoft documentation](https://learn.microsoft.com/windows/windows-app-sdk/api/winrt/microsoft.windows.applicationmodel.resources.iresourcemanager)
public protocol IResourceManager : WinRTInterface {
/// [Open Microsoft documentation](https://learn.microsoft.com/windows/windows-app-sdk/api/winrt/microsoft.windows.applicationmodel.resources.iresourcemanager.createresourcecontext)
func createResourceContext() throws -> WinAppSDK.ResourceContext!
/// [Open Microsoft documentation](https://learn.microsoft.com/windows/windows-app-sdk/api/winrt/microsoft.windows.applicationmodel.resources.iresourcemanager.mainresourcemap)
var mainResourceMap: WinAppSDK.ResourceMap! { get }
/// [Open Microsoft documentation](https://learn.microsoft.com/windows/windows-app-sdk/api/winrt/microsoft.windows.applicationmodel.resources.iresourcemanager.resourcenotfound)
var resourceNotFound: Event<TypedEventHandler<ResourceManager?, ResourceNotFoundEventArgs?>> { get }
}
extension IResourceManager {
public func queryInterface(_ iid: WindowsFoundation.IID) -> IUnknownRef? {
switch iid {
case __ABI_Microsoft_Windows_ApplicationModel_Resources.IResourceManagerWrapper.IID:
let wrapper = __ABI_Microsoft_Windows_ApplicationModel_Resources.IResourceManagerWrapper(self)
return wrapper!.queryInterface(iid)
default: return nil
}
}
}
public typealias AnyIResourceManager = any IResourceManager
extension WinAppSDK.ResourceCandidateKind {
public static var unknown : WinAppSDK.ResourceCandidateKind {
__x_ABI_CMicrosoft_CWindows_CApplicationModel_CResources_CResourceCandidateKind_Unknown
}
public static var string : WinAppSDK.ResourceCandidateKind {
__x_ABI_CMicrosoft_CWindows_CApplicationModel_CResources_CResourceCandidateKind_String
}
public static var filePath : WinAppSDK.ResourceCandidateKind {
__x_ABI_CMicrosoft_CWindows_CApplicationModel_CResources_CResourceCandidateKind_FilePath
}
public static var embeddedData : WinAppSDK.ResourceCandidateKind {
__x_ABI_CMicrosoft_CWindows_CApplicationModel_CResources_CResourceCandidateKind_EmbeddedData
}
}
extension WinAppSDK.ResourceCandidateKind: @retroactive Hashable, @retroactive Codable {}