// WARNING: Please don't edit this file. It was generated by C++/WinRT v2.0.240405.15 #pragma once #ifndef WINRT_Microsoft_Windows_System_Power_H #define WINRT_Microsoft_Windows_System_Power_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/Microsoft.Windows.System.h" #include "winrt/impl/Windows.Foundation.2.h" #include "winrt/impl/Microsoft.Windows.System.Power.2.h" namespace winrt::impl { template auto consume_Microsoft_Windows_System_Power_IPowerManagerStatics::EnergySaverStatus() const { winrt::Microsoft::Windows::System::Power::EnergySaverStatus value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::System::Power::IPowerManagerStatics)->get_EnergySaverStatus(reinterpret_cast(&value))); return value; } template auto consume_Microsoft_Windows_System_Power_IPowerManagerStatics::EnergySaverStatusChanged(winrt::Windows::Foundation::EventHandler const& handler) const { winrt::event_token token{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::System::Power::IPowerManagerStatics)->add_EnergySaverStatusChanged(*(void**)(&handler), put_abi(token))); return token; } template auto consume_Microsoft_Windows_System_Power_IPowerManagerStatics::EnergySaverStatusChanged(auto_revoke_t, winrt::Windows::Foundation::EventHandler const& handler) const { return impl::make_event_revoker(this, EnergySaverStatusChanged(handler)); } template auto consume_Microsoft_Windows_System_Power_IPowerManagerStatics::EnergySaverStatusChanged(winrt::event_token const& token) const noexcept { WINRT_IMPL_SHIM(winrt::Microsoft::Windows::System::Power::IPowerManagerStatics)->remove_EnergySaverStatusChanged(impl::bind_in(token)); } template auto consume_Microsoft_Windows_System_Power_IPowerManagerStatics::BatteryStatus() const { winrt::Microsoft::Windows::System::Power::BatteryStatus value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::System::Power::IPowerManagerStatics)->get_BatteryStatus(reinterpret_cast(&value))); return value; } template auto consume_Microsoft_Windows_System_Power_IPowerManagerStatics::BatteryStatusChanged(winrt::Windows::Foundation::EventHandler const& handler) const { winrt::event_token token{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::System::Power::IPowerManagerStatics)->add_BatteryStatusChanged(*(void**)(&handler), put_abi(token))); return token; } template auto consume_Microsoft_Windows_System_Power_IPowerManagerStatics::BatteryStatusChanged(auto_revoke_t, winrt::Windows::Foundation::EventHandler const& handler) const { return impl::make_event_revoker(this, BatteryStatusChanged(handler)); } template auto consume_Microsoft_Windows_System_Power_IPowerManagerStatics::BatteryStatusChanged(winrt::event_token const& token) const noexcept { WINRT_IMPL_SHIM(winrt::Microsoft::Windows::System::Power::IPowerManagerStatics)->remove_BatteryStatusChanged(impl::bind_in(token)); } template auto consume_Microsoft_Windows_System_Power_IPowerManagerStatics::PowerSupplyStatus() const { winrt::Microsoft::Windows::System::Power::PowerSupplyStatus value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::System::Power::IPowerManagerStatics)->get_PowerSupplyStatus(reinterpret_cast(&value))); return value; } template auto consume_Microsoft_Windows_System_Power_IPowerManagerStatics::PowerSupplyStatusChanged(winrt::Windows::Foundation::EventHandler const& handler) const { winrt::event_token token{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::System::Power::IPowerManagerStatics)->add_PowerSupplyStatusChanged(*(void**)(&handler), put_abi(token))); return token; } template auto consume_Microsoft_Windows_System_Power_IPowerManagerStatics::PowerSupplyStatusChanged(auto_revoke_t, winrt::Windows::Foundation::EventHandler const& handler) const { return impl::make_event_revoker(this, PowerSupplyStatusChanged(handler)); } template auto consume_Microsoft_Windows_System_Power_IPowerManagerStatics::PowerSupplyStatusChanged(winrt::event_token const& token) const noexcept { WINRT_IMPL_SHIM(winrt::Microsoft::Windows::System::Power::IPowerManagerStatics)->remove_PowerSupplyStatusChanged(impl::bind_in(token)); } template auto consume_Microsoft_Windows_System_Power_IPowerManagerStatics::RemainingChargePercent() const { int32_t value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::System::Power::IPowerManagerStatics)->get_RemainingChargePercent(&value)); return value; } template auto consume_Microsoft_Windows_System_Power_IPowerManagerStatics::RemainingChargePercentChanged(winrt::Windows::Foundation::EventHandler const& handler) const { winrt::event_token token{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::System::Power::IPowerManagerStatics)->add_RemainingChargePercentChanged(*(void**)(&handler), put_abi(token))); return token; } template auto consume_Microsoft_Windows_System_Power_IPowerManagerStatics::RemainingChargePercentChanged(auto_revoke_t, winrt::Windows::Foundation::EventHandler const& handler) const { return impl::make_event_revoker(this, RemainingChargePercentChanged(handler)); } template auto consume_Microsoft_Windows_System_Power_IPowerManagerStatics::RemainingChargePercentChanged(winrt::event_token const& token) const noexcept { WINRT_IMPL_SHIM(winrt::Microsoft::Windows::System::Power::IPowerManagerStatics)->remove_RemainingChargePercentChanged(impl::bind_in(token)); } template auto consume_Microsoft_Windows_System_Power_IPowerManagerStatics::RemainingDischargeTime() const { winrt::Windows::Foundation::TimeSpan value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::System::Power::IPowerManagerStatics)->get_RemainingDischargeTime(put_abi(value))); return value; } template auto consume_Microsoft_Windows_System_Power_IPowerManagerStatics::RemainingDischargeTimeChanged(winrt::Windows::Foundation::EventHandler const& handler) const { winrt::event_token token{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::System::Power::IPowerManagerStatics)->add_RemainingDischargeTimeChanged(*(void**)(&handler), put_abi(token))); return token; } template auto consume_Microsoft_Windows_System_Power_IPowerManagerStatics::RemainingDischargeTimeChanged(auto_revoke_t, winrt::Windows::Foundation::EventHandler const& handler) const { return impl::make_event_revoker(this, RemainingDischargeTimeChanged(handler)); } template auto consume_Microsoft_Windows_System_Power_IPowerManagerStatics::RemainingDischargeTimeChanged(winrt::event_token const& token) const noexcept { WINRT_IMPL_SHIM(winrt::Microsoft::Windows::System::Power::IPowerManagerStatics)->remove_RemainingDischargeTimeChanged(impl::bind_in(token)); } template auto consume_Microsoft_Windows_System_Power_IPowerManagerStatics::PowerSourceKind() const { winrt::Microsoft::Windows::System::Power::PowerSourceKind value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::System::Power::IPowerManagerStatics)->get_PowerSourceKind(reinterpret_cast(&value))); return value; } template auto consume_Microsoft_Windows_System_Power_IPowerManagerStatics::PowerSourceKindChanged(winrt::Windows::Foundation::EventHandler const& handler) const { winrt::event_token token{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::System::Power::IPowerManagerStatics)->add_PowerSourceKindChanged(*(void**)(&handler), put_abi(token))); return token; } template auto consume_Microsoft_Windows_System_Power_IPowerManagerStatics::PowerSourceKindChanged(auto_revoke_t, winrt::Windows::Foundation::EventHandler const& handler) const { return impl::make_event_revoker(this, PowerSourceKindChanged(handler)); } template auto consume_Microsoft_Windows_System_Power_IPowerManagerStatics::PowerSourceKindChanged(winrt::event_token const& token) const noexcept { WINRT_IMPL_SHIM(winrt::Microsoft::Windows::System::Power::IPowerManagerStatics)->remove_PowerSourceKindChanged(impl::bind_in(token)); } template auto consume_Microsoft_Windows_System_Power_IPowerManagerStatics::DisplayStatus() const { winrt::Microsoft::Windows::System::Power::DisplayStatus value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::System::Power::IPowerManagerStatics)->get_DisplayStatus(reinterpret_cast(&value))); return value; } template auto consume_Microsoft_Windows_System_Power_IPowerManagerStatics::DisplayStatusChanged(winrt::Windows::Foundation::EventHandler const& handler) const { winrt::event_token token{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::System::Power::IPowerManagerStatics)->add_DisplayStatusChanged(*(void**)(&handler), put_abi(token))); return token; } template auto consume_Microsoft_Windows_System_Power_IPowerManagerStatics::DisplayStatusChanged(auto_revoke_t, winrt::Windows::Foundation::EventHandler const& handler) const { return impl::make_event_revoker(this, DisplayStatusChanged(handler)); } template auto consume_Microsoft_Windows_System_Power_IPowerManagerStatics::DisplayStatusChanged(winrt::event_token const& token) const noexcept { WINRT_IMPL_SHIM(winrt::Microsoft::Windows::System::Power::IPowerManagerStatics)->remove_DisplayStatusChanged(impl::bind_in(token)); } template auto consume_Microsoft_Windows_System_Power_IPowerManagerStatics::SystemIdleStatusChanged(winrt::Windows::Foundation::EventHandler const& handler) const { winrt::event_token token{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::System::Power::IPowerManagerStatics)->add_SystemIdleStatusChanged(*(void**)(&handler), put_abi(token))); return token; } template auto consume_Microsoft_Windows_System_Power_IPowerManagerStatics::SystemIdleStatusChanged(auto_revoke_t, winrt::Windows::Foundation::EventHandler const& handler) const { return impl::make_event_revoker(this, SystemIdleStatusChanged(handler)); } template auto consume_Microsoft_Windows_System_Power_IPowerManagerStatics::SystemIdleStatusChanged(winrt::event_token const& token) const noexcept { WINRT_IMPL_SHIM(winrt::Microsoft::Windows::System::Power::IPowerManagerStatics)->remove_SystemIdleStatusChanged(impl::bind_in(token)); } template auto consume_Microsoft_Windows_System_Power_IPowerManagerStatics::EffectivePowerMode() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::System::Power::IPowerManagerStatics)->get_EffectivePowerMode(&value)); return winrt::Windows::Foundation::IAsyncOperation{ value, take_ownership_from_abi }; } template auto consume_Microsoft_Windows_System_Power_IPowerManagerStatics::EffectivePowerModeChanged(winrt::Windows::Foundation::EventHandler const& handler) const { winrt::event_token token{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::System::Power::IPowerManagerStatics)->add_EffectivePowerModeChanged(*(void**)(&handler), put_abi(token))); return token; } template auto consume_Microsoft_Windows_System_Power_IPowerManagerStatics::EffectivePowerModeChanged(auto_revoke_t, winrt::Windows::Foundation::EventHandler const& handler) const { return impl::make_event_revoker(this, EffectivePowerModeChanged(handler)); } template auto consume_Microsoft_Windows_System_Power_IPowerManagerStatics::EffectivePowerModeChanged(winrt::event_token const& token) const noexcept { WINRT_IMPL_SHIM(winrt::Microsoft::Windows::System::Power::IPowerManagerStatics)->remove_EffectivePowerModeChanged(impl::bind_in(token)); } template auto consume_Microsoft_Windows_System_Power_IPowerManagerStatics::UserPresenceStatus() const { winrt::Microsoft::Windows::System::Power::UserPresenceStatus value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::System::Power::IPowerManagerStatics)->get_UserPresenceStatus(reinterpret_cast(&value))); return value; } template auto consume_Microsoft_Windows_System_Power_IPowerManagerStatics::UserPresenceStatusChanged(winrt::Windows::Foundation::EventHandler const& handler) const { winrt::event_token token{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::System::Power::IPowerManagerStatics)->add_UserPresenceStatusChanged(*(void**)(&handler), put_abi(token))); return token; } template auto consume_Microsoft_Windows_System_Power_IPowerManagerStatics::UserPresenceStatusChanged(auto_revoke_t, winrt::Windows::Foundation::EventHandler const& handler) const { return impl::make_event_revoker(this, UserPresenceStatusChanged(handler)); } template auto consume_Microsoft_Windows_System_Power_IPowerManagerStatics::UserPresenceStatusChanged(winrt::event_token const& token) const noexcept { WINRT_IMPL_SHIM(winrt::Microsoft::Windows::System::Power::IPowerManagerStatics)->remove_UserPresenceStatusChanged(impl::bind_in(token)); } template auto consume_Microsoft_Windows_System_Power_IPowerManagerStatics::SystemSuspendStatus() const { winrt::Microsoft::Windows::System::Power::SystemSuspendStatus value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::System::Power::IPowerManagerStatics)->get_SystemSuspendStatus(reinterpret_cast(&value))); return value; } template auto consume_Microsoft_Windows_System_Power_IPowerManagerStatics::SystemSuspendStatusChanged(winrt::Windows::Foundation::EventHandler const& handler) const { winrt::event_token token{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::System::Power::IPowerManagerStatics)->add_SystemSuspendStatusChanged(*(void**)(&handler), put_abi(token))); return token; } template auto consume_Microsoft_Windows_System_Power_IPowerManagerStatics::SystemSuspendStatusChanged(auto_revoke_t, winrt::Windows::Foundation::EventHandler const& handler) const { return impl::make_event_revoker(this, SystemSuspendStatusChanged(handler)); } template auto consume_Microsoft_Windows_System_Power_IPowerManagerStatics::SystemSuspendStatusChanged(winrt::event_token const& token) const noexcept { WINRT_IMPL_SHIM(winrt::Microsoft::Windows::System::Power::IPowerManagerStatics)->remove_SystemSuspendStatusChanged(impl::bind_in(token)); } template auto consume_Microsoft_Windows_System_Power_IPowerManagerStatics2::EffectivePowerMode2() const { winrt::Microsoft::Windows::System::Power::EffectivePowerMode value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::System::Power::IPowerManagerStatics2)->get_EffectivePowerMode2(reinterpret_cast(&value))); return value; } #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_EnergySaverStatus(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().EnergySaverStatus()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall add_EnergySaverStatusChanged(void* handler, winrt::event_token* token) noexcept final try { zero_abi(token); typename D::abi_guard guard(this->shim()); *token = detach_from(this->shim().EnergySaverStatusChanged(*reinterpret_cast const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_EnergySaverStatusChanged(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().EnergySaverStatusChanged(*reinterpret_cast(&token)); return 0; } int32_t __stdcall get_BatteryStatus(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().BatteryStatus()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall add_BatteryStatusChanged(void* handler, winrt::event_token* token) noexcept final try { zero_abi(token); typename D::abi_guard guard(this->shim()); *token = detach_from(this->shim().BatteryStatusChanged(*reinterpret_cast const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_BatteryStatusChanged(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().BatteryStatusChanged(*reinterpret_cast(&token)); return 0; } int32_t __stdcall get_PowerSupplyStatus(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().PowerSupplyStatus()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall add_PowerSupplyStatusChanged(void* handler, winrt::event_token* token) noexcept final try { zero_abi(token); typename D::abi_guard guard(this->shim()); *token = detach_from(this->shim().PowerSupplyStatusChanged(*reinterpret_cast const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_PowerSupplyStatusChanged(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().PowerSupplyStatusChanged(*reinterpret_cast(&token)); return 0; } int32_t __stdcall get_RemainingChargePercent(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().RemainingChargePercent()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall add_RemainingChargePercentChanged(void* handler, winrt::event_token* token) noexcept final try { zero_abi(token); typename D::abi_guard guard(this->shim()); *token = detach_from(this->shim().RemainingChargePercentChanged(*reinterpret_cast const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_RemainingChargePercentChanged(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().RemainingChargePercentChanged(*reinterpret_cast(&token)); return 0; } int32_t __stdcall get_RemainingDischargeTime(int64_t* value) noexcept final try { zero_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().RemainingDischargeTime()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall add_RemainingDischargeTimeChanged(void* handler, winrt::event_token* token) noexcept final try { zero_abi(token); typename D::abi_guard guard(this->shim()); *token = detach_from(this->shim().RemainingDischargeTimeChanged(*reinterpret_cast const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_RemainingDischargeTimeChanged(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().RemainingDischargeTimeChanged(*reinterpret_cast(&token)); return 0; } int32_t __stdcall get_PowerSourceKind(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().PowerSourceKind()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall add_PowerSourceKindChanged(void* handler, winrt::event_token* token) noexcept final try { zero_abi(token); typename D::abi_guard guard(this->shim()); *token = detach_from(this->shim().PowerSourceKindChanged(*reinterpret_cast const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_PowerSourceKindChanged(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().PowerSourceKindChanged(*reinterpret_cast(&token)); return 0; } int32_t __stdcall get_DisplayStatus(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().DisplayStatus()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall add_DisplayStatusChanged(void* handler, winrt::event_token* token) noexcept final try { zero_abi(token); typename D::abi_guard guard(this->shim()); *token = detach_from(this->shim().DisplayStatusChanged(*reinterpret_cast const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_DisplayStatusChanged(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().DisplayStatusChanged(*reinterpret_cast(&token)); return 0; } int32_t __stdcall add_SystemIdleStatusChanged(void* handler, winrt::event_token* token) noexcept final try { zero_abi(token); typename D::abi_guard guard(this->shim()); *token = detach_from(this->shim().SystemIdleStatusChanged(*reinterpret_cast const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_SystemIdleStatusChanged(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().SystemIdleStatusChanged(*reinterpret_cast(&token)); return 0; } int32_t __stdcall get_EffectivePowerMode(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from>(this->shim().EffectivePowerMode()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall add_EffectivePowerModeChanged(void* handler, winrt::event_token* token) noexcept final try { zero_abi(token); typename D::abi_guard guard(this->shim()); *token = detach_from(this->shim().EffectivePowerModeChanged(*reinterpret_cast const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_EffectivePowerModeChanged(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().EffectivePowerModeChanged(*reinterpret_cast(&token)); return 0; } int32_t __stdcall get_UserPresenceStatus(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().UserPresenceStatus()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall add_UserPresenceStatusChanged(void* handler, winrt::event_token* token) noexcept final try { zero_abi(token); typename D::abi_guard guard(this->shim()); *token = detach_from(this->shim().UserPresenceStatusChanged(*reinterpret_cast const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_UserPresenceStatusChanged(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().UserPresenceStatusChanged(*reinterpret_cast(&token)); return 0; } int32_t __stdcall get_SystemSuspendStatus(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().SystemSuspendStatus()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall add_SystemSuspendStatusChanged(void* handler, winrt::event_token* token) noexcept final try { zero_abi(token); typename D::abi_guard guard(this->shim()); *token = detach_from(this->shim().SystemSuspendStatusChanged(*reinterpret_cast const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_SystemSuspendStatusChanged(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().SystemSuspendStatusChanged(*reinterpret_cast(&token)); return 0; } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_EffectivePowerMode2(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().EffectivePowerMode2()); return 0; } catch (...) { return to_hresult(); } }; #endif } WINRT_EXPORT namespace winrt::Microsoft::Windows::System::Power { inline auto PowerManager::EnergySaverStatus() { return impl::call_factory_cast([](IPowerManagerStatics const& f) { return f.EnergySaverStatus(); }); } inline auto PowerManager::EnergySaverStatusChanged(winrt::Windows::Foundation::EventHandler const& handler) { return impl::call_factory([&](IPowerManagerStatics const& f) { return f.EnergySaverStatusChanged(handler); }); } inline auto PowerManager::EnergySaverStatusChanged(auto_revoke_t, winrt::Windows::Foundation::EventHandler const& handler) { auto f = get_activation_factory(); return PowerManager::EnergySaverStatusChanged_revoker{ f, f.EnergySaverStatusChanged(handler) }; } inline auto PowerManager::EnergySaverStatusChanged(winrt::event_token const& token) { impl::call_factory([&](IPowerManagerStatics const& f) { return f.EnergySaverStatusChanged(token); }); } inline auto PowerManager::BatteryStatus() { return impl::call_factory_cast([](IPowerManagerStatics const& f) { return f.BatteryStatus(); }); } inline auto PowerManager::BatteryStatusChanged(winrt::Windows::Foundation::EventHandler const& handler) { return impl::call_factory([&](IPowerManagerStatics const& f) { return f.BatteryStatusChanged(handler); }); } inline auto PowerManager::BatteryStatusChanged(auto_revoke_t, winrt::Windows::Foundation::EventHandler const& handler) { auto f = get_activation_factory(); return PowerManager::BatteryStatusChanged_revoker{ f, f.BatteryStatusChanged(handler) }; } inline auto PowerManager::BatteryStatusChanged(winrt::event_token const& token) { impl::call_factory([&](IPowerManagerStatics const& f) { return f.BatteryStatusChanged(token); }); } inline auto PowerManager::PowerSupplyStatus() { return impl::call_factory_cast([](IPowerManagerStatics const& f) { return f.PowerSupplyStatus(); }); } inline auto PowerManager::PowerSupplyStatusChanged(winrt::Windows::Foundation::EventHandler const& handler) { return impl::call_factory([&](IPowerManagerStatics const& f) { return f.PowerSupplyStatusChanged(handler); }); } inline auto PowerManager::PowerSupplyStatusChanged(auto_revoke_t, winrt::Windows::Foundation::EventHandler const& handler) { auto f = get_activation_factory(); return PowerManager::PowerSupplyStatusChanged_revoker{ f, f.PowerSupplyStatusChanged(handler) }; } inline auto PowerManager::PowerSupplyStatusChanged(winrt::event_token const& token) { impl::call_factory([&](IPowerManagerStatics const& f) { return f.PowerSupplyStatusChanged(token); }); } inline auto PowerManager::RemainingChargePercent() { return impl::call_factory_cast([](IPowerManagerStatics const& f) { return f.RemainingChargePercent(); }); } inline auto PowerManager::RemainingChargePercentChanged(winrt::Windows::Foundation::EventHandler const& handler) { return impl::call_factory([&](IPowerManagerStatics const& f) { return f.RemainingChargePercentChanged(handler); }); } inline auto PowerManager::RemainingChargePercentChanged(auto_revoke_t, winrt::Windows::Foundation::EventHandler const& handler) { auto f = get_activation_factory(); return PowerManager::RemainingChargePercentChanged_revoker{ f, f.RemainingChargePercentChanged(handler) }; } inline auto PowerManager::RemainingChargePercentChanged(winrt::event_token const& token) { impl::call_factory([&](IPowerManagerStatics const& f) { return f.RemainingChargePercentChanged(token); }); } inline auto PowerManager::RemainingDischargeTime() { return impl::call_factory_cast([](IPowerManagerStatics const& f) { return f.RemainingDischargeTime(); }); } inline auto PowerManager::RemainingDischargeTimeChanged(winrt::Windows::Foundation::EventHandler const& handler) { return impl::call_factory([&](IPowerManagerStatics const& f) { return f.RemainingDischargeTimeChanged(handler); }); } inline auto PowerManager::RemainingDischargeTimeChanged(auto_revoke_t, winrt::Windows::Foundation::EventHandler const& handler) { auto f = get_activation_factory(); return PowerManager::RemainingDischargeTimeChanged_revoker{ f, f.RemainingDischargeTimeChanged(handler) }; } inline auto PowerManager::RemainingDischargeTimeChanged(winrt::event_token const& token) { impl::call_factory([&](IPowerManagerStatics const& f) { return f.RemainingDischargeTimeChanged(token); }); } inline auto PowerManager::PowerSourceKind() { return impl::call_factory_cast([](IPowerManagerStatics const& f) { return f.PowerSourceKind(); }); } inline auto PowerManager::PowerSourceKindChanged(winrt::Windows::Foundation::EventHandler const& handler) { return impl::call_factory([&](IPowerManagerStatics const& f) { return f.PowerSourceKindChanged(handler); }); } inline auto PowerManager::PowerSourceKindChanged(auto_revoke_t, winrt::Windows::Foundation::EventHandler const& handler) { auto f = get_activation_factory(); return PowerManager::PowerSourceKindChanged_revoker{ f, f.PowerSourceKindChanged(handler) }; } inline auto PowerManager::PowerSourceKindChanged(winrt::event_token const& token) { impl::call_factory([&](IPowerManagerStatics const& f) { return f.PowerSourceKindChanged(token); }); } inline auto PowerManager::DisplayStatus() { return impl::call_factory_cast([](IPowerManagerStatics const& f) { return f.DisplayStatus(); }); } inline auto PowerManager::DisplayStatusChanged(winrt::Windows::Foundation::EventHandler const& handler) { return impl::call_factory([&](IPowerManagerStatics const& f) { return f.DisplayStatusChanged(handler); }); } inline auto PowerManager::DisplayStatusChanged(auto_revoke_t, winrt::Windows::Foundation::EventHandler const& handler) { auto f = get_activation_factory(); return PowerManager::DisplayStatusChanged_revoker{ f, f.DisplayStatusChanged(handler) }; } inline auto PowerManager::DisplayStatusChanged(winrt::event_token const& token) { impl::call_factory([&](IPowerManagerStatics const& f) { return f.DisplayStatusChanged(token); }); } inline auto PowerManager::SystemIdleStatusChanged(winrt::Windows::Foundation::EventHandler const& handler) { return impl::call_factory([&](IPowerManagerStatics const& f) { return f.SystemIdleStatusChanged(handler); }); } inline auto PowerManager::SystemIdleStatusChanged(auto_revoke_t, winrt::Windows::Foundation::EventHandler const& handler) { auto f = get_activation_factory(); return PowerManager::SystemIdleStatusChanged_revoker{ f, f.SystemIdleStatusChanged(handler) }; } inline auto PowerManager::SystemIdleStatusChanged(winrt::event_token const& token) { impl::call_factory([&](IPowerManagerStatics const& f) { return f.SystemIdleStatusChanged(token); }); } inline auto PowerManager::EffectivePowerMode() { return impl::call_factory_cast(*)(IPowerManagerStatics const&), PowerManager, IPowerManagerStatics>([](IPowerManagerStatics const& f) { return f.EffectivePowerMode(); }); } inline auto PowerManager::EffectivePowerModeChanged(winrt::Windows::Foundation::EventHandler const& handler) { return impl::call_factory([&](IPowerManagerStatics const& f) { return f.EffectivePowerModeChanged(handler); }); } inline auto PowerManager::EffectivePowerModeChanged(auto_revoke_t, winrt::Windows::Foundation::EventHandler const& handler) { auto f = get_activation_factory(); return PowerManager::EffectivePowerModeChanged_revoker{ f, f.EffectivePowerModeChanged(handler) }; } inline auto PowerManager::EffectivePowerModeChanged(winrt::event_token const& token) { impl::call_factory([&](IPowerManagerStatics const& f) { return f.EffectivePowerModeChanged(token); }); } inline auto PowerManager::UserPresenceStatus() { return impl::call_factory_cast([](IPowerManagerStatics const& f) { return f.UserPresenceStatus(); }); } inline auto PowerManager::UserPresenceStatusChanged(winrt::Windows::Foundation::EventHandler const& handler) { return impl::call_factory([&](IPowerManagerStatics const& f) { return f.UserPresenceStatusChanged(handler); }); } inline auto PowerManager::UserPresenceStatusChanged(auto_revoke_t, winrt::Windows::Foundation::EventHandler const& handler) { auto f = get_activation_factory(); return PowerManager::UserPresenceStatusChanged_revoker{ f, f.UserPresenceStatusChanged(handler) }; } inline auto PowerManager::UserPresenceStatusChanged(winrt::event_token const& token) { impl::call_factory([&](IPowerManagerStatics const& f) { return f.UserPresenceStatusChanged(token); }); } inline auto PowerManager::SystemSuspendStatus() { return impl::call_factory_cast([](IPowerManagerStatics const& f) { return f.SystemSuspendStatus(); }); } inline auto PowerManager::SystemSuspendStatusChanged(winrt::Windows::Foundation::EventHandler const& handler) { return impl::call_factory([&](IPowerManagerStatics const& f) { return f.SystemSuspendStatusChanged(handler); }); } inline auto PowerManager::SystemSuspendStatusChanged(auto_revoke_t, winrt::Windows::Foundation::EventHandler const& handler) { auto f = get_activation_factory(); return PowerManager::SystemSuspendStatusChanged_revoker{ f, f.SystemSuspendStatusChanged(handler) }; } inline auto PowerManager::SystemSuspendStatusChanged(winrt::event_token const& token) { impl::call_factory([&](IPowerManagerStatics const& f) { return f.SystemSuspendStatusChanged(token); }); } inline auto PowerManager::EffectivePowerMode2() { return impl::call_factory_cast([](IPowerManagerStatics2 const& f) { return f.EffectivePowerMode2(); }); } } 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 {}; #endif #ifdef __cpp_lib_format #endif } #endif