// C++/WinRT v2.0.250303.1 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. #pragma once #ifndef WINRT_Windows_Globalization_Fonts_H #define WINRT_Windows_Globalization_Fonts_H #include "winrt/base.h" static_assert(winrt::check_version(CPPWINRT_VERSION, "2.0.250303.1"), "Mismatched C++/WinRT headers."); #define CPPWINRT_VERSION "2.0.250303.1" #include "winrt/Windows.Globalization.h" #include "winrt/impl/Windows.UI.Text.2.h" #include "winrt/impl/Windows.Globalization.Fonts.2.h" namespace winrt::impl { template auto consume_Windows_Globalization_Fonts_ILanguageFont::FontFamily() const { void* value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_FontFamily(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_FontFamily(&value)); } return hstring{ value, take_ownership_from_abi }; } template auto consume_Windows_Globalization_Fonts_ILanguageFont::FontWeight() const { winrt::Windows::UI::Text::FontWeight weight{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_FontWeight(put_abi(weight))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_FontWeight(put_abi(weight))); } return weight; } template auto consume_Windows_Globalization_Fonts_ILanguageFont::FontStretch() const { winrt::Windows::UI::Text::FontStretch stretch{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_FontStretch(reinterpret_cast(&stretch))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_FontStretch(reinterpret_cast(&stretch))); } return stretch; } template auto consume_Windows_Globalization_Fonts_ILanguageFont::FontStyle() const { winrt::Windows::UI::Text::FontStyle style{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_FontStyle(reinterpret_cast(&style))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_FontStyle(reinterpret_cast(&style))); } return style; } template auto consume_Windows_Globalization_Fonts_ILanguageFont::ScaleFactor() const { double scale{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_ScaleFactor(&scale)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_ScaleFactor(&scale)); } return scale; } template auto consume_Windows_Globalization_Fonts_ILanguageFontGroup::UITextFont() const { void* value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_UITextFont(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_UITextFont(&value)); } return winrt::Windows::Globalization::Fonts::LanguageFont{ value, take_ownership_from_abi }; } template auto consume_Windows_Globalization_Fonts_ILanguageFontGroup::UIHeadingFont() const { void* value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_UIHeadingFont(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_UIHeadingFont(&value)); } return winrt::Windows::Globalization::Fonts::LanguageFont{ value, take_ownership_from_abi }; } template auto consume_Windows_Globalization_Fonts_ILanguageFontGroup::UITitleFont() const { void* value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_UITitleFont(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_UITitleFont(&value)); } return winrt::Windows::Globalization::Fonts::LanguageFont{ value, take_ownership_from_abi }; } template auto consume_Windows_Globalization_Fonts_ILanguageFontGroup::UICaptionFont() const { void* value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_UICaptionFont(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_UICaptionFont(&value)); } return winrt::Windows::Globalization::Fonts::LanguageFont{ value, take_ownership_from_abi }; } template auto consume_Windows_Globalization_Fonts_ILanguageFontGroup::UINotificationHeadingFont() const { void* value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_UINotificationHeadingFont(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_UINotificationHeadingFont(&value)); } return winrt::Windows::Globalization::Fonts::LanguageFont{ value, take_ownership_from_abi }; } template auto consume_Windows_Globalization_Fonts_ILanguageFontGroup::TraditionalDocumentFont() const { void* value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_TraditionalDocumentFont(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_TraditionalDocumentFont(&value)); } return winrt::Windows::Globalization::Fonts::LanguageFont{ value, take_ownership_from_abi }; } template auto consume_Windows_Globalization_Fonts_ILanguageFontGroup::ModernDocumentFont() const { void* value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_ModernDocumentFont(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_ModernDocumentFont(&value)); } return winrt::Windows::Globalization::Fonts::LanguageFont{ value, take_ownership_from_abi }; } template auto consume_Windows_Globalization_Fonts_ILanguageFontGroup::DocumentHeadingFont() const { void* value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_DocumentHeadingFont(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_DocumentHeadingFont(&value)); } return winrt::Windows::Globalization::Fonts::LanguageFont{ value, take_ownership_from_abi }; } template auto consume_Windows_Globalization_Fonts_ILanguageFontGroup::FixedWidthTextFont() const { void* value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_FixedWidthTextFont(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_FixedWidthTextFont(&value)); } return winrt::Windows::Globalization::Fonts::LanguageFont{ value, take_ownership_from_abi }; } template auto consume_Windows_Globalization_Fonts_ILanguageFontGroup::DocumentAlternate1Font() const { void* value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_DocumentAlternate1Font(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_DocumentAlternate1Font(&value)); } return winrt::Windows::Globalization::Fonts::LanguageFont{ value, take_ownership_from_abi }; } template auto consume_Windows_Globalization_Fonts_ILanguageFontGroup::DocumentAlternate2Font() const { void* value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_DocumentAlternate2Font(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_DocumentAlternate2Font(&value)); } return winrt::Windows::Globalization::Fonts::LanguageFont{ value, take_ownership_from_abi }; } template auto consume_Windows_Globalization_Fonts_ILanguageFontGroupFactory::CreateLanguageFontGroup(param::hstring const& languageTag) const { void* recommendedFonts{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->CreateLanguageFontGroup(*(void**)(&languageTag), &recommendedFonts)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->CreateLanguageFontGroup(*(void**)(&languageTag), &recommendedFonts)); } return winrt::Windows::Globalization::Fonts::LanguageFontGroup{ recommendedFonts, take_ownership_from_abi }; } #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_FontFamily(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().FontFamily()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_FontWeight(struct struct_Windows_UI_Text_FontWeight* weight) noexcept final try { zero_abi(weight); typename D::abi_guard guard(this->shim()); *weight = detach_from(this->shim().FontWeight()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_FontStretch(int32_t* stretch) noexcept final try { typename D::abi_guard guard(this->shim()); *stretch = detach_from(this->shim().FontStretch()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_FontStyle(int32_t* style) noexcept final try { typename D::abi_guard guard(this->shim()); *style = detach_from(this->shim().FontStyle()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_ScaleFactor(double* scale) noexcept final try { typename D::abi_guard guard(this->shim()); *scale = detach_from(this->shim().ScaleFactor()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_UITextFont(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().UITextFont()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_UIHeadingFont(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().UIHeadingFont()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_UITitleFont(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().UITitleFont()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_UICaptionFont(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().UICaptionFont()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_UINotificationHeadingFont(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().UINotificationHeadingFont()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_TraditionalDocumentFont(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().TraditionalDocumentFont()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_ModernDocumentFont(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().ModernDocumentFont()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_DocumentHeadingFont(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().DocumentHeadingFont()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_FixedWidthTextFont(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().FixedWidthTextFont()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_DocumentAlternate1Font(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().DocumentAlternate1Font()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_DocumentAlternate2Font(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().DocumentAlternate2Font()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall CreateLanguageFontGroup(void* languageTag, void** recommendedFonts) noexcept final try { clear_abi(recommendedFonts); typename D::abi_guard guard(this->shim()); *recommendedFonts = detach_from(this->shim().CreateLanguageFontGroup(*reinterpret_cast(&languageTag))); return 0; } catch (...) { return to_hresult(); } }; #endif } WINRT_EXPORT namespace winrt::Windows::Globalization::Fonts { inline LanguageFontGroup::LanguageFontGroup(param::hstring const& languageTag) : LanguageFontGroup(impl::call_factory([&](ILanguageFontGroupFactory const& f) { return f.CreateLanguageFontGroup(languageTag); })) { } } namespace std { #ifndef WINRT_LEAN_AND_MEAN template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; #endif #ifdef __cpp_lib_format #endif } #endif