// WARNING: Please don't edit this file. It was generated by C++/WinRT // v2.0.250303.1 #pragma once #ifndef WINRT_Microsoft_Windows_BadgeNotifications_H #define WINRT_Microsoft_Windows_BadgeNotifications_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/impl/Microsoft.Windows.BadgeNotifications.2.h" namespace winrt::impl { template auto consume_Microsoft_Windows_BadgeNotifications_IBadgeNotificationManager< D>::SetBadgeAsCount(uint32_t notificationCount) const { 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->SetBadgeAsCount(notificationCount)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->SetBadgeAsCount(notificationCount)); } } template auto consume_Microsoft_Windows_BadgeNotifications_IBadgeNotificationManager< D>::SetBadgeAsGlyph(winrt::Microsoft::Windows::BadgeNotifications:: BadgeNotificationGlyph const& glyphValue) const { 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->SetBadgeAsGlyph(static_cast(glyphValue))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult( _winrt_abi_type->SetBadgeAsGlyph(static_cast(glyphValue))); } } template auto consume_Microsoft_Windows_BadgeNotifications_IBadgeNotificationManager< D>::ClearBadge() const { 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->ClearBadge()); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->ClearBadge()); } } template auto consume_Microsoft_Windows_BadgeNotifications_IBadgeNotificationManagerStatics< D>::Current() 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_Current(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Current(&value)); } return winrt::Microsoft::Windows::BadgeNotifications:: BadgeNotificationManager{value, take_ownership_from_abi}; } #ifndef WINRT_LEAN_AND_MEAN template struct produce< D, winrt::Microsoft::Windows::BadgeNotifications::IBadgeNotificationManager> : produce_base { int32_t __stdcall SetBadgeAsCount(uint32_t notificationCount) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().SetBadgeAsCount(notificationCount); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall SetBadgeAsGlyph(int32_t glyphValue) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().SetBadgeAsGlyph( *reinterpret_cast(&glyphValue)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall ClearBadge() noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().ClearBadge(); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_Current(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Current()); return 0; } catch (...) { return to_hresult(); } }; #endif } // namespace winrt::impl WINRT_EXPORT namespace winrt::Microsoft::Windows::BadgeNotifications { inline auto BadgeNotificationManager::Current() { return impl::call_factory_cast< winrt::Microsoft::Windows::BadgeNotifications:: BadgeNotificationManager (*)( IBadgeNotificationManagerStatics const&), BadgeNotificationManager, IBadgeNotificationManagerStatics>( [](IBadgeNotificationManagerStatics const& f) { return f.Current(); }); } } namespace std { #ifndef WINRT_LEAN_AND_MEAN template <> struct hash< winrt::Microsoft::Windows::BadgeNotifications::IBadgeNotificationManager> : winrt::impl::hash_base {}; template <> struct hash : winrt::impl::hash_base {}; template <> struct hash< winrt::Microsoft::Windows::BadgeNotifications::BadgeNotificationManager> : winrt::impl::hash_base {}; #endif #ifdef __cpp_lib_format #endif } // namespace std #endif