// WARNING: Please don't edit this file. It was generated by C++/WinRT // v2.0.250303.1 #pragma once #ifndef WINRT_Microsoft_Windows_PushNotifications_H #define WINRT_Microsoft_Windows_PushNotifications_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.PushNotifications.2.h" #include "winrt/impl/Windows.ApplicationModel.Background.2.h" #include "winrt/impl/Windows.Foundation.2.h" namespace winrt::impl { template auto consume_Microsoft_Windows_PushNotifications_IPushNotificationChannel< D>::Uri() 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< winrt::Microsoft::Windows::PushNotifications::IPushNotificationChannel, D const*>(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_Uri(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Uri(&value)); } return winrt::Windows::Foundation::Uri{value, take_ownership_from_abi}; } template auto consume_Microsoft_Windows_PushNotifications_IPushNotificationChannel< D>::ExpirationTime() const { winrt::Windows::Foundation::DateTime value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::PushNotifications::IPushNotificationChannel, D const*>(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_ExpirationTime(put_abi(value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_ExpirationTime(put_abi(value))); } return value; } template auto consume_Microsoft_Windows_PushNotifications_IPushNotificationChannel< D>::Close() const { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::PushNotifications::IPushNotificationChannel, D const*>(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->Close()); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->Close()); } } template auto consume_Microsoft_Windows_PushNotifications_IPushNotificationCreateChannelResult< D>::Channel() 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_Channel(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Channel(&value)); } return winrt::Microsoft::Windows::PushNotifications::PushNotificationChannel{ value, take_ownership_from_abi}; } template auto consume_Microsoft_Windows_PushNotifications_IPushNotificationCreateChannelResult< D>::ExtendedError() const { winrt::hresult 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_ExtendedError(put_abi(value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_ExtendedError(put_abi(value))); } return value; } template auto consume_Microsoft_Windows_PushNotifications_IPushNotificationCreateChannelResult< D>::Status() const { winrt::Microsoft::Windows::PushNotifications::PushNotificationChannelStatus 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_Status(reinterpret_cast(&value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult( _winrt_abi_type->get_Status(reinterpret_cast(&value))); } return value; } template auto consume_Microsoft_Windows_PushNotifications_IPushNotificationManager< D>::Register() const { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::PushNotifications::IPushNotificationManager, D const*>(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->Register()); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->Register()); } } template auto consume_Microsoft_Windows_PushNotifications_IPushNotificationManager< D>::Unregister() const { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::PushNotifications::IPushNotificationManager, D const*>(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->Unregister()); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->Unregister()); } } template auto consume_Microsoft_Windows_PushNotifications_IPushNotificationManager< D>::UnregisterAll() const { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::PushNotifications::IPushNotificationManager, D const*>(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->UnregisterAll()); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->UnregisterAll()); } } template auto consume_Microsoft_Windows_PushNotifications_IPushNotificationManager< D>::CreateChannelAsync(winrt::guid const& remoteId) const { void* operation{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::PushNotifications::IPushNotificationManager, D const*>(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->CreateChannelAsync(impl::bind_in(remoteId), &operation)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->CreateChannelAsync(impl::bind_in(remoteId), &operation)); } return winrt::Windows::Foundation::IAsyncOperationWithProgress< winrt::Microsoft::Windows::PushNotifications:: PushNotificationCreateChannelResult, winrt::Microsoft::Windows::PushNotifications:: PushNotificationCreateChannelStatus>{operation, take_ownership_from_abi}; } template auto consume_Microsoft_Windows_PushNotifications_IPushNotificationManager:: PushReceived(winrt::Windows::Foundation::TypedEventHandler< winrt::Microsoft::Windows::PushNotifications:: PushNotificationManager, winrt::Microsoft::Windows::PushNotifications:: PushNotificationReceivedEventArgs> const& handler) const { winrt::event_token token{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::PushNotifications::IPushNotificationManager, D const*>(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->add_PushReceived(*(void**)(&handler), put_abi(token))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult( _winrt_abi_type->add_PushReceived(*(void**)(&handler), put_abi(token))); } return token; } template auto consume_Microsoft_Windows_PushNotifications_IPushNotificationManager< D>::PushReceived(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler< winrt::Microsoft::Windows::PushNotifications:: PushNotificationManager, winrt::Microsoft::Windows::PushNotifications:: PushNotificationReceivedEventArgs> const& handler) const { return impl::make_event_revoker( this, PushReceived(handler)); } template auto consume_Microsoft_Windows_PushNotifications_IPushNotificationManager< D>::PushReceived(winrt::event_token const& token) const noexcept { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::PushNotifications::IPushNotificationManager, D const*>(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; _winrt_abi_type->remove_PushReceived(impl::bind_in(token)); } else { auto const _winrt_abi_type = *(abi_t**)this; _winrt_abi_type->remove_PushReceived(impl::bind_in(token)); } } template auto consume_Microsoft_Windows_PushNotifications_IPushNotificationManagerStatics< D>::IsSupported() const { bool result{}; 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->IsSupported(&result)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->IsSupported(&result)); } return result; } template auto consume_Microsoft_Windows_PushNotifications_IPushNotificationManagerStatics< D>::Default() 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_Default(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Default(&value)); } return winrt::Microsoft::Windows::PushNotifications::PushNotificationManager{ value, take_ownership_from_abi}; } template auto consume_Microsoft_Windows_PushNotifications_IPushNotificationReceivedEventArgs< D>::Payload() const { uint32_t value_impl_size{}; uint8_t* 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_Payload(&value_impl_size, &value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Payload(&value_impl_size, &value)); } return com_array{value, value_impl_size, take_ownership_from_abi}; } template auto consume_Microsoft_Windows_PushNotifications_IPushNotificationReceivedEventArgs< D>::GetDeferral() const { void* result{}; 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->GetDeferral(&result)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->GetDeferral(&result)); } return winrt::Windows::ApplicationModel::Background::BackgroundTaskDeferral{ result, take_ownership_from_abi}; } template auto consume_Microsoft_Windows_PushNotifications_IPushNotificationReceivedEventArgs< D>::Canceled(winrt::Windows::ApplicationModel::Background:: BackgroundTaskCanceledEventHandler const& handler) const { winrt::event_token token{}; 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->add_Canceled(*(void**)(&handler), put_abi(token))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult( _winrt_abi_type->add_Canceled(*(void**)(&handler), put_abi(token))); } return token; } template auto consume_Microsoft_Windows_PushNotifications_IPushNotificationReceivedEventArgs< D>::Canceled(auto_revoke_t, winrt::Windows::ApplicationModel::Background:: BackgroundTaskCanceledEventHandler const& handler) const { return impl::make_event_revoker(this, Canceled(handler)); } template auto consume_Microsoft_Windows_PushNotifications_IPushNotificationReceivedEventArgs< D>::Canceled(winrt::event_token const& token) const noexcept { 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; _winrt_abi_type->remove_Canceled(impl::bind_in(token)); } else { auto const _winrt_abi_type = *(abi_t**)this; _winrt_abi_type->remove_Canceled(impl::bind_in(token)); } } #ifndef WINRT_LEAN_AND_MEAN template struct produce< D, winrt::Microsoft::Windows::PushNotifications::IPushNotificationChannel> : produce_base { int32_t __stdcall get_Uri(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Uri()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_ExpirationTime(int64_t* value) noexcept final try { zero_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from( this->shim().ExpirationTime()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall Close() noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().Close(); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_Channel(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from< winrt::Microsoft::Windows::PushNotifications::PushNotificationChannel>( this->shim().Channel()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_ExtendedError(winrt::hresult* value) noexcept final try { zero_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().ExtendedError()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Status(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Status()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce< D, winrt::Microsoft::Windows::PushNotifications::IPushNotificationManager> : produce_base { int32_t __stdcall Register() noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().Register(); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall Unregister() noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().Unregister(); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall UnregisterAll() noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().UnregisterAll(); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall CreateChannelAsync(winrt::guid remoteId, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from>( this->shim().CreateChannelAsync( *reinterpret_cast(&remoteId))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall add_PushReceived(void* handler, winrt::event_token* token) noexcept final try { zero_abi(token); typename D::abi_guard guard(this->shim()); *token = detach_from(this->shim().PushReceived( *reinterpret_cast const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_PushReceived( winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().PushReceived( *reinterpret_cast(&token)); return 0; } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall IsSupported(bool* result) noexcept final try { typename D::abi_guard guard(this->shim()); *result = detach_from(this->shim().IsSupported()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Default(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from< winrt::Microsoft::Windows::PushNotifications::PushNotificationManager>( this->shim().Default()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_Payload(uint32_t* __valueSize, uint8_t** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); std::tie(*__valueSize, *value) = detach_abi(this->shim().Payload()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GetDeferral(void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from< winrt::Windows::ApplicationModel::Background::BackgroundTaskDeferral>( this->shim().GetDeferral()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall add_Canceled(void* handler, winrt::event_token* token) noexcept final try { zero_abi(token); typename D::abi_guard guard(this->shim()); *token = detach_from(this->shim().Canceled( *reinterpret_cast( &handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_Canceled(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().Canceled(*reinterpret_cast(&token)); return 0; } }; #endif } // namespace winrt::impl WINRT_EXPORT namespace winrt::Microsoft::Windows::PushNotifications { inline auto PushNotificationManager::IsSupported() { return impl::call_factory_cast< bool (*)(IPushNotificationManagerStatics const&), PushNotificationManager, IPushNotificationManagerStatics>( [](IPushNotificationManagerStatics const& f) { return f.IsSupported(); }); } inline auto PushNotificationManager::Default() { return impl::call_factory_cast< winrt::Microsoft::Windows::PushNotifications:: PushNotificationManager (*)(IPushNotificationManagerStatics const&), PushNotificationManager, IPushNotificationManagerStatics>( [](IPushNotificationManagerStatics const& f) { return f.Default(); }); } } namespace std { #ifndef WINRT_LEAN_AND_MEAN template <> struct hash< winrt::Microsoft::Windows::PushNotifications::IPushNotificationChannel> : winrt::impl::hash_base {}; template <> struct hash : winrt::impl::hash_base { }; template <> struct hash< winrt::Microsoft::Windows::PushNotifications::IPushNotificationManager> : winrt::impl::hash_base {}; template <> struct hash : winrt::impl::hash_base {}; template <> struct hash : winrt::impl::hash_base {}; template <> struct hash< winrt::Microsoft::Windows::PushNotifications::PushNotificationChannel> : winrt::impl::hash_base {}; template <> struct hash : winrt::impl::hash_base { }; template <> struct hash< winrt::Microsoft::Windows::PushNotifications::PushNotificationManager> : winrt::impl::hash_base {}; template <> struct hash : winrt::impl::hash_base {}; #endif #ifdef __cpp_lib_format #endif } // namespace std #endif