mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-15 15:16:12 -04:00
193 lines
8.2 KiB
C++
193 lines
8.2 KiB
C++
// 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 <typename D>
|
|
auto consume_Microsoft_Windows_BadgeNotifications_IBadgeNotificationManager<
|
|
D>::SetBadgeAsCount(uint32_t notificationCount) const {
|
|
if constexpr (!std::is_same_v<D,
|
|
winrt::Microsoft::Windows::BadgeNotifications::
|
|
IBadgeNotificationManager>) {
|
|
winrt::hresult _winrt_cast_result_code;
|
|
auto const _winrt_casted_result =
|
|
impl::try_as_with_reason<winrt::Microsoft::Windows::BadgeNotifications::
|
|
IBadgeNotificationManager,
|
|
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::BadgeNotifications::
|
|
IBadgeNotificationManager>**)&_winrt_casted_result;
|
|
check_hresult(_winrt_abi_type->SetBadgeAsCount(notificationCount));
|
|
} else {
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Microsoft::Windows::BadgeNotifications::
|
|
IBadgeNotificationManager>**)this;
|
|
check_hresult(_winrt_abi_type->SetBadgeAsCount(notificationCount));
|
|
}
|
|
}
|
|
template <typename D>
|
|
auto consume_Microsoft_Windows_BadgeNotifications_IBadgeNotificationManager<
|
|
D>::SetBadgeAsGlyph(winrt::Microsoft::Windows::BadgeNotifications::
|
|
BadgeNotificationGlyph const& glyphValue) const {
|
|
if constexpr (!std::is_same_v<D,
|
|
winrt::Microsoft::Windows::BadgeNotifications::
|
|
IBadgeNotificationManager>) {
|
|
winrt::hresult _winrt_cast_result_code;
|
|
auto const _winrt_casted_result =
|
|
impl::try_as_with_reason<winrt::Microsoft::Windows::BadgeNotifications::
|
|
IBadgeNotificationManager,
|
|
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::BadgeNotifications::
|
|
IBadgeNotificationManager>**)&_winrt_casted_result;
|
|
check_hresult(
|
|
_winrt_abi_type->SetBadgeAsGlyph(static_cast<int32_t>(glyphValue)));
|
|
} else {
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Microsoft::Windows::BadgeNotifications::
|
|
IBadgeNotificationManager>**)this;
|
|
check_hresult(
|
|
_winrt_abi_type->SetBadgeAsGlyph(static_cast<int32_t>(glyphValue)));
|
|
}
|
|
}
|
|
template <typename D>
|
|
auto consume_Microsoft_Windows_BadgeNotifications_IBadgeNotificationManager<
|
|
D>::ClearBadge() const {
|
|
if constexpr (!std::is_same_v<D,
|
|
winrt::Microsoft::Windows::BadgeNotifications::
|
|
IBadgeNotificationManager>) {
|
|
winrt::hresult _winrt_cast_result_code;
|
|
auto const _winrt_casted_result =
|
|
impl::try_as_with_reason<winrt::Microsoft::Windows::BadgeNotifications::
|
|
IBadgeNotificationManager,
|
|
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::BadgeNotifications::
|
|
IBadgeNotificationManager>**)&_winrt_casted_result;
|
|
check_hresult(_winrt_abi_type->ClearBadge());
|
|
} else {
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Microsoft::Windows::BadgeNotifications::
|
|
IBadgeNotificationManager>**)this;
|
|
check_hresult(_winrt_abi_type->ClearBadge());
|
|
}
|
|
}
|
|
template <typename D>
|
|
auto consume_Microsoft_Windows_BadgeNotifications_IBadgeNotificationManagerStatics<
|
|
D>::Current() const {
|
|
void* value{};
|
|
if constexpr (!std::is_same_v<D,
|
|
winrt::Microsoft::Windows::BadgeNotifications::
|
|
IBadgeNotificationManagerStatics>) {
|
|
winrt::hresult _winrt_cast_result_code;
|
|
auto const _winrt_casted_result =
|
|
impl::try_as_with_reason<winrt::Microsoft::Windows::BadgeNotifications::
|
|
IBadgeNotificationManagerStatics,
|
|
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::BadgeNotifications::
|
|
IBadgeNotificationManagerStatics>**)&_winrt_casted_result;
|
|
check_hresult(_winrt_abi_type->get_Current(&value));
|
|
} else {
|
|
auto const _winrt_abi_type =
|
|
*(abi_t<winrt::Microsoft::Windows::BadgeNotifications::
|
|
IBadgeNotificationManagerStatics>**)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 <typename D>
|
|
struct produce<
|
|
D, winrt::Microsoft::Windows::BadgeNotifications::IBadgeNotificationManager>
|
|
: produce_base<D, winrt::Microsoft::Windows::BadgeNotifications::
|
|
IBadgeNotificationManager> {
|
|
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<winrt::Microsoft::Windows::BadgeNotifications::
|
|
BadgeNotificationGlyph const*>(&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 <typename D>
|
|
struct produce<D, winrt::Microsoft::Windows::BadgeNotifications::
|
|
IBadgeNotificationManagerStatics>
|
|
: produce_base<D, winrt::Microsoft::Windows::BadgeNotifications::
|
|
IBadgeNotificationManagerStatics> {
|
|
int32_t __stdcall get_Current(void** value) noexcept final try {
|
|
clear_abi(value);
|
|
typename D::abi_guard guard(this->shim());
|
|
*value = detach_from<winrt::Microsoft::Windows::BadgeNotifications::
|
|
BadgeNotificationManager>(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::Microsoft::Windows::BadgeNotifications::
|
|
IBadgeNotificationManagerStatics> : 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
|