mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-16 15:36:12 -04:00
Update WinRT headers to support Windows App SDK and newer Windows SDK.
PiperOrigin-RevId: 862076081
This commit is contained in:
+756
@@ -0,0 +1,756 @@
|
||||
// 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 <typename D>
|
||||
auto consume_Microsoft_Windows_PushNotifications_IPushNotificationChannel<
|
||||
D>::Uri() const {
|
||||
void* value{};
|
||||
if constexpr (!std::is_same_v<D,
|
||||
winrt::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationChannel>) {
|
||||
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<D const*>(this), _winrt_cast_result_code);
|
||||
check_hresult(_winrt_cast_result_code);
|
||||
auto const _winrt_abi_type =
|
||||
*(abi_t<winrt::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationChannel>**)&_winrt_casted_result;
|
||||
check_hresult(_winrt_abi_type->get_Uri(&value));
|
||||
} else {
|
||||
auto const _winrt_abi_type =
|
||||
*(abi_t<winrt::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationChannel>**)this;
|
||||
check_hresult(_winrt_abi_type->get_Uri(&value));
|
||||
}
|
||||
return winrt::Windows::Foundation::Uri{value, take_ownership_from_abi};
|
||||
}
|
||||
template <typename D>
|
||||
auto consume_Microsoft_Windows_PushNotifications_IPushNotificationChannel<
|
||||
D>::ExpirationTime() const {
|
||||
winrt::Windows::Foundation::DateTime value{};
|
||||
if constexpr (!std::is_same_v<D,
|
||||
winrt::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationChannel>) {
|
||||
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<D const*>(this), _winrt_cast_result_code);
|
||||
check_hresult(_winrt_cast_result_code);
|
||||
auto const _winrt_abi_type =
|
||||
*(abi_t<winrt::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationChannel>**)&_winrt_casted_result;
|
||||
check_hresult(_winrt_abi_type->get_ExpirationTime(put_abi(value)));
|
||||
} else {
|
||||
auto const _winrt_abi_type =
|
||||
*(abi_t<winrt::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationChannel>**)this;
|
||||
check_hresult(_winrt_abi_type->get_ExpirationTime(put_abi(value)));
|
||||
}
|
||||
return value;
|
||||
}
|
||||
template <typename D>
|
||||
auto consume_Microsoft_Windows_PushNotifications_IPushNotificationChannel<
|
||||
D>::Close() const {
|
||||
if constexpr (!std::is_same_v<D,
|
||||
winrt::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationChannel>) {
|
||||
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<D const*>(this), _winrt_cast_result_code);
|
||||
check_hresult(_winrt_cast_result_code);
|
||||
auto const _winrt_abi_type =
|
||||
*(abi_t<winrt::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationChannel>**)&_winrt_casted_result;
|
||||
check_hresult(_winrt_abi_type->Close());
|
||||
} else {
|
||||
auto const _winrt_abi_type =
|
||||
*(abi_t<winrt::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationChannel>**)this;
|
||||
check_hresult(_winrt_abi_type->Close());
|
||||
}
|
||||
}
|
||||
template <typename D>
|
||||
auto consume_Microsoft_Windows_PushNotifications_IPushNotificationCreateChannelResult<
|
||||
D>::Channel() const {
|
||||
void* value{};
|
||||
if constexpr (!std::is_same_v<D,
|
||||
winrt::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationCreateChannelResult>) {
|
||||
winrt::hresult _winrt_cast_result_code;
|
||||
auto const _winrt_casted_result =
|
||||
impl::try_as_with_reason<winrt::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationCreateChannelResult,
|
||||
D const*>(static_cast<D const*>(this),
|
||||
_winrt_cast_result_code);
|
||||
check_hresult(_winrt_cast_result_code);
|
||||
auto const _winrt_abi_type = *(
|
||||
abi_t<winrt::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationCreateChannelResult>**)&_winrt_casted_result;
|
||||
check_hresult(_winrt_abi_type->get_Channel(&value));
|
||||
} else {
|
||||
auto const _winrt_abi_type =
|
||||
*(abi_t<winrt::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationCreateChannelResult>**)this;
|
||||
check_hresult(_winrt_abi_type->get_Channel(&value));
|
||||
}
|
||||
return winrt::Microsoft::Windows::PushNotifications::PushNotificationChannel{
|
||||
value, take_ownership_from_abi};
|
||||
}
|
||||
template <typename D>
|
||||
auto consume_Microsoft_Windows_PushNotifications_IPushNotificationCreateChannelResult<
|
||||
D>::ExtendedError() const {
|
||||
winrt::hresult value{};
|
||||
if constexpr (!std::is_same_v<D,
|
||||
winrt::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationCreateChannelResult>) {
|
||||
winrt::hresult _winrt_cast_result_code;
|
||||
auto const _winrt_casted_result =
|
||||
impl::try_as_with_reason<winrt::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationCreateChannelResult,
|
||||
D const*>(static_cast<D const*>(this),
|
||||
_winrt_cast_result_code);
|
||||
check_hresult(_winrt_cast_result_code);
|
||||
auto const _winrt_abi_type = *(
|
||||
abi_t<winrt::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationCreateChannelResult>**)&_winrt_casted_result;
|
||||
check_hresult(_winrt_abi_type->get_ExtendedError(put_abi(value)));
|
||||
} else {
|
||||
auto const _winrt_abi_type =
|
||||
*(abi_t<winrt::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationCreateChannelResult>**)this;
|
||||
check_hresult(_winrt_abi_type->get_ExtendedError(put_abi(value)));
|
||||
}
|
||||
return value;
|
||||
}
|
||||
template <typename D>
|
||||
auto consume_Microsoft_Windows_PushNotifications_IPushNotificationCreateChannelResult<
|
||||
D>::Status() const {
|
||||
winrt::Microsoft::Windows::PushNotifications::PushNotificationChannelStatus
|
||||
value{};
|
||||
if constexpr (!std::is_same_v<D,
|
||||
winrt::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationCreateChannelResult>) {
|
||||
winrt::hresult _winrt_cast_result_code;
|
||||
auto const _winrt_casted_result =
|
||||
impl::try_as_with_reason<winrt::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationCreateChannelResult,
|
||||
D const*>(static_cast<D const*>(this),
|
||||
_winrt_cast_result_code);
|
||||
check_hresult(_winrt_cast_result_code);
|
||||
auto const _winrt_abi_type = *(
|
||||
abi_t<winrt::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationCreateChannelResult>**)&_winrt_casted_result;
|
||||
check_hresult(
|
||||
_winrt_abi_type->get_Status(reinterpret_cast<int32_t*>(&value)));
|
||||
} else {
|
||||
auto const _winrt_abi_type =
|
||||
*(abi_t<winrt::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationCreateChannelResult>**)this;
|
||||
check_hresult(
|
||||
_winrt_abi_type->get_Status(reinterpret_cast<int32_t*>(&value)));
|
||||
}
|
||||
return value;
|
||||
}
|
||||
template <typename D>
|
||||
auto consume_Microsoft_Windows_PushNotifications_IPushNotificationManager<
|
||||
D>::Register() const {
|
||||
if constexpr (!std::is_same_v<D,
|
||||
winrt::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationManager>) {
|
||||
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<D const*>(this), _winrt_cast_result_code);
|
||||
check_hresult(_winrt_cast_result_code);
|
||||
auto const _winrt_abi_type =
|
||||
*(abi_t<winrt::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationManager>**)&_winrt_casted_result;
|
||||
check_hresult(_winrt_abi_type->Register());
|
||||
} else {
|
||||
auto const _winrt_abi_type =
|
||||
*(abi_t<winrt::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationManager>**)this;
|
||||
check_hresult(_winrt_abi_type->Register());
|
||||
}
|
||||
}
|
||||
template <typename D>
|
||||
auto consume_Microsoft_Windows_PushNotifications_IPushNotificationManager<
|
||||
D>::Unregister() const {
|
||||
if constexpr (!std::is_same_v<D,
|
||||
winrt::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationManager>) {
|
||||
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<D const*>(this), _winrt_cast_result_code);
|
||||
check_hresult(_winrt_cast_result_code);
|
||||
auto const _winrt_abi_type =
|
||||
*(abi_t<winrt::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationManager>**)&_winrt_casted_result;
|
||||
check_hresult(_winrt_abi_type->Unregister());
|
||||
} else {
|
||||
auto const _winrt_abi_type =
|
||||
*(abi_t<winrt::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationManager>**)this;
|
||||
check_hresult(_winrt_abi_type->Unregister());
|
||||
}
|
||||
}
|
||||
template <typename D>
|
||||
auto consume_Microsoft_Windows_PushNotifications_IPushNotificationManager<
|
||||
D>::UnregisterAll() const {
|
||||
if constexpr (!std::is_same_v<D,
|
||||
winrt::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationManager>) {
|
||||
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<D const*>(this), _winrt_cast_result_code);
|
||||
check_hresult(_winrt_cast_result_code);
|
||||
auto const _winrt_abi_type =
|
||||
*(abi_t<winrt::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationManager>**)&_winrt_casted_result;
|
||||
check_hresult(_winrt_abi_type->UnregisterAll());
|
||||
} else {
|
||||
auto const _winrt_abi_type =
|
||||
*(abi_t<winrt::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationManager>**)this;
|
||||
check_hresult(_winrt_abi_type->UnregisterAll());
|
||||
}
|
||||
}
|
||||
template <typename D>
|
||||
auto consume_Microsoft_Windows_PushNotifications_IPushNotificationManager<
|
||||
D>::CreateChannelAsync(winrt::guid const& remoteId) const {
|
||||
void* operation{};
|
||||
if constexpr (!std::is_same_v<D,
|
||||
winrt::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationManager>) {
|
||||
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<D const*>(this), _winrt_cast_result_code);
|
||||
check_hresult(_winrt_cast_result_code);
|
||||
auto const _winrt_abi_type =
|
||||
*(abi_t<winrt::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationManager>**)&_winrt_casted_result;
|
||||
check_hresult(_winrt_abi_type->CreateChannelAsync(impl::bind_in(remoteId),
|
||||
&operation));
|
||||
} else {
|
||||
auto const _winrt_abi_type =
|
||||
*(abi_t<winrt::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationManager>**)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 <typename D>
|
||||
auto consume_Microsoft_Windows_PushNotifications_IPushNotificationManager<D>::
|
||||
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<D,
|
||||
winrt::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationManager>) {
|
||||
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<D const*>(this), _winrt_cast_result_code);
|
||||
check_hresult(_winrt_cast_result_code);
|
||||
auto const _winrt_abi_type =
|
||||
*(abi_t<winrt::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationManager>**)&_winrt_casted_result;
|
||||
check_hresult(
|
||||
_winrt_abi_type->add_PushReceived(*(void**)(&handler), put_abi(token)));
|
||||
} else {
|
||||
auto const _winrt_abi_type =
|
||||
*(abi_t<winrt::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationManager>**)this;
|
||||
check_hresult(
|
||||
_winrt_abi_type->add_PushReceived(*(void**)(&handler), put_abi(token)));
|
||||
}
|
||||
return token;
|
||||
}
|
||||
template <typename D>
|
||||
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<D, PushReceived_revoker>(
|
||||
this, PushReceived(handler));
|
||||
}
|
||||
template <typename D>
|
||||
auto consume_Microsoft_Windows_PushNotifications_IPushNotificationManager<
|
||||
D>::PushReceived(winrt::event_token const& token) const noexcept {
|
||||
if constexpr (!std::is_same_v<D,
|
||||
winrt::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationManager>) {
|
||||
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<D const*>(this), _winrt_cast_result_code);
|
||||
check_hresult(_winrt_cast_result_code);
|
||||
auto const _winrt_abi_type =
|
||||
*(abi_t<winrt::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationManager>**)&_winrt_casted_result;
|
||||
_winrt_abi_type->remove_PushReceived(impl::bind_in(token));
|
||||
} else {
|
||||
auto const _winrt_abi_type =
|
||||
*(abi_t<winrt::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationManager>**)this;
|
||||
_winrt_abi_type->remove_PushReceived(impl::bind_in(token));
|
||||
}
|
||||
}
|
||||
template <typename D>
|
||||
auto consume_Microsoft_Windows_PushNotifications_IPushNotificationManagerStatics<
|
||||
D>::IsSupported() const {
|
||||
bool result{};
|
||||
if constexpr (!std::is_same_v<D,
|
||||
winrt::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationManagerStatics>) {
|
||||
winrt::hresult _winrt_cast_result_code;
|
||||
auto const _winrt_casted_result =
|
||||
impl::try_as_with_reason<winrt::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationManagerStatics,
|
||||
D const*>(static_cast<D const*>(this),
|
||||
_winrt_cast_result_code);
|
||||
check_hresult(_winrt_cast_result_code);
|
||||
auto const _winrt_abi_type =
|
||||
*(abi_t<winrt::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationManagerStatics>**)&_winrt_casted_result;
|
||||
check_hresult(_winrt_abi_type->IsSupported(&result));
|
||||
} else {
|
||||
auto const _winrt_abi_type =
|
||||
*(abi_t<winrt::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationManagerStatics>**)this;
|
||||
check_hresult(_winrt_abi_type->IsSupported(&result));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
template <typename D>
|
||||
auto consume_Microsoft_Windows_PushNotifications_IPushNotificationManagerStatics<
|
||||
D>::Default() const {
|
||||
void* value{};
|
||||
if constexpr (!std::is_same_v<D,
|
||||
winrt::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationManagerStatics>) {
|
||||
winrt::hresult _winrt_cast_result_code;
|
||||
auto const _winrt_casted_result =
|
||||
impl::try_as_with_reason<winrt::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationManagerStatics,
|
||||
D const*>(static_cast<D const*>(this),
|
||||
_winrt_cast_result_code);
|
||||
check_hresult(_winrt_cast_result_code);
|
||||
auto const _winrt_abi_type =
|
||||
*(abi_t<winrt::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationManagerStatics>**)&_winrt_casted_result;
|
||||
check_hresult(_winrt_abi_type->get_Default(&value));
|
||||
} else {
|
||||
auto const _winrt_abi_type =
|
||||
*(abi_t<winrt::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationManagerStatics>**)this;
|
||||
check_hresult(_winrt_abi_type->get_Default(&value));
|
||||
}
|
||||
return winrt::Microsoft::Windows::PushNotifications::PushNotificationManager{
|
||||
value, take_ownership_from_abi};
|
||||
}
|
||||
template <typename D>
|
||||
auto consume_Microsoft_Windows_PushNotifications_IPushNotificationReceivedEventArgs<
|
||||
D>::Payload() const {
|
||||
uint32_t value_impl_size{};
|
||||
uint8_t* value{};
|
||||
if constexpr (!std::is_same_v<D,
|
||||
winrt::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationReceivedEventArgs>) {
|
||||
winrt::hresult _winrt_cast_result_code;
|
||||
auto const _winrt_casted_result =
|
||||
impl::try_as_with_reason<winrt::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationReceivedEventArgs,
|
||||
D const*>(static_cast<D const*>(this),
|
||||
_winrt_cast_result_code);
|
||||
check_hresult(_winrt_cast_result_code);
|
||||
auto const _winrt_abi_type =
|
||||
*(abi_t<winrt::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationReceivedEventArgs>**)&_winrt_casted_result;
|
||||
check_hresult(_winrt_abi_type->get_Payload(&value_impl_size, &value));
|
||||
} else {
|
||||
auto const _winrt_abi_type =
|
||||
*(abi_t<winrt::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationReceivedEventArgs>**)this;
|
||||
check_hresult(_winrt_abi_type->get_Payload(&value_impl_size, &value));
|
||||
}
|
||||
return com_array<uint8_t>{value, value_impl_size, take_ownership_from_abi};
|
||||
}
|
||||
template <typename D>
|
||||
auto consume_Microsoft_Windows_PushNotifications_IPushNotificationReceivedEventArgs<
|
||||
D>::GetDeferral() const {
|
||||
void* result{};
|
||||
if constexpr (!std::is_same_v<D,
|
||||
winrt::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationReceivedEventArgs>) {
|
||||
winrt::hresult _winrt_cast_result_code;
|
||||
auto const _winrt_casted_result =
|
||||
impl::try_as_with_reason<winrt::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationReceivedEventArgs,
|
||||
D const*>(static_cast<D const*>(this),
|
||||
_winrt_cast_result_code);
|
||||
check_hresult(_winrt_cast_result_code);
|
||||
auto const _winrt_abi_type =
|
||||
*(abi_t<winrt::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationReceivedEventArgs>**)&_winrt_casted_result;
|
||||
check_hresult(_winrt_abi_type->GetDeferral(&result));
|
||||
} else {
|
||||
auto const _winrt_abi_type =
|
||||
*(abi_t<winrt::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationReceivedEventArgs>**)this;
|
||||
check_hresult(_winrt_abi_type->GetDeferral(&result));
|
||||
}
|
||||
return winrt::Windows::ApplicationModel::Background::BackgroundTaskDeferral{
|
||||
result, take_ownership_from_abi};
|
||||
}
|
||||
template <typename D>
|
||||
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<D,
|
||||
winrt::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationReceivedEventArgs>) {
|
||||
winrt::hresult _winrt_cast_result_code;
|
||||
auto const _winrt_casted_result =
|
||||
impl::try_as_with_reason<winrt::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationReceivedEventArgs,
|
||||
D const*>(static_cast<D const*>(this),
|
||||
_winrt_cast_result_code);
|
||||
check_hresult(_winrt_cast_result_code);
|
||||
auto const _winrt_abi_type =
|
||||
*(abi_t<winrt::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationReceivedEventArgs>**)&_winrt_casted_result;
|
||||
check_hresult(
|
||||
_winrt_abi_type->add_Canceled(*(void**)(&handler), put_abi(token)));
|
||||
} else {
|
||||
auto const _winrt_abi_type =
|
||||
*(abi_t<winrt::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationReceivedEventArgs>**)this;
|
||||
check_hresult(
|
||||
_winrt_abi_type->add_Canceled(*(void**)(&handler), put_abi(token)));
|
||||
}
|
||||
return token;
|
||||
}
|
||||
template <typename D>
|
||||
auto consume_Microsoft_Windows_PushNotifications_IPushNotificationReceivedEventArgs<
|
||||
D>::Canceled(auto_revoke_t,
|
||||
winrt::Windows::ApplicationModel::Background::
|
||||
BackgroundTaskCanceledEventHandler const& handler) const {
|
||||
return impl::make_event_revoker<D, Canceled_revoker>(this, Canceled(handler));
|
||||
}
|
||||
template <typename D>
|
||||
auto consume_Microsoft_Windows_PushNotifications_IPushNotificationReceivedEventArgs<
|
||||
D>::Canceled(winrt::event_token const& token) const noexcept {
|
||||
if constexpr (!std::is_same_v<D,
|
||||
winrt::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationReceivedEventArgs>) {
|
||||
winrt::hresult _winrt_cast_result_code;
|
||||
auto const _winrt_casted_result =
|
||||
impl::try_as_with_reason<winrt::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationReceivedEventArgs,
|
||||
D const*>(static_cast<D const*>(this),
|
||||
_winrt_cast_result_code);
|
||||
check_hresult(_winrt_cast_result_code);
|
||||
auto const _winrt_abi_type =
|
||||
*(abi_t<winrt::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationReceivedEventArgs>**)&_winrt_casted_result;
|
||||
_winrt_abi_type->remove_Canceled(impl::bind_in(token));
|
||||
} else {
|
||||
auto const _winrt_abi_type =
|
||||
*(abi_t<winrt::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationReceivedEventArgs>**)this;
|
||||
_winrt_abi_type->remove_Canceled(impl::bind_in(token));
|
||||
}
|
||||
}
|
||||
#ifndef WINRT_LEAN_AND_MEAN
|
||||
template <typename D>
|
||||
struct produce<
|
||||
D, winrt::Microsoft::Windows::PushNotifications::IPushNotificationChannel>
|
||||
: produce_base<D, winrt::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationChannel> {
|
||||
int32_t __stdcall get_Uri(void** value) noexcept final try {
|
||||
clear_abi(value);
|
||||
typename D::abi_guard guard(this->shim());
|
||||
*value = detach_from<winrt::Windows::Foundation::Uri>(this->shim().Uri());
|
||||
return 0;
|
||||
} catch (...) {
|
||||
return to_hresult();
|
||||
}
|
||||
int32_t __stdcall get_ExpirationTime(int64_t* value) noexcept final try {
|
||||
zero_abi<winrt::Windows::Foundation::DateTime>(value);
|
||||
typename D::abi_guard guard(this->shim());
|
||||
*value = detach_from<winrt::Windows::Foundation::DateTime>(
|
||||
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 <typename D>
|
||||
struct produce<D, winrt::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationCreateChannelResult>
|
||||
: produce_base<D, winrt::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationCreateChannelResult> {
|
||||
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<winrt::hresult>(value);
|
||||
typename D::abi_guard guard(this->shim());
|
||||
*value = detach_from<winrt::hresult>(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<winrt::Microsoft::Windows::PushNotifications::
|
||||
PushNotificationChannelStatus>(this->shim().Status());
|
||||
return 0;
|
||||
} catch (...) {
|
||||
return to_hresult();
|
||||
}
|
||||
};
|
||||
#endif
|
||||
#ifndef WINRT_LEAN_AND_MEAN
|
||||
template <typename D>
|
||||
struct produce<
|
||||
D, winrt::Microsoft::Windows::PushNotifications::IPushNotificationManager>
|
||||
: produce_base<D, winrt::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationManager> {
|
||||
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<winrt::Windows::Foundation::IAsyncOperationWithProgress<
|
||||
winrt::Microsoft::Windows::PushNotifications::
|
||||
PushNotificationCreateChannelResult,
|
||||
winrt::Microsoft::Windows::PushNotifications::
|
||||
PushNotificationCreateChannelStatus>>(
|
||||
this->shim().CreateChannelAsync(
|
||||
*reinterpret_cast<winrt::guid const*>(&remoteId)));
|
||||
return 0;
|
||||
} catch (...) {
|
||||
return to_hresult();
|
||||
}
|
||||
int32_t __stdcall add_PushReceived(void* handler,
|
||||
winrt::event_token* token) noexcept final
|
||||
try {
|
||||
zero_abi<winrt::event_token>(token);
|
||||
typename D::abi_guard guard(this->shim());
|
||||
*token = detach_from<winrt::event_token>(this->shim().PushReceived(
|
||||
*reinterpret_cast<winrt::Windows::Foundation::TypedEventHandler<
|
||||
winrt::Microsoft::Windows::PushNotifications::
|
||||
PushNotificationManager,
|
||||
winrt::Microsoft::Windows::PushNotifications::
|
||||
PushNotificationReceivedEventArgs> 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<winrt::event_token const*>(&token));
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
#endif
|
||||
#ifndef WINRT_LEAN_AND_MEAN
|
||||
template <typename D>
|
||||
struct produce<D, winrt::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationManagerStatics>
|
||||
: produce_base<D, winrt::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationManagerStatics> {
|
||||
int32_t __stdcall IsSupported(bool* result) noexcept final try {
|
||||
typename D::abi_guard guard(this->shim());
|
||||
*result = detach_from<bool>(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 <typename D>
|
||||
struct produce<D, winrt::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationReceivedEventArgs>
|
||||
: produce_base<D, winrt::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationReceivedEventArgs> {
|
||||
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<winrt::event_token>(token);
|
||||
typename D::abi_guard guard(this->shim());
|
||||
*token = detach_from<winrt::event_token>(this->shim().Canceled(
|
||||
*reinterpret_cast<winrt::Windows::ApplicationModel::Background::
|
||||
BackgroundTaskCanceledEventHandler const*>(
|
||||
&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<winrt::event_token const*>(&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::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationCreateChannelResult> : winrt::impl::hash_base {
|
||||
};
|
||||
template <>
|
||||
struct hash<
|
||||
winrt::Microsoft::Windows::PushNotifications::IPushNotificationManager>
|
||||
: winrt::impl::hash_base {};
|
||||
template <>
|
||||
struct hash<winrt::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationManagerStatics> : winrt::impl::hash_base {};
|
||||
template <>
|
||||
struct hash<winrt::Microsoft::Windows::PushNotifications::
|
||||
IPushNotificationReceivedEventArgs> : winrt::impl::hash_base {};
|
||||
template <>
|
||||
struct hash<
|
||||
winrt::Microsoft::Windows::PushNotifications::PushNotificationChannel>
|
||||
: winrt::impl::hash_base {};
|
||||
template <>
|
||||
struct hash<winrt::Microsoft::Windows::PushNotifications::
|
||||
PushNotificationCreateChannelResult> : winrt::impl::hash_base {
|
||||
};
|
||||
template <>
|
||||
struct hash<
|
||||
winrt::Microsoft::Windows::PushNotifications::PushNotificationManager>
|
||||
: winrt::impl::hash_base {};
|
||||
template <>
|
||||
struct hash<winrt::Microsoft::Windows::PushNotifications::
|
||||
PushNotificationReceivedEventArgs> : winrt::impl::hash_base {};
|
||||
#endif
|
||||
#ifdef __cpp_lib_format
|
||||
#endif
|
||||
} // namespace std
|
||||
#endif
|
||||
Reference in New Issue
Block a user