Update WinRT to new version 2.0.250303.1

PiperOrigin-RevId: 781075193
This commit is contained in:
Guogang Li
2025-07-09 08:58:00 -07:00
committed by Copybara-Service
parent 5e558cffc4
commit 8f14bd10fc
1395 changed files with 498490 additions and 61973 deletions
@@ -1,11 +1,11 @@
// WARNING: Please don't edit this file. It was generated by C++/WinRT v2.0.220531.1
// WARNING: Please don't edit this file. It was generated by C++/WinRT v2.0.250303.1
#pragma once
#ifndef WINRT_Windows_System_Power_H
#define WINRT_Windows_System_Power_H
#include "winrt/base.h"
static_assert(winrt::check_version(CPPWINRT_VERSION, "2.0.220531.1"), "Mismatched C++/WinRT headers.");
#define CPPWINRT_VERSION "2.0.220531.1"
static_assert(winrt::check_version(CPPWINRT_VERSION, "2.0.250303.1"), "Mismatched C++/WinRT headers.");
#define CPPWINRT_VERSION "2.0.250303.1"
#include "winrt/Windows.System.h"
#include "winrt/impl/Windows.Foundation.2.h"
#include "winrt/impl/Windows.System.Power.2.h"
@@ -14,55 +14,163 @@ namespace winrt::impl
template <typename D> auto consume_Windows_System_Power_IBackgroundEnergyManagerStatics<D>::LowUsageLevel() const
{
uint32_t value{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::System::Power::IBackgroundEnergyManagerStatics)->get_LowUsageLevel(&value));
if constexpr (!std::is_same_v<D, winrt::Windows::System::Power::IBackgroundEnergyManagerStatics>)
{
winrt::hresult _winrt_cast_result_code;
auto const _winrt_casted_result = impl::try_as_with_reason<winrt::Windows::System::Power::IBackgroundEnergyManagerStatics, 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::Windows::System::Power::IBackgroundEnergyManagerStatics>**)&_winrt_casted_result;
check_hresult(_winrt_abi_type->get_LowUsageLevel(&value));
}
else
{
auto const _winrt_abi_type = *(abi_t<winrt::Windows::System::Power::IBackgroundEnergyManagerStatics>**)this;
check_hresult(_winrt_abi_type->get_LowUsageLevel(&value));
}
return value;
}
template <typename D> auto consume_Windows_System_Power_IBackgroundEnergyManagerStatics<D>::NearMaxAcceptableUsageLevel() const
{
uint32_t value{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::System::Power::IBackgroundEnergyManagerStatics)->get_NearMaxAcceptableUsageLevel(&value));
if constexpr (!std::is_same_v<D, winrt::Windows::System::Power::IBackgroundEnergyManagerStatics>)
{
winrt::hresult _winrt_cast_result_code;
auto const _winrt_casted_result = impl::try_as_with_reason<winrt::Windows::System::Power::IBackgroundEnergyManagerStatics, 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::Windows::System::Power::IBackgroundEnergyManagerStatics>**)&_winrt_casted_result;
check_hresult(_winrt_abi_type->get_NearMaxAcceptableUsageLevel(&value));
}
else
{
auto const _winrt_abi_type = *(abi_t<winrt::Windows::System::Power::IBackgroundEnergyManagerStatics>**)this;
check_hresult(_winrt_abi_type->get_NearMaxAcceptableUsageLevel(&value));
}
return value;
}
template <typename D> auto consume_Windows_System_Power_IBackgroundEnergyManagerStatics<D>::MaxAcceptableUsageLevel() const
{
uint32_t value{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::System::Power::IBackgroundEnergyManagerStatics)->get_MaxAcceptableUsageLevel(&value));
if constexpr (!std::is_same_v<D, winrt::Windows::System::Power::IBackgroundEnergyManagerStatics>)
{
winrt::hresult _winrt_cast_result_code;
auto const _winrt_casted_result = impl::try_as_with_reason<winrt::Windows::System::Power::IBackgroundEnergyManagerStatics, 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::Windows::System::Power::IBackgroundEnergyManagerStatics>**)&_winrt_casted_result;
check_hresult(_winrt_abi_type->get_MaxAcceptableUsageLevel(&value));
}
else
{
auto const _winrt_abi_type = *(abi_t<winrt::Windows::System::Power::IBackgroundEnergyManagerStatics>**)this;
check_hresult(_winrt_abi_type->get_MaxAcceptableUsageLevel(&value));
}
return value;
}
template <typename D> auto consume_Windows_System_Power_IBackgroundEnergyManagerStatics<D>::ExcessiveUsageLevel() const
{
uint32_t value{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::System::Power::IBackgroundEnergyManagerStatics)->get_ExcessiveUsageLevel(&value));
if constexpr (!std::is_same_v<D, winrt::Windows::System::Power::IBackgroundEnergyManagerStatics>)
{
winrt::hresult _winrt_cast_result_code;
auto const _winrt_casted_result = impl::try_as_with_reason<winrt::Windows::System::Power::IBackgroundEnergyManagerStatics, 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::Windows::System::Power::IBackgroundEnergyManagerStatics>**)&_winrt_casted_result;
check_hresult(_winrt_abi_type->get_ExcessiveUsageLevel(&value));
}
else
{
auto const _winrt_abi_type = *(abi_t<winrt::Windows::System::Power::IBackgroundEnergyManagerStatics>**)this;
check_hresult(_winrt_abi_type->get_ExcessiveUsageLevel(&value));
}
return value;
}
template <typename D> auto consume_Windows_System_Power_IBackgroundEnergyManagerStatics<D>::NearTerminationUsageLevel() const
{
uint32_t value{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::System::Power::IBackgroundEnergyManagerStatics)->get_NearTerminationUsageLevel(&value));
if constexpr (!std::is_same_v<D, winrt::Windows::System::Power::IBackgroundEnergyManagerStatics>)
{
winrt::hresult _winrt_cast_result_code;
auto const _winrt_casted_result = impl::try_as_with_reason<winrt::Windows::System::Power::IBackgroundEnergyManagerStatics, 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::Windows::System::Power::IBackgroundEnergyManagerStatics>**)&_winrt_casted_result;
check_hresult(_winrt_abi_type->get_NearTerminationUsageLevel(&value));
}
else
{
auto const _winrt_abi_type = *(abi_t<winrt::Windows::System::Power::IBackgroundEnergyManagerStatics>**)this;
check_hresult(_winrt_abi_type->get_NearTerminationUsageLevel(&value));
}
return value;
}
template <typename D> auto consume_Windows_System_Power_IBackgroundEnergyManagerStatics<D>::TerminationUsageLevel() const
{
uint32_t value{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::System::Power::IBackgroundEnergyManagerStatics)->get_TerminationUsageLevel(&value));
if constexpr (!std::is_same_v<D, winrt::Windows::System::Power::IBackgroundEnergyManagerStatics>)
{
winrt::hresult _winrt_cast_result_code;
auto const _winrt_casted_result = impl::try_as_with_reason<winrt::Windows::System::Power::IBackgroundEnergyManagerStatics, 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::Windows::System::Power::IBackgroundEnergyManagerStatics>**)&_winrt_casted_result;
check_hresult(_winrt_abi_type->get_TerminationUsageLevel(&value));
}
else
{
auto const _winrt_abi_type = *(abi_t<winrt::Windows::System::Power::IBackgroundEnergyManagerStatics>**)this;
check_hresult(_winrt_abi_type->get_TerminationUsageLevel(&value));
}
return value;
}
template <typename D> auto consume_Windows_System_Power_IBackgroundEnergyManagerStatics<D>::RecentEnergyUsage() const
{
uint32_t value{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::System::Power::IBackgroundEnergyManagerStatics)->get_RecentEnergyUsage(&value));
if constexpr (!std::is_same_v<D, winrt::Windows::System::Power::IBackgroundEnergyManagerStatics>)
{
winrt::hresult _winrt_cast_result_code;
auto const _winrt_casted_result = impl::try_as_with_reason<winrt::Windows::System::Power::IBackgroundEnergyManagerStatics, 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::Windows::System::Power::IBackgroundEnergyManagerStatics>**)&_winrt_casted_result;
check_hresult(_winrt_abi_type->get_RecentEnergyUsage(&value));
}
else
{
auto const _winrt_abi_type = *(abi_t<winrt::Windows::System::Power::IBackgroundEnergyManagerStatics>**)this;
check_hresult(_winrt_abi_type->get_RecentEnergyUsage(&value));
}
return value;
}
template <typename D> auto consume_Windows_System_Power_IBackgroundEnergyManagerStatics<D>::RecentEnergyUsageLevel() const
{
uint32_t value{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::System::Power::IBackgroundEnergyManagerStatics)->get_RecentEnergyUsageLevel(&value));
if constexpr (!std::is_same_v<D, winrt::Windows::System::Power::IBackgroundEnergyManagerStatics>)
{
winrt::hresult _winrt_cast_result_code;
auto const _winrt_casted_result = impl::try_as_with_reason<winrt::Windows::System::Power::IBackgroundEnergyManagerStatics, 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::Windows::System::Power::IBackgroundEnergyManagerStatics>**)&_winrt_casted_result;
check_hresult(_winrt_abi_type->get_RecentEnergyUsageLevel(&value));
}
else
{
auto const _winrt_abi_type = *(abi_t<winrt::Windows::System::Power::IBackgroundEnergyManagerStatics>**)this;
check_hresult(_winrt_abi_type->get_RecentEnergyUsageLevel(&value));
}
return value;
}
template <typename D> auto consume_Windows_System_Power_IBackgroundEnergyManagerStatics<D>::RecentEnergyUsageIncreased(winrt::Windows::Foundation::EventHandler<winrt::Windows::Foundation::IInspectable> const& handler) const
{
winrt::event_token token{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::System::Power::IBackgroundEnergyManagerStatics)->add_RecentEnergyUsageIncreased(*(void**)(&handler), put_abi(token)));
if constexpr (!std::is_same_v<D, winrt::Windows::System::Power::IBackgroundEnergyManagerStatics>)
{
winrt::hresult _winrt_cast_result_code;
auto const _winrt_casted_result = impl::try_as_with_reason<winrt::Windows::System::Power::IBackgroundEnergyManagerStatics, 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::Windows::System::Power::IBackgroundEnergyManagerStatics>**)&_winrt_casted_result;
check_hresult(_winrt_abi_type->add_RecentEnergyUsageIncreased(*(void**)(&handler), put_abi(token)));
}
else
{
auto const _winrt_abi_type = *(abi_t<winrt::Windows::System::Power::IBackgroundEnergyManagerStatics>**)this;
check_hresult(_winrt_abi_type->add_RecentEnergyUsageIncreased(*(void**)(&handler), put_abi(token)));
}
return token;
}
template <typename D> auto consume_Windows_System_Power_IBackgroundEnergyManagerStatics<D>::RecentEnergyUsageIncreased(auto_revoke_t, winrt::Windows::Foundation::EventHandler<winrt::Windows::Foundation::IInspectable> const& handler) const
@@ -71,12 +179,36 @@ namespace winrt::impl
}
template <typename D> auto consume_Windows_System_Power_IBackgroundEnergyManagerStatics<D>::RecentEnergyUsageIncreased(winrt::event_token const& token) const noexcept
{
WINRT_IMPL_SHIM(winrt::Windows::System::Power::IBackgroundEnergyManagerStatics)->remove_RecentEnergyUsageIncreased(impl::bind_in(token));
if constexpr (!std::is_same_v<D, winrt::Windows::System::Power::IBackgroundEnergyManagerStatics>)
{
winrt::hresult _winrt_cast_result_code;
auto const _winrt_casted_result = impl::try_as_with_reason<winrt::Windows::System::Power::IBackgroundEnergyManagerStatics, 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::Windows::System::Power::IBackgroundEnergyManagerStatics>**)&_winrt_casted_result;
_winrt_abi_type->remove_RecentEnergyUsageIncreased(impl::bind_in(token));
}
else
{
auto const _winrt_abi_type = *(abi_t<winrt::Windows::System::Power::IBackgroundEnergyManagerStatics>**)this;
_winrt_abi_type->remove_RecentEnergyUsageIncreased(impl::bind_in(token));
}
}
template <typename D> auto consume_Windows_System_Power_IBackgroundEnergyManagerStatics<D>::RecentEnergyUsageReturnedToLow(winrt::Windows::Foundation::EventHandler<winrt::Windows::Foundation::IInspectable> const& handler) const
{
winrt::event_token token{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::System::Power::IBackgroundEnergyManagerStatics)->add_RecentEnergyUsageReturnedToLow(*(void**)(&handler), put_abi(token)));
if constexpr (!std::is_same_v<D, winrt::Windows::System::Power::IBackgroundEnergyManagerStatics>)
{
winrt::hresult _winrt_cast_result_code;
auto const _winrt_casted_result = impl::try_as_with_reason<winrt::Windows::System::Power::IBackgroundEnergyManagerStatics, 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::Windows::System::Power::IBackgroundEnergyManagerStatics>**)&_winrt_casted_result;
check_hresult(_winrt_abi_type->add_RecentEnergyUsageReturnedToLow(*(void**)(&handler), put_abi(token)));
}
else
{
auto const _winrt_abi_type = *(abi_t<winrt::Windows::System::Power::IBackgroundEnergyManagerStatics>**)this;
check_hresult(_winrt_abi_type->add_RecentEnergyUsageReturnedToLow(*(void**)(&handler), put_abi(token)));
}
return token;
}
template <typename D> auto consume_Windows_System_Power_IBackgroundEnergyManagerStatics<D>::RecentEnergyUsageReturnedToLow(auto_revoke_t, winrt::Windows::Foundation::EventHandler<winrt::Windows::Foundation::IInspectable> const& handler) const
@@ -85,48 +217,144 @@ namespace winrt::impl
}
template <typename D> auto consume_Windows_System_Power_IBackgroundEnergyManagerStatics<D>::RecentEnergyUsageReturnedToLow(winrt::event_token const& token) const noexcept
{
WINRT_IMPL_SHIM(winrt::Windows::System::Power::IBackgroundEnergyManagerStatics)->remove_RecentEnergyUsageReturnedToLow(impl::bind_in(token));
if constexpr (!std::is_same_v<D, winrt::Windows::System::Power::IBackgroundEnergyManagerStatics>)
{
winrt::hresult _winrt_cast_result_code;
auto const _winrt_casted_result = impl::try_as_with_reason<winrt::Windows::System::Power::IBackgroundEnergyManagerStatics, 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::Windows::System::Power::IBackgroundEnergyManagerStatics>**)&_winrt_casted_result;
_winrt_abi_type->remove_RecentEnergyUsageReturnedToLow(impl::bind_in(token));
}
else
{
auto const _winrt_abi_type = *(abi_t<winrt::Windows::System::Power::IBackgroundEnergyManagerStatics>**)this;
_winrt_abi_type->remove_RecentEnergyUsageReturnedToLow(impl::bind_in(token));
}
}
template <typename D> auto consume_Windows_System_Power_IForegroundEnergyManagerStatics<D>::LowUsageLevel() const
{
uint32_t value{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::System::Power::IForegroundEnergyManagerStatics)->get_LowUsageLevel(&value));
if constexpr (!std::is_same_v<D, winrt::Windows::System::Power::IForegroundEnergyManagerStatics>)
{
winrt::hresult _winrt_cast_result_code;
auto const _winrt_casted_result = impl::try_as_with_reason<winrt::Windows::System::Power::IForegroundEnergyManagerStatics, 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::Windows::System::Power::IForegroundEnergyManagerStatics>**)&_winrt_casted_result;
check_hresult(_winrt_abi_type->get_LowUsageLevel(&value));
}
else
{
auto const _winrt_abi_type = *(abi_t<winrt::Windows::System::Power::IForegroundEnergyManagerStatics>**)this;
check_hresult(_winrt_abi_type->get_LowUsageLevel(&value));
}
return value;
}
template <typename D> auto consume_Windows_System_Power_IForegroundEnergyManagerStatics<D>::NearMaxAcceptableUsageLevel() const
{
uint32_t value{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::System::Power::IForegroundEnergyManagerStatics)->get_NearMaxAcceptableUsageLevel(&value));
if constexpr (!std::is_same_v<D, winrt::Windows::System::Power::IForegroundEnergyManagerStatics>)
{
winrt::hresult _winrt_cast_result_code;
auto const _winrt_casted_result = impl::try_as_with_reason<winrt::Windows::System::Power::IForegroundEnergyManagerStatics, 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::Windows::System::Power::IForegroundEnergyManagerStatics>**)&_winrt_casted_result;
check_hresult(_winrt_abi_type->get_NearMaxAcceptableUsageLevel(&value));
}
else
{
auto const _winrt_abi_type = *(abi_t<winrt::Windows::System::Power::IForegroundEnergyManagerStatics>**)this;
check_hresult(_winrt_abi_type->get_NearMaxAcceptableUsageLevel(&value));
}
return value;
}
template <typename D> auto consume_Windows_System_Power_IForegroundEnergyManagerStatics<D>::MaxAcceptableUsageLevel() const
{
uint32_t value{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::System::Power::IForegroundEnergyManagerStatics)->get_MaxAcceptableUsageLevel(&value));
if constexpr (!std::is_same_v<D, winrt::Windows::System::Power::IForegroundEnergyManagerStatics>)
{
winrt::hresult _winrt_cast_result_code;
auto const _winrt_casted_result = impl::try_as_with_reason<winrt::Windows::System::Power::IForegroundEnergyManagerStatics, 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::Windows::System::Power::IForegroundEnergyManagerStatics>**)&_winrt_casted_result;
check_hresult(_winrt_abi_type->get_MaxAcceptableUsageLevel(&value));
}
else
{
auto const _winrt_abi_type = *(abi_t<winrt::Windows::System::Power::IForegroundEnergyManagerStatics>**)this;
check_hresult(_winrt_abi_type->get_MaxAcceptableUsageLevel(&value));
}
return value;
}
template <typename D> auto consume_Windows_System_Power_IForegroundEnergyManagerStatics<D>::ExcessiveUsageLevel() const
{
uint32_t value{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::System::Power::IForegroundEnergyManagerStatics)->get_ExcessiveUsageLevel(&value));
if constexpr (!std::is_same_v<D, winrt::Windows::System::Power::IForegroundEnergyManagerStatics>)
{
winrt::hresult _winrt_cast_result_code;
auto const _winrt_casted_result = impl::try_as_with_reason<winrt::Windows::System::Power::IForegroundEnergyManagerStatics, 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::Windows::System::Power::IForegroundEnergyManagerStatics>**)&_winrt_casted_result;
check_hresult(_winrt_abi_type->get_ExcessiveUsageLevel(&value));
}
else
{
auto const _winrt_abi_type = *(abi_t<winrt::Windows::System::Power::IForegroundEnergyManagerStatics>**)this;
check_hresult(_winrt_abi_type->get_ExcessiveUsageLevel(&value));
}
return value;
}
template <typename D> auto consume_Windows_System_Power_IForegroundEnergyManagerStatics<D>::RecentEnergyUsage() const
{
uint32_t value{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::System::Power::IForegroundEnergyManagerStatics)->get_RecentEnergyUsage(&value));
if constexpr (!std::is_same_v<D, winrt::Windows::System::Power::IForegroundEnergyManagerStatics>)
{
winrt::hresult _winrt_cast_result_code;
auto const _winrt_casted_result = impl::try_as_with_reason<winrt::Windows::System::Power::IForegroundEnergyManagerStatics, 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::Windows::System::Power::IForegroundEnergyManagerStatics>**)&_winrt_casted_result;
check_hresult(_winrt_abi_type->get_RecentEnergyUsage(&value));
}
else
{
auto const _winrt_abi_type = *(abi_t<winrt::Windows::System::Power::IForegroundEnergyManagerStatics>**)this;
check_hresult(_winrt_abi_type->get_RecentEnergyUsage(&value));
}
return value;
}
template <typename D> auto consume_Windows_System_Power_IForegroundEnergyManagerStatics<D>::RecentEnergyUsageLevel() const
{
uint32_t value{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::System::Power::IForegroundEnergyManagerStatics)->get_RecentEnergyUsageLevel(&value));
if constexpr (!std::is_same_v<D, winrt::Windows::System::Power::IForegroundEnergyManagerStatics>)
{
winrt::hresult _winrt_cast_result_code;
auto const _winrt_casted_result = impl::try_as_with_reason<winrt::Windows::System::Power::IForegroundEnergyManagerStatics, 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::Windows::System::Power::IForegroundEnergyManagerStatics>**)&_winrt_casted_result;
check_hresult(_winrt_abi_type->get_RecentEnergyUsageLevel(&value));
}
else
{
auto const _winrt_abi_type = *(abi_t<winrt::Windows::System::Power::IForegroundEnergyManagerStatics>**)this;
check_hresult(_winrt_abi_type->get_RecentEnergyUsageLevel(&value));
}
return value;
}
template <typename D> auto consume_Windows_System_Power_IForegroundEnergyManagerStatics<D>::RecentEnergyUsageIncreased(winrt::Windows::Foundation::EventHandler<winrt::Windows::Foundation::IInspectable> const& handler) const
{
winrt::event_token token{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::System::Power::IForegroundEnergyManagerStatics)->add_RecentEnergyUsageIncreased(*(void**)(&handler), put_abi(token)));
if constexpr (!std::is_same_v<D, winrt::Windows::System::Power::IForegroundEnergyManagerStatics>)
{
winrt::hresult _winrt_cast_result_code;
auto const _winrt_casted_result = impl::try_as_with_reason<winrt::Windows::System::Power::IForegroundEnergyManagerStatics, 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::Windows::System::Power::IForegroundEnergyManagerStatics>**)&_winrt_casted_result;
check_hresult(_winrt_abi_type->add_RecentEnergyUsageIncreased(*(void**)(&handler), put_abi(token)));
}
else
{
auto const _winrt_abi_type = *(abi_t<winrt::Windows::System::Power::IForegroundEnergyManagerStatics>**)this;
check_hresult(_winrt_abi_type->add_RecentEnergyUsageIncreased(*(void**)(&handler), put_abi(token)));
}
return token;
}
template <typename D> auto consume_Windows_System_Power_IForegroundEnergyManagerStatics<D>::RecentEnergyUsageIncreased(auto_revoke_t, winrt::Windows::Foundation::EventHandler<winrt::Windows::Foundation::IInspectable> const& handler) const
@@ -135,12 +363,36 @@ namespace winrt::impl
}
template <typename D> auto consume_Windows_System_Power_IForegroundEnergyManagerStatics<D>::RecentEnergyUsageIncreased(winrt::event_token const& token) const noexcept
{
WINRT_IMPL_SHIM(winrt::Windows::System::Power::IForegroundEnergyManagerStatics)->remove_RecentEnergyUsageIncreased(impl::bind_in(token));
if constexpr (!std::is_same_v<D, winrt::Windows::System::Power::IForegroundEnergyManagerStatics>)
{
winrt::hresult _winrt_cast_result_code;
auto const _winrt_casted_result = impl::try_as_with_reason<winrt::Windows::System::Power::IForegroundEnergyManagerStatics, 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::Windows::System::Power::IForegroundEnergyManagerStatics>**)&_winrt_casted_result;
_winrt_abi_type->remove_RecentEnergyUsageIncreased(impl::bind_in(token));
}
else
{
auto const _winrt_abi_type = *(abi_t<winrt::Windows::System::Power::IForegroundEnergyManagerStatics>**)this;
_winrt_abi_type->remove_RecentEnergyUsageIncreased(impl::bind_in(token));
}
}
template <typename D> auto consume_Windows_System_Power_IForegroundEnergyManagerStatics<D>::RecentEnergyUsageReturnedToLow(winrt::Windows::Foundation::EventHandler<winrt::Windows::Foundation::IInspectable> const& handler) const
{
winrt::event_token token{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::System::Power::IForegroundEnergyManagerStatics)->add_RecentEnergyUsageReturnedToLow(*(void**)(&handler), put_abi(token)));
if constexpr (!std::is_same_v<D, winrt::Windows::System::Power::IForegroundEnergyManagerStatics>)
{
winrt::hresult _winrt_cast_result_code;
auto const _winrt_casted_result = impl::try_as_with_reason<winrt::Windows::System::Power::IForegroundEnergyManagerStatics, 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::Windows::System::Power::IForegroundEnergyManagerStatics>**)&_winrt_casted_result;
check_hresult(_winrt_abi_type->add_RecentEnergyUsageReturnedToLow(*(void**)(&handler), put_abi(token)));
}
else
{
auto const _winrt_abi_type = *(abi_t<winrt::Windows::System::Power::IForegroundEnergyManagerStatics>**)this;
check_hresult(_winrt_abi_type->add_RecentEnergyUsageReturnedToLow(*(void**)(&handler), put_abi(token)));
}
return token;
}
template <typename D> auto consume_Windows_System_Power_IForegroundEnergyManagerStatics<D>::RecentEnergyUsageReturnedToLow(auto_revoke_t, winrt::Windows::Foundation::EventHandler<winrt::Windows::Foundation::IInspectable> const& handler) const
@@ -149,18 +401,54 @@ namespace winrt::impl
}
template <typename D> auto consume_Windows_System_Power_IForegroundEnergyManagerStatics<D>::RecentEnergyUsageReturnedToLow(winrt::event_token const& token) const noexcept
{
WINRT_IMPL_SHIM(winrt::Windows::System::Power::IForegroundEnergyManagerStatics)->remove_RecentEnergyUsageReturnedToLow(impl::bind_in(token));
if constexpr (!std::is_same_v<D, winrt::Windows::System::Power::IForegroundEnergyManagerStatics>)
{
winrt::hresult _winrt_cast_result_code;
auto const _winrt_casted_result = impl::try_as_with_reason<winrt::Windows::System::Power::IForegroundEnergyManagerStatics, 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::Windows::System::Power::IForegroundEnergyManagerStatics>**)&_winrt_casted_result;
_winrt_abi_type->remove_RecentEnergyUsageReturnedToLow(impl::bind_in(token));
}
else
{
auto const _winrt_abi_type = *(abi_t<winrt::Windows::System::Power::IForegroundEnergyManagerStatics>**)this;
_winrt_abi_type->remove_RecentEnergyUsageReturnedToLow(impl::bind_in(token));
}
}
template <typename D> auto consume_Windows_System_Power_IPowerManagerStatics<D>::EnergySaverStatus() const
{
winrt::Windows::System::Power::EnergySaverStatus value{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::System::Power::IPowerManagerStatics)->get_EnergySaverStatus(reinterpret_cast<int32_t*>(&value)));
if constexpr (!std::is_same_v<D, winrt::Windows::System::Power::IPowerManagerStatics>)
{
winrt::hresult _winrt_cast_result_code;
auto const _winrt_casted_result = impl::try_as_with_reason<winrt::Windows::System::Power::IPowerManagerStatics, 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::Windows::System::Power::IPowerManagerStatics>**)&_winrt_casted_result;
check_hresult(_winrt_abi_type->get_EnergySaverStatus(reinterpret_cast<int32_t*>(&value)));
}
else
{
auto const _winrt_abi_type = *(abi_t<winrt::Windows::System::Power::IPowerManagerStatics>**)this;
check_hresult(_winrt_abi_type->get_EnergySaverStatus(reinterpret_cast<int32_t*>(&value)));
}
return value;
}
template <typename D> auto consume_Windows_System_Power_IPowerManagerStatics<D>::EnergySaverStatusChanged(winrt::Windows::Foundation::EventHandler<winrt::Windows::Foundation::IInspectable> const& handler) const
{
winrt::event_token token{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::System::Power::IPowerManagerStatics)->add_EnergySaverStatusChanged(*(void**)(&handler), put_abi(token)));
if constexpr (!std::is_same_v<D, winrt::Windows::System::Power::IPowerManagerStatics>)
{
winrt::hresult _winrt_cast_result_code;
auto const _winrt_casted_result = impl::try_as_with_reason<winrt::Windows::System::Power::IPowerManagerStatics, 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::Windows::System::Power::IPowerManagerStatics>**)&_winrt_casted_result;
check_hresult(_winrt_abi_type->add_EnergySaverStatusChanged(*(void**)(&handler), put_abi(token)));
}
else
{
auto const _winrt_abi_type = *(abi_t<winrt::Windows::System::Power::IPowerManagerStatics>**)this;
check_hresult(_winrt_abi_type->add_EnergySaverStatusChanged(*(void**)(&handler), put_abi(token)));
}
return token;
}
template <typename D> auto consume_Windows_System_Power_IPowerManagerStatics<D>::EnergySaverStatusChanged(auto_revoke_t, winrt::Windows::Foundation::EventHandler<winrt::Windows::Foundation::IInspectable> const& handler) const
@@ -169,18 +457,54 @@ namespace winrt::impl
}
template <typename D> auto consume_Windows_System_Power_IPowerManagerStatics<D>::EnergySaverStatusChanged(winrt::event_token const& token) const noexcept
{
WINRT_IMPL_SHIM(winrt::Windows::System::Power::IPowerManagerStatics)->remove_EnergySaverStatusChanged(impl::bind_in(token));
if constexpr (!std::is_same_v<D, winrt::Windows::System::Power::IPowerManagerStatics>)
{
winrt::hresult _winrt_cast_result_code;
auto const _winrt_casted_result = impl::try_as_with_reason<winrt::Windows::System::Power::IPowerManagerStatics, 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::Windows::System::Power::IPowerManagerStatics>**)&_winrt_casted_result;
_winrt_abi_type->remove_EnergySaverStatusChanged(impl::bind_in(token));
}
else
{
auto const _winrt_abi_type = *(abi_t<winrt::Windows::System::Power::IPowerManagerStatics>**)this;
_winrt_abi_type->remove_EnergySaverStatusChanged(impl::bind_in(token));
}
}
template <typename D> auto consume_Windows_System_Power_IPowerManagerStatics<D>::BatteryStatus() const
{
winrt::Windows::System::Power::BatteryStatus value{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::System::Power::IPowerManagerStatics)->get_BatteryStatus(reinterpret_cast<int32_t*>(&value)));
if constexpr (!std::is_same_v<D, winrt::Windows::System::Power::IPowerManagerStatics>)
{
winrt::hresult _winrt_cast_result_code;
auto const _winrt_casted_result = impl::try_as_with_reason<winrt::Windows::System::Power::IPowerManagerStatics, 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::Windows::System::Power::IPowerManagerStatics>**)&_winrt_casted_result;
check_hresult(_winrt_abi_type->get_BatteryStatus(reinterpret_cast<int32_t*>(&value)));
}
else
{
auto const _winrt_abi_type = *(abi_t<winrt::Windows::System::Power::IPowerManagerStatics>**)this;
check_hresult(_winrt_abi_type->get_BatteryStatus(reinterpret_cast<int32_t*>(&value)));
}
return value;
}
template <typename D> auto consume_Windows_System_Power_IPowerManagerStatics<D>::BatteryStatusChanged(winrt::Windows::Foundation::EventHandler<winrt::Windows::Foundation::IInspectable> const& handler) const
{
winrt::event_token token{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::System::Power::IPowerManagerStatics)->add_BatteryStatusChanged(*(void**)(&handler), put_abi(token)));
if constexpr (!std::is_same_v<D, winrt::Windows::System::Power::IPowerManagerStatics>)
{
winrt::hresult _winrt_cast_result_code;
auto const _winrt_casted_result = impl::try_as_with_reason<winrt::Windows::System::Power::IPowerManagerStatics, 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::Windows::System::Power::IPowerManagerStatics>**)&_winrt_casted_result;
check_hresult(_winrt_abi_type->add_BatteryStatusChanged(*(void**)(&handler), put_abi(token)));
}
else
{
auto const _winrt_abi_type = *(abi_t<winrt::Windows::System::Power::IPowerManagerStatics>**)this;
check_hresult(_winrt_abi_type->add_BatteryStatusChanged(*(void**)(&handler), put_abi(token)));
}
return token;
}
template <typename D> auto consume_Windows_System_Power_IPowerManagerStatics<D>::BatteryStatusChanged(auto_revoke_t, winrt::Windows::Foundation::EventHandler<winrt::Windows::Foundation::IInspectable> const& handler) const
@@ -189,18 +513,54 @@ namespace winrt::impl
}
template <typename D> auto consume_Windows_System_Power_IPowerManagerStatics<D>::BatteryStatusChanged(winrt::event_token const& token) const noexcept
{
WINRT_IMPL_SHIM(winrt::Windows::System::Power::IPowerManagerStatics)->remove_BatteryStatusChanged(impl::bind_in(token));
if constexpr (!std::is_same_v<D, winrt::Windows::System::Power::IPowerManagerStatics>)
{
winrt::hresult _winrt_cast_result_code;
auto const _winrt_casted_result = impl::try_as_with_reason<winrt::Windows::System::Power::IPowerManagerStatics, 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::Windows::System::Power::IPowerManagerStatics>**)&_winrt_casted_result;
_winrt_abi_type->remove_BatteryStatusChanged(impl::bind_in(token));
}
else
{
auto const _winrt_abi_type = *(abi_t<winrt::Windows::System::Power::IPowerManagerStatics>**)this;
_winrt_abi_type->remove_BatteryStatusChanged(impl::bind_in(token));
}
}
template <typename D> auto consume_Windows_System_Power_IPowerManagerStatics<D>::PowerSupplyStatus() const
{
winrt::Windows::System::Power::PowerSupplyStatus value{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::System::Power::IPowerManagerStatics)->get_PowerSupplyStatus(reinterpret_cast<int32_t*>(&value)));
if constexpr (!std::is_same_v<D, winrt::Windows::System::Power::IPowerManagerStatics>)
{
winrt::hresult _winrt_cast_result_code;
auto const _winrt_casted_result = impl::try_as_with_reason<winrt::Windows::System::Power::IPowerManagerStatics, 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::Windows::System::Power::IPowerManagerStatics>**)&_winrt_casted_result;
check_hresult(_winrt_abi_type->get_PowerSupplyStatus(reinterpret_cast<int32_t*>(&value)));
}
else
{
auto const _winrt_abi_type = *(abi_t<winrt::Windows::System::Power::IPowerManagerStatics>**)this;
check_hresult(_winrt_abi_type->get_PowerSupplyStatus(reinterpret_cast<int32_t*>(&value)));
}
return value;
}
template <typename D> auto consume_Windows_System_Power_IPowerManagerStatics<D>::PowerSupplyStatusChanged(winrt::Windows::Foundation::EventHandler<winrt::Windows::Foundation::IInspectable> const& handler) const
{
winrt::event_token token{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::System::Power::IPowerManagerStatics)->add_PowerSupplyStatusChanged(*(void**)(&handler), put_abi(token)));
if constexpr (!std::is_same_v<D, winrt::Windows::System::Power::IPowerManagerStatics>)
{
winrt::hresult _winrt_cast_result_code;
auto const _winrt_casted_result = impl::try_as_with_reason<winrt::Windows::System::Power::IPowerManagerStatics, 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::Windows::System::Power::IPowerManagerStatics>**)&_winrt_casted_result;
check_hresult(_winrt_abi_type->add_PowerSupplyStatusChanged(*(void**)(&handler), put_abi(token)));
}
else
{
auto const _winrt_abi_type = *(abi_t<winrt::Windows::System::Power::IPowerManagerStatics>**)this;
check_hresult(_winrt_abi_type->add_PowerSupplyStatusChanged(*(void**)(&handler), put_abi(token)));
}
return token;
}
template <typename D> auto consume_Windows_System_Power_IPowerManagerStatics<D>::PowerSupplyStatusChanged(auto_revoke_t, winrt::Windows::Foundation::EventHandler<winrt::Windows::Foundation::IInspectable> const& handler) const
@@ -209,18 +569,54 @@ namespace winrt::impl
}
template <typename D> auto consume_Windows_System_Power_IPowerManagerStatics<D>::PowerSupplyStatusChanged(winrt::event_token const& token) const noexcept
{
WINRT_IMPL_SHIM(winrt::Windows::System::Power::IPowerManagerStatics)->remove_PowerSupplyStatusChanged(impl::bind_in(token));
if constexpr (!std::is_same_v<D, winrt::Windows::System::Power::IPowerManagerStatics>)
{
winrt::hresult _winrt_cast_result_code;
auto const _winrt_casted_result = impl::try_as_with_reason<winrt::Windows::System::Power::IPowerManagerStatics, 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::Windows::System::Power::IPowerManagerStatics>**)&_winrt_casted_result;
_winrt_abi_type->remove_PowerSupplyStatusChanged(impl::bind_in(token));
}
else
{
auto const _winrt_abi_type = *(abi_t<winrt::Windows::System::Power::IPowerManagerStatics>**)this;
_winrt_abi_type->remove_PowerSupplyStatusChanged(impl::bind_in(token));
}
}
template <typename D> auto consume_Windows_System_Power_IPowerManagerStatics<D>::RemainingChargePercent() const
{
int32_t value{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::System::Power::IPowerManagerStatics)->get_RemainingChargePercent(&value));
if constexpr (!std::is_same_v<D, winrt::Windows::System::Power::IPowerManagerStatics>)
{
winrt::hresult _winrt_cast_result_code;
auto const _winrt_casted_result = impl::try_as_with_reason<winrt::Windows::System::Power::IPowerManagerStatics, 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::Windows::System::Power::IPowerManagerStatics>**)&_winrt_casted_result;
check_hresult(_winrt_abi_type->get_RemainingChargePercent(&value));
}
else
{
auto const _winrt_abi_type = *(abi_t<winrt::Windows::System::Power::IPowerManagerStatics>**)this;
check_hresult(_winrt_abi_type->get_RemainingChargePercent(&value));
}
return value;
}
template <typename D> auto consume_Windows_System_Power_IPowerManagerStatics<D>::RemainingChargePercentChanged(winrt::Windows::Foundation::EventHandler<winrt::Windows::Foundation::IInspectable> const& handler) const
{
winrt::event_token token{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::System::Power::IPowerManagerStatics)->add_RemainingChargePercentChanged(*(void**)(&handler), put_abi(token)));
if constexpr (!std::is_same_v<D, winrt::Windows::System::Power::IPowerManagerStatics>)
{
winrt::hresult _winrt_cast_result_code;
auto const _winrt_casted_result = impl::try_as_with_reason<winrt::Windows::System::Power::IPowerManagerStatics, 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::Windows::System::Power::IPowerManagerStatics>**)&_winrt_casted_result;
check_hresult(_winrt_abi_type->add_RemainingChargePercentChanged(*(void**)(&handler), put_abi(token)));
}
else
{
auto const _winrt_abi_type = *(abi_t<winrt::Windows::System::Power::IPowerManagerStatics>**)this;
check_hresult(_winrt_abi_type->add_RemainingChargePercentChanged(*(void**)(&handler), put_abi(token)));
}
return token;
}
template <typename D> auto consume_Windows_System_Power_IPowerManagerStatics<D>::RemainingChargePercentChanged(auto_revoke_t, winrt::Windows::Foundation::EventHandler<winrt::Windows::Foundation::IInspectable> const& handler) const
@@ -229,18 +625,54 @@ namespace winrt::impl
}
template <typename D> auto consume_Windows_System_Power_IPowerManagerStatics<D>::RemainingChargePercentChanged(winrt::event_token const& token) const noexcept
{
WINRT_IMPL_SHIM(winrt::Windows::System::Power::IPowerManagerStatics)->remove_RemainingChargePercentChanged(impl::bind_in(token));
if constexpr (!std::is_same_v<D, winrt::Windows::System::Power::IPowerManagerStatics>)
{
winrt::hresult _winrt_cast_result_code;
auto const _winrt_casted_result = impl::try_as_with_reason<winrt::Windows::System::Power::IPowerManagerStatics, 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::Windows::System::Power::IPowerManagerStatics>**)&_winrt_casted_result;
_winrt_abi_type->remove_RemainingChargePercentChanged(impl::bind_in(token));
}
else
{
auto const _winrt_abi_type = *(abi_t<winrt::Windows::System::Power::IPowerManagerStatics>**)this;
_winrt_abi_type->remove_RemainingChargePercentChanged(impl::bind_in(token));
}
}
template <typename D> auto consume_Windows_System_Power_IPowerManagerStatics<D>::RemainingDischargeTime() const
{
winrt::Windows::Foundation::TimeSpan value{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::System::Power::IPowerManagerStatics)->get_RemainingDischargeTime(put_abi(value)));
if constexpr (!std::is_same_v<D, winrt::Windows::System::Power::IPowerManagerStatics>)
{
winrt::hresult _winrt_cast_result_code;
auto const _winrt_casted_result = impl::try_as_with_reason<winrt::Windows::System::Power::IPowerManagerStatics, 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::Windows::System::Power::IPowerManagerStatics>**)&_winrt_casted_result;
check_hresult(_winrt_abi_type->get_RemainingDischargeTime(put_abi(value)));
}
else
{
auto const _winrt_abi_type = *(abi_t<winrt::Windows::System::Power::IPowerManagerStatics>**)this;
check_hresult(_winrt_abi_type->get_RemainingDischargeTime(put_abi(value)));
}
return value;
}
template <typename D> auto consume_Windows_System_Power_IPowerManagerStatics<D>::RemainingDischargeTimeChanged(winrt::Windows::Foundation::EventHandler<winrt::Windows::Foundation::IInspectable> const& handler) const
{
winrt::event_token token{};
check_hresult(WINRT_IMPL_SHIM(winrt::Windows::System::Power::IPowerManagerStatics)->add_RemainingDischargeTimeChanged(*(void**)(&handler), put_abi(token)));
if constexpr (!std::is_same_v<D, winrt::Windows::System::Power::IPowerManagerStatics>)
{
winrt::hresult _winrt_cast_result_code;
auto const _winrt_casted_result = impl::try_as_with_reason<winrt::Windows::System::Power::IPowerManagerStatics, 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::Windows::System::Power::IPowerManagerStatics>**)&_winrt_casted_result;
check_hresult(_winrt_abi_type->add_RemainingDischargeTimeChanged(*(void**)(&handler), put_abi(token)));
}
else
{
auto const _winrt_abi_type = *(abi_t<winrt::Windows::System::Power::IPowerManagerStatics>**)this;
check_hresult(_winrt_abi_type->add_RemainingDischargeTimeChanged(*(void**)(&handler), put_abi(token)));
}
return token;
}
template <typename D> auto consume_Windows_System_Power_IPowerManagerStatics<D>::RemainingDischargeTimeChanged(auto_revoke_t, winrt::Windows::Foundation::EventHandler<winrt::Windows::Foundation::IInspectable> const& handler) const
@@ -249,7 +681,19 @@ namespace winrt::impl
}
template <typename D> auto consume_Windows_System_Power_IPowerManagerStatics<D>::RemainingDischargeTimeChanged(winrt::event_token const& token) const noexcept
{
WINRT_IMPL_SHIM(winrt::Windows::System::Power::IPowerManagerStatics)->remove_RemainingDischargeTimeChanged(impl::bind_in(token));
if constexpr (!std::is_same_v<D, winrt::Windows::System::Power::IPowerManagerStatics>)
{
winrt::hresult _winrt_cast_result_code;
auto const _winrt_casted_result = impl::try_as_with_reason<winrt::Windows::System::Power::IPowerManagerStatics, 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::Windows::System::Power::IPowerManagerStatics>**)&_winrt_casted_result;
_winrt_abi_type->remove_RemainingDischargeTimeChanged(impl::bind_in(token));
}
else
{
auto const _winrt_abi_type = *(abi_t<winrt::Windows::System::Power::IPowerManagerStatics>**)this;
_winrt_abi_type->remove_RemainingDischargeTimeChanged(impl::bind_in(token));
}
}
#ifndef WINRT_LEAN_AND_MEAN
template <typename D>