// C++/WinRT v2.0.250303.1 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. #pragma once #ifndef WINRT_Windows_Foundation_1_H #define WINRT_Windows_Foundation_1_H #include "winrt/impl/Windows.Foundation.Collections.0.h" #include "winrt/impl/Windows.Foundation.0.h" WINRT_EXPORT namespace winrt::Windows::Foundation { struct WINRT_IMPL_EMPTY_BASES IAsyncAction : winrt::Windows::Foundation::IInspectable, impl::consume_t, impl::require { IAsyncAction(std::nullptr_t = nullptr) noexcept {} IAsyncAction(void* ptr, take_ownership_from_abi_t) noexcept : winrt::Windows::Foundation::IInspectable(ptr, take_ownership_from_abi) {} }; template struct WINRT_IMPL_EMPTY_BASES IAsyncActionWithProgress : winrt::Windows::Foundation::IInspectable, impl::consume_t>, impl::require, winrt::Windows::Foundation::IAsyncInfo> { static_assert(impl::has_category_v, "TProgress must be WinRT type."); IAsyncActionWithProgress(std::nullptr_t = nullptr) noexcept {} IAsyncActionWithProgress(void* ptr, take_ownership_from_abi_t) noexcept : winrt::Windows::Foundation::IInspectable(ptr, take_ownership_from_abi) {} }; struct WINRT_IMPL_EMPTY_BASES IAsyncInfo : winrt::Windows::Foundation::IInspectable, impl::consume_t { IAsyncInfo(std::nullptr_t = nullptr) noexcept {} IAsyncInfo(void* ptr, take_ownership_from_abi_t) noexcept : winrt::Windows::Foundation::IInspectable(ptr, take_ownership_from_abi) {} }; template struct WINRT_IMPL_EMPTY_BASES IAsyncOperationWithProgress : winrt::Windows::Foundation::IInspectable, impl::consume_t>, impl::require, winrt::Windows::Foundation::IAsyncInfo> { static_assert(impl::has_category_v, "TResult must be WinRT type."); static_assert(impl::has_category_v, "TProgress must be WinRT type."); IAsyncOperationWithProgress(std::nullptr_t = nullptr) noexcept {} IAsyncOperationWithProgress(void* ptr, take_ownership_from_abi_t) noexcept : winrt::Windows::Foundation::IInspectable(ptr, take_ownership_from_abi) {} }; template struct WINRT_IMPL_EMPTY_BASES IAsyncOperation : winrt::Windows::Foundation::IInspectable, impl::consume_t>, impl::require, winrt::Windows::Foundation::IAsyncInfo> { static_assert(impl::has_category_v, "TResult must be WinRT type."); IAsyncOperation(std::nullptr_t = nullptr) noexcept {} IAsyncOperation(void* ptr, take_ownership_from_abi_t) noexcept : winrt::Windows::Foundation::IInspectable(ptr, take_ownership_from_abi) {} }; struct WINRT_IMPL_EMPTY_BASES IClosable : winrt::Windows::Foundation::IInspectable, impl::consume_t { IClosable(std::nullptr_t = nullptr) noexcept {} IClosable(void* ptr, take_ownership_from_abi_t) noexcept : winrt::Windows::Foundation::IInspectable(ptr, take_ownership_from_abi) {} }; struct WINRT_IMPL_EMPTY_BASES IDeferral : winrt::Windows::Foundation::IInspectable, impl::consume_t, impl::require { IDeferral(std::nullptr_t = nullptr) noexcept {} IDeferral(void* ptr, take_ownership_from_abi_t) noexcept : winrt::Windows::Foundation::IInspectable(ptr, take_ownership_from_abi) {} }; struct WINRT_IMPL_EMPTY_BASES IDeferralFactory : winrt::Windows::Foundation::IInspectable, impl::consume_t { IDeferralFactory(std::nullptr_t = nullptr) noexcept {} IDeferralFactory(void* ptr, take_ownership_from_abi_t) noexcept : winrt::Windows::Foundation::IInspectable(ptr, take_ownership_from_abi) {} }; struct WINRT_IMPL_EMPTY_BASES IGetActivationFactory : winrt::Windows::Foundation::IInspectable, impl::consume_t { IGetActivationFactory(std::nullptr_t = nullptr) noexcept {} IGetActivationFactory(void* ptr, take_ownership_from_abi_t) noexcept : winrt::Windows::Foundation::IInspectable(ptr, take_ownership_from_abi) {} }; struct WINRT_IMPL_EMPTY_BASES IGuidHelperStatics : winrt::Windows::Foundation::IInspectable, impl::consume_t { IGuidHelperStatics(std::nullptr_t = nullptr) noexcept {} IGuidHelperStatics(void* ptr, take_ownership_from_abi_t) noexcept : winrt::Windows::Foundation::IInspectable(ptr, take_ownership_from_abi) {} }; struct WINRT_IMPL_EMPTY_BASES IMemoryBuffer : winrt::Windows::Foundation::IInspectable, impl::consume_t, impl::require { IMemoryBuffer(std::nullptr_t = nullptr) noexcept {} IMemoryBuffer(void* ptr, take_ownership_from_abi_t) noexcept : winrt::Windows::Foundation::IInspectable(ptr, take_ownership_from_abi) {} }; struct WINRT_IMPL_EMPTY_BASES IMemoryBufferFactory : winrt::Windows::Foundation::IInspectable, impl::consume_t { IMemoryBufferFactory(std::nullptr_t = nullptr) noexcept {} IMemoryBufferFactory(void* ptr, take_ownership_from_abi_t) noexcept : winrt::Windows::Foundation::IInspectable(ptr, take_ownership_from_abi) {} }; struct WINRT_IMPL_EMPTY_BASES IMemoryBufferReference : winrt::Windows::Foundation::IInspectable, impl::consume_t, impl::require { IMemoryBufferReference(std::nullptr_t = nullptr) noexcept {} IMemoryBufferReference(void* ptr, take_ownership_from_abi_t) noexcept : winrt::Windows::Foundation::IInspectable(ptr, take_ownership_from_abi) {} }; struct WINRT_IMPL_EMPTY_BASES IPropertyValue : winrt::Windows::Foundation::IInspectable, impl::consume_t { IPropertyValue(std::nullptr_t = nullptr) noexcept {} IPropertyValue(void* ptr, take_ownership_from_abi_t) noexcept : winrt::Windows::Foundation::IInspectable(ptr, take_ownership_from_abi) {} }; struct WINRT_IMPL_EMPTY_BASES IPropertyValueStatics : winrt::Windows::Foundation::IInspectable, impl::consume_t { IPropertyValueStatics(std::nullptr_t = nullptr) noexcept {} IPropertyValueStatics(void* ptr, take_ownership_from_abi_t) noexcept : winrt::Windows::Foundation::IInspectable(ptr, take_ownership_from_abi) {} }; template struct WINRT_IMPL_EMPTY_BASES IReferenceArray : winrt::Windows::Foundation::IInspectable, impl::consume_t>, impl::require, winrt::Windows::Foundation::IPropertyValue> { static_assert(impl::has_category_v, "T must be WinRT type."); IReferenceArray(std::nullptr_t = nullptr) noexcept {} IReferenceArray(void* ptr, take_ownership_from_abi_t) noexcept : winrt::Windows::Foundation::IInspectable(ptr, take_ownership_from_abi) {} }; template struct WINRT_IMPL_EMPTY_BASES IReference : winrt::Windows::Foundation::IInspectable, impl::consume_t>, impl::require, winrt::Windows::Foundation::IPropertyValue> { static_assert(impl::has_category_v, "T must be WinRT type."); IReference(std::nullptr_t = nullptr) noexcept {} IReference(void* ptr, take_ownership_from_abi_t) noexcept : winrt::Windows::Foundation::IInspectable(ptr, take_ownership_from_abi) {} IReference(T const& value) : IReference(impl::reference_traits::make(value)) { } IReference(std::optional const& value) : IReference(value ? IReference(value.value()) : nullptr) { } operator std::optional() const { if (*this) { return this->Value(); } else { return std::nullopt; } } private: IReference(IInspectable const& value) : IReference(value.as()) { } }; struct WINRT_IMPL_EMPTY_BASES IStringable : winrt::Windows::Foundation::IInspectable, impl::consume_t { IStringable(std::nullptr_t = nullptr) noexcept {} IStringable(void* ptr, take_ownership_from_abi_t) noexcept : winrt::Windows::Foundation::IInspectable(ptr, take_ownership_from_abi) {} }; struct WINRT_IMPL_EMPTY_BASES IUriEscapeStatics : winrt::Windows::Foundation::IInspectable, impl::consume_t { IUriEscapeStatics(std::nullptr_t = nullptr) noexcept {} IUriEscapeStatics(void* ptr, take_ownership_from_abi_t) noexcept : winrt::Windows::Foundation::IInspectable(ptr, take_ownership_from_abi) {} }; struct WINRT_IMPL_EMPTY_BASES IUriRuntimeClass : winrt::Windows::Foundation::IInspectable, impl::consume_t { IUriRuntimeClass(std::nullptr_t = nullptr) noexcept {} IUriRuntimeClass(void* ptr, take_ownership_from_abi_t) noexcept : winrt::Windows::Foundation::IInspectable(ptr, take_ownership_from_abi) {} }; struct WINRT_IMPL_EMPTY_BASES IUriRuntimeClassFactory : winrt::Windows::Foundation::IInspectable, impl::consume_t { IUriRuntimeClassFactory(std::nullptr_t = nullptr) noexcept {} IUriRuntimeClassFactory(void* ptr, take_ownership_from_abi_t) noexcept : winrt::Windows::Foundation::IInspectable(ptr, take_ownership_from_abi) {} }; struct WINRT_IMPL_EMPTY_BASES IUriRuntimeClassWithAbsoluteCanonicalUri : winrt::Windows::Foundation::IInspectable, impl::consume_t { IUriRuntimeClassWithAbsoluteCanonicalUri(std::nullptr_t = nullptr) noexcept {} IUriRuntimeClassWithAbsoluteCanonicalUri(void* ptr, take_ownership_from_abi_t) noexcept : winrt::Windows::Foundation::IInspectable(ptr, take_ownership_from_abi) {} }; struct WINRT_IMPL_EMPTY_BASES IWwwFormUrlDecoderEntry : winrt::Windows::Foundation::IInspectable, impl::consume_t { IWwwFormUrlDecoderEntry(std::nullptr_t = nullptr) noexcept {} IWwwFormUrlDecoderEntry(void* ptr, take_ownership_from_abi_t) noexcept : winrt::Windows::Foundation::IInspectable(ptr, take_ownership_from_abi) {} }; struct WINRT_IMPL_EMPTY_BASES IWwwFormUrlDecoderRuntimeClass : winrt::Windows::Foundation::IInspectable, impl::consume_t, impl::require, winrt::Windows::Foundation::Collections::IVectorView> { IWwwFormUrlDecoderRuntimeClass(std::nullptr_t = nullptr) noexcept {} IWwwFormUrlDecoderRuntimeClass(void* ptr, take_ownership_from_abi_t) noexcept : winrt::Windows::Foundation::IInspectable(ptr, take_ownership_from_abi) {} }; struct WINRT_IMPL_EMPTY_BASES IWwwFormUrlDecoderRuntimeClassFactory : winrt::Windows::Foundation::IInspectable, impl::consume_t { IWwwFormUrlDecoderRuntimeClassFactory(std::nullptr_t = nullptr) noexcept {} IWwwFormUrlDecoderRuntimeClassFactory(void* ptr, take_ownership_from_abi_t) noexcept : winrt::Windows::Foundation::IInspectable(ptr, take_ownership_from_abi) {} }; } WINRT_EXPORT namespace winrt::Windows::Foundation { template bool operator==(IReference const& left, IReference const& right); template bool operator!=(IReference const& left, IReference const& right); } #ifdef __cpp_lib_format template <> struct std::formatter : std::formatter { template auto format(winrt::Windows::Foundation::IStringable const& obj, FormatContext& fc) const; }; #endif #endif