// WARNING: Please don't edit this file. It was generated by C++/WinRT v2.0.240405.15 #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.240405.15"), "Mismatched C++/WinRT headers."); #define CPPWINRT_VERSION "2.0.240405.15" #include "winrt/impl/Windows.ApplicationModel.Background.2.h" #include "winrt/impl/Windows.Foundation.2.h" #include "winrt/impl/Microsoft.Windows.PushNotifications.2.h" namespace winrt::impl { template auto consume_Microsoft_Windows_PushNotifications_IPushNotificationChannel::Uri() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::PushNotifications::IPushNotificationChannel)->get_Uri(&value)); return winrt::Windows::Foundation::Uri{ value, take_ownership_from_abi }; } template auto consume_Microsoft_Windows_PushNotifications_IPushNotificationChannel::ExpirationTime() const { winrt::Windows::Foundation::DateTime value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::PushNotifications::IPushNotificationChannel)->get_ExpirationTime(put_abi(value))); return value; } template auto consume_Microsoft_Windows_PushNotifications_IPushNotificationChannel::Close() const { check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::PushNotifications::IPushNotificationChannel)->Close()); } template auto consume_Microsoft_Windows_PushNotifications_IPushNotificationCreateChannelResult::Channel() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::PushNotifications::IPushNotificationCreateChannelResult)->get_Channel(&value)); return winrt::Microsoft::Windows::PushNotifications::PushNotificationChannel{ value, take_ownership_from_abi }; } template auto consume_Microsoft_Windows_PushNotifications_IPushNotificationCreateChannelResult::ExtendedError() const { winrt::hresult value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::PushNotifications::IPushNotificationCreateChannelResult)->get_ExtendedError(put_abi(value))); return value; } template auto consume_Microsoft_Windows_PushNotifications_IPushNotificationCreateChannelResult::Status() const { winrt::Microsoft::Windows::PushNotifications::PushNotificationChannelStatus value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::PushNotifications::IPushNotificationCreateChannelResult)->get_Status(reinterpret_cast(&value))); return value; } template auto consume_Microsoft_Windows_PushNotifications_IPushNotificationManager::Register() const { check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::PushNotifications::IPushNotificationManager)->Register()); } template auto consume_Microsoft_Windows_PushNotifications_IPushNotificationManager::Unregister() const { check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::PushNotifications::IPushNotificationManager)->Unregister()); } template auto consume_Microsoft_Windows_PushNotifications_IPushNotificationManager::UnregisterAll() const { check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::PushNotifications::IPushNotificationManager)->UnregisterAll()); } template auto consume_Microsoft_Windows_PushNotifications_IPushNotificationManager::CreateChannelAsync(winrt::guid const& remoteId) const { void* operation{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::PushNotifications::IPushNotificationManager)->CreateChannelAsync(impl::bind_in(remoteId), &operation)); return winrt::Windows::Foundation::IAsyncOperationWithProgress{ operation, take_ownership_from_abi }; } template auto consume_Microsoft_Windows_PushNotifications_IPushNotificationManager::PushReceived(winrt::Windows::Foundation::TypedEventHandler const& handler) const { winrt::event_token token{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::PushNotifications::IPushNotificationManager)->add_PushReceived(*(void**)(&handler), put_abi(token))); return token; } template auto consume_Microsoft_Windows_PushNotifications_IPushNotificationManager::PushReceived(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const { return impl::make_event_revoker(this, PushReceived(handler)); } template auto consume_Microsoft_Windows_PushNotifications_IPushNotificationManager::PushReceived(winrt::event_token const& token) const noexcept { WINRT_IMPL_SHIM(winrt::Microsoft::Windows::PushNotifications::IPushNotificationManager)->remove_PushReceived(impl::bind_in(token)); } template auto consume_Microsoft_Windows_PushNotifications_IPushNotificationManagerStatics::IsSupported() const { bool result{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::PushNotifications::IPushNotificationManagerStatics)->IsSupported(&result)); return result; } template auto consume_Microsoft_Windows_PushNotifications_IPushNotificationManagerStatics::Default() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::PushNotifications::IPushNotificationManagerStatics)->get_Default(&value)); return winrt::Microsoft::Windows::PushNotifications::PushNotificationManager{ value, take_ownership_from_abi }; } template auto consume_Microsoft_Windows_PushNotifications_IPushNotificationReceivedEventArgs::Payload() const { uint32_t value_impl_size{}; uint8_t* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::PushNotifications::IPushNotificationReceivedEventArgs)->get_Payload(&value_impl_size, &value)); return com_array{ value, value_impl_size, take_ownership_from_abi }; } template auto consume_Microsoft_Windows_PushNotifications_IPushNotificationReceivedEventArgs::GetDeferral() const { void* result{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::PushNotifications::IPushNotificationReceivedEventArgs)->GetDeferral(&result)); return winrt::Windows::ApplicationModel::Background::BackgroundTaskDeferral{ result, take_ownership_from_abi }; } template auto consume_Microsoft_Windows_PushNotifications_IPushNotificationReceivedEventArgs::Canceled(winrt::Windows::ApplicationModel::Background::BackgroundTaskCanceledEventHandler const& handler) const { winrt::event_token token{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::PushNotifications::IPushNotificationReceivedEventArgs)->add_Canceled(*(void**)(&handler), put_abi(token))); return token; } template auto consume_Microsoft_Windows_PushNotifications_IPushNotificationReceivedEventArgs::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::Canceled(winrt::event_token const& token) const noexcept { WINRT_IMPL_SHIM(winrt::Microsoft::Windows::PushNotifications::IPushNotificationReceivedEventArgs)->remove_Canceled(impl::bind_in(token)); } #ifndef WINRT_LEAN_AND_MEAN template struct produce : 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(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 : 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(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(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 } WINRT_EXPORT namespace winrt::Microsoft::Windows::PushNotifications { inline auto PushNotificationManager::IsSupported() { return impl::call_factory_cast([](IPushNotificationManagerStatics const& f) { return f.IsSupported(); }); } inline auto PushNotificationManager::Default() { return impl::call_factory_cast([](IPushNotificationManagerStatics const& f) { return f.Default(); }); } } 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 {}; 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