// WARNING: Please don't edit this file. It was generated by C++/WinRT // v2.0.250303.1 #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.250303.1"), "Mismatched C++/WinRT headers."); #define CPPWINRT_VERSION "2.0.250303.1" #include "winrt/Microsoft.Windows.System.h" #include "winrt/impl/Microsoft.Windows.System.Power.2.h" #include "winrt/impl/Windows.Foundation.2.h" namespace winrt::impl { template auto consume_Microsoft_Windows_System_Power_IPowerManagerStatics< D>::EnergySaverStatus() const { winrt::Microsoft::Windows::System::Power::EnergySaverStatus value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::System::Power::IPowerManagerStatics, D const*>(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_EnergySaverStatus( reinterpret_cast(&value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_EnergySaverStatus( reinterpret_cast(&value))); } return value; } template auto consume_Microsoft_Windows_System_Power_IPowerManagerStatics:: EnergySaverStatusChanged( winrt::Windows::Foundation::EventHandler< winrt::Windows::Foundation::IInspectable> const& handler) const { winrt::event_token token{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::System::Power::IPowerManagerStatics, D const*>(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->add_EnergySaverStatusChanged( *(void**)(&handler), put_abi(token))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->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< winrt::Windows::Foundation::IInspectable> 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 { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::System::Power::IPowerManagerStatics, D const*>(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; _winrt_abi_type->remove_EnergySaverStatusChanged(impl::bind_in(token)); } else { auto const _winrt_abi_type = *(abi_t**)this; _winrt_abi_type->remove_EnergySaverStatusChanged(impl::bind_in(token)); } } template auto consume_Microsoft_Windows_System_Power_IPowerManagerStatics< D>::BatteryStatus() const { winrt::Microsoft::Windows::System::Power::BatteryStatus value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::System::Power::IPowerManagerStatics, D const*>(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult( _winrt_abi_type->get_BatteryStatus(reinterpret_cast(&value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult( _winrt_abi_type->get_BatteryStatus(reinterpret_cast(&value))); } return value; } template auto consume_Microsoft_Windows_System_Power_IPowerManagerStatics:: BatteryStatusChanged( winrt::Windows::Foundation::EventHandler< winrt::Windows::Foundation::IInspectable> const& handler) const { winrt::event_token token{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::System::Power::IPowerManagerStatics, D const*>(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->add_BatteryStatusChanged(*(void**)(&handler), put_abi(token))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->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< winrt::Windows::Foundation::IInspectable> const& handler) const { return impl::make_event_revoker( this, BatteryStatusChanged(handler)); } template auto consume_Microsoft_Windows_System_Power_IPowerManagerStatics< D>::BatteryStatusChanged(winrt::event_token const& token) const noexcept { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::System::Power::IPowerManagerStatics, D const*>(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; _winrt_abi_type->remove_BatteryStatusChanged(impl::bind_in(token)); } else { auto const _winrt_abi_type = *(abi_t**)this; _winrt_abi_type->remove_BatteryStatusChanged(impl::bind_in(token)); } } template auto consume_Microsoft_Windows_System_Power_IPowerManagerStatics< D>::PowerSupplyStatus() const { winrt::Microsoft::Windows::System::Power::PowerSupplyStatus value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::System::Power::IPowerManagerStatics, D const*>(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_PowerSupplyStatus( reinterpret_cast(&value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_PowerSupplyStatus( reinterpret_cast(&value))); } return value; } template auto consume_Microsoft_Windows_System_Power_IPowerManagerStatics:: PowerSupplyStatusChanged( winrt::Windows::Foundation::EventHandler< winrt::Windows::Foundation::IInspectable> const& handler) const { winrt::event_token token{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::System::Power::IPowerManagerStatics, D const*>(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->add_PowerSupplyStatusChanged( *(void**)(&handler), put_abi(token))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->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< winrt::Windows::Foundation::IInspectable> 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 { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::System::Power::IPowerManagerStatics, D const*>(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; _winrt_abi_type->remove_PowerSupplyStatusChanged(impl::bind_in(token)); } else { auto const _winrt_abi_type = *(abi_t**)this; _winrt_abi_type->remove_PowerSupplyStatusChanged(impl::bind_in(token)); } } template auto consume_Microsoft_Windows_System_Power_IPowerManagerStatics< D>::RemainingChargePercent() const { int32_t value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::System::Power::IPowerManagerStatics, D const*>(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_RemainingChargePercent(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_RemainingChargePercent(&value)); } return value; } template auto consume_Microsoft_Windows_System_Power_IPowerManagerStatics:: RemainingChargePercentChanged( winrt::Windows::Foundation::EventHandler< winrt::Windows::Foundation::IInspectable> const& handler) const { winrt::event_token token{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::System::Power::IPowerManagerStatics, D const*>(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->add_RemainingChargePercentChanged( *(void**)(&handler), put_abi(token))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->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< winrt::Windows::Foundation::IInspectable> const& handler) const { return impl::make_event_revoker( this, RemainingChargePercentChanged(handler)); } template auto consume_Microsoft_Windows_System_Power_IPowerManagerStatics< D>::RemainingChargePercentChanged(winrt::event_token const& token) const noexcept { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::System::Power::IPowerManagerStatics, D const*>(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; _winrt_abi_type->remove_RemainingChargePercentChanged(impl::bind_in(token)); } else { auto const _winrt_abi_type = *(abi_t**)this; _winrt_abi_type->remove_RemainingChargePercentChanged(impl::bind_in(token)); } } template auto consume_Microsoft_Windows_System_Power_IPowerManagerStatics< D>::RemainingDischargeTime() const { winrt::Windows::Foundation::TimeSpan value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::System::Power::IPowerManagerStatics, D const*>(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_RemainingDischargeTime(put_abi(value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_RemainingDischargeTime(put_abi(value))); } return value; } template auto consume_Microsoft_Windows_System_Power_IPowerManagerStatics:: RemainingDischargeTimeChanged( winrt::Windows::Foundation::EventHandler< winrt::Windows::Foundation::IInspectable> const& handler) const { winrt::event_token token{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::System::Power::IPowerManagerStatics, D const*>(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->add_RemainingDischargeTimeChanged( *(void**)(&handler), put_abi(token))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->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< winrt::Windows::Foundation::IInspectable> const& handler) const { return impl::make_event_revoker( this, RemainingDischargeTimeChanged(handler)); } template auto consume_Microsoft_Windows_System_Power_IPowerManagerStatics< D>::RemainingDischargeTimeChanged(winrt::event_token const& token) const noexcept { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::System::Power::IPowerManagerStatics, D const*>(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; _winrt_abi_type->remove_RemainingDischargeTimeChanged(impl::bind_in(token)); } else { auto const _winrt_abi_type = *(abi_t**)this; _winrt_abi_type->remove_RemainingDischargeTimeChanged(impl::bind_in(token)); } } template auto consume_Microsoft_Windows_System_Power_IPowerManagerStatics< D>::PowerSourceKind() const { winrt::Microsoft::Windows::System::Power::PowerSourceKind value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::System::Power::IPowerManagerStatics, D const*>(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_PowerSourceKind( reinterpret_cast(&value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_PowerSourceKind( reinterpret_cast(&value))); } return value; } template auto consume_Microsoft_Windows_System_Power_IPowerManagerStatics:: PowerSourceKindChanged( winrt::Windows::Foundation::EventHandler< winrt::Windows::Foundation::IInspectable> const& handler) const { winrt::event_token token{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::System::Power::IPowerManagerStatics, D const*>(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->add_PowerSourceKindChanged( *(void**)(&handler), put_abi(token))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->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< winrt::Windows::Foundation::IInspectable> const& handler) const { return impl::make_event_revoker( this, PowerSourceKindChanged(handler)); } template auto consume_Microsoft_Windows_System_Power_IPowerManagerStatics< D>::PowerSourceKindChanged(winrt::event_token const& token) const noexcept { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::System::Power::IPowerManagerStatics, D const*>(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; _winrt_abi_type->remove_PowerSourceKindChanged(impl::bind_in(token)); } else { auto const _winrt_abi_type = *(abi_t**)this; _winrt_abi_type->remove_PowerSourceKindChanged(impl::bind_in(token)); } } template auto consume_Microsoft_Windows_System_Power_IPowerManagerStatics< D>::DisplayStatus() const { winrt::Microsoft::Windows::System::Power::DisplayStatus value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::System::Power::IPowerManagerStatics, D const*>(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult( _winrt_abi_type->get_DisplayStatus(reinterpret_cast(&value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult( _winrt_abi_type->get_DisplayStatus(reinterpret_cast(&value))); } return value; } template auto consume_Microsoft_Windows_System_Power_IPowerManagerStatics:: DisplayStatusChanged( winrt::Windows::Foundation::EventHandler< winrt::Windows::Foundation::IInspectable> const& handler) const { winrt::event_token token{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::System::Power::IPowerManagerStatics, D const*>(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->add_DisplayStatusChanged(*(void**)(&handler), put_abi(token))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->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< winrt::Windows::Foundation::IInspectable> const& handler) const { return impl::make_event_revoker( this, DisplayStatusChanged(handler)); } template auto consume_Microsoft_Windows_System_Power_IPowerManagerStatics< D>::DisplayStatusChanged(winrt::event_token const& token) const noexcept { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::System::Power::IPowerManagerStatics, D const*>(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; _winrt_abi_type->remove_DisplayStatusChanged(impl::bind_in(token)); } else { auto const _winrt_abi_type = *(abi_t**)this; _winrt_abi_type->remove_DisplayStatusChanged(impl::bind_in(token)); } } template auto consume_Microsoft_Windows_System_Power_IPowerManagerStatics:: SystemIdleStatusChanged( winrt::Windows::Foundation::EventHandler< winrt::Windows::Foundation::IInspectable> const& handler) const { winrt::event_token token{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::System::Power::IPowerManagerStatics, D const*>(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->add_SystemIdleStatusChanged( *(void**)(&handler), put_abi(token))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->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< winrt::Windows::Foundation::IInspectable> 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 { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::System::Power::IPowerManagerStatics, D const*>(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; _winrt_abi_type->remove_SystemIdleStatusChanged(impl::bind_in(token)); } else { auto const _winrt_abi_type = *(abi_t**)this; _winrt_abi_type->remove_SystemIdleStatusChanged(impl::bind_in(token)); } } template auto consume_Microsoft_Windows_System_Power_IPowerManagerStatics< D>::EffectivePowerMode() const { void* value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::System::Power::IPowerManagerStatics, D const*>(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_EffectivePowerMode(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_EffectivePowerMode(&value)); } return winrt::Windows::Foundation::IAsyncOperation< winrt::Microsoft::Windows::System::Power::EffectivePowerMode>{ value, take_ownership_from_abi}; } template auto consume_Microsoft_Windows_System_Power_IPowerManagerStatics:: EffectivePowerModeChanged( winrt::Windows::Foundation::EventHandler< winrt::Windows::Foundation::IInspectable> const& handler) const { winrt::event_token token{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::System::Power::IPowerManagerStatics, D const*>(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->add_EffectivePowerModeChanged( *(void**)(&handler), put_abi(token))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->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< winrt::Windows::Foundation::IInspectable> 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 { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::System::Power::IPowerManagerStatics, D const*>(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; _winrt_abi_type->remove_EffectivePowerModeChanged(impl::bind_in(token)); } else { auto const _winrt_abi_type = *(abi_t**)this; _winrt_abi_type->remove_EffectivePowerModeChanged(impl::bind_in(token)); } } template auto consume_Microsoft_Windows_System_Power_IPowerManagerStatics< D>::UserPresenceStatus() const { winrt::Microsoft::Windows::System::Power::UserPresenceStatus value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::System::Power::IPowerManagerStatics, D const*>(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_UserPresenceStatus( reinterpret_cast(&value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_UserPresenceStatus( reinterpret_cast(&value))); } return value; } template auto consume_Microsoft_Windows_System_Power_IPowerManagerStatics:: UserPresenceStatusChanged( winrt::Windows::Foundation::EventHandler< winrt::Windows::Foundation::IInspectable> const& handler) const { winrt::event_token token{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::System::Power::IPowerManagerStatics, D const*>(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->add_UserPresenceStatusChanged( *(void**)(&handler), put_abi(token))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->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< winrt::Windows::Foundation::IInspectable> 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 { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::System::Power::IPowerManagerStatics, D const*>(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; _winrt_abi_type->remove_UserPresenceStatusChanged(impl::bind_in(token)); } else { auto const _winrt_abi_type = *(abi_t**)this; _winrt_abi_type->remove_UserPresenceStatusChanged(impl::bind_in(token)); } } template auto consume_Microsoft_Windows_System_Power_IPowerManagerStatics< D>::SystemSuspendStatus() const { winrt::Microsoft::Windows::System::Power::SystemSuspendStatus value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::System::Power::IPowerManagerStatics, D const*>(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_SystemSuspendStatus( reinterpret_cast(&value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_SystemSuspendStatus( reinterpret_cast(&value))); } return value; } template auto consume_Microsoft_Windows_System_Power_IPowerManagerStatics:: SystemSuspendStatusChanged( winrt::Windows::Foundation::EventHandler< winrt::Windows::Foundation::IInspectable> const& handler) const { winrt::event_token token{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::System::Power::IPowerManagerStatics, D const*>(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->add_SystemSuspendStatusChanged( *(void**)(&handler), put_abi(token))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->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< winrt::Windows::Foundation::IInspectable> 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 { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::System::Power::IPowerManagerStatics, D const*>(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; _winrt_abi_type->remove_SystemSuspendStatusChanged(impl::bind_in(token)); } else { auto const _winrt_abi_type = *(abi_t**)this; _winrt_abi_type->remove_SystemSuspendStatusChanged(impl::bind_in(token)); } } template auto consume_Microsoft_Windows_System_Power_IPowerManagerStatics2< D>::EffectivePowerMode2() const { winrt::Microsoft::Windows::System::Power::EffectivePowerMode value{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason< winrt::Microsoft::Windows::System::Power::IPowerManagerStatics2, D const*>(static_cast(this), _winrt_cast_result_code); check_hresult(_winrt_cast_result_code); auto const _winrt_abi_type = *(abi_t**)&_winrt_casted_result; check_hresult(_winrt_abi_type->get_EffectivePowerMode2( reinterpret_cast(&value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_EffectivePowerMode2( reinterpret_cast(&value))); } return value; } #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base< D, winrt::Microsoft::Windows::System::Power::IPowerManagerStatics> { int32_t __stdcall get_EnergySaverStatus(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from< winrt::Microsoft::Windows::System::Power::EnergySaverStatus>( 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< winrt::Microsoft::Windows::System::Power::PowerSupplyStatus>( 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< winrt::Microsoft::Windows::System::Power::UserPresenceStatus>( 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< winrt::Microsoft::Windows::System::Power::SystemSuspendStatus>( 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< D, winrt::Microsoft::Windows::System::Power::IPowerManagerStatics2> { int32_t __stdcall get_EffectivePowerMode2(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from< winrt::Microsoft::Windows::System::Power::EffectivePowerMode>( this->shim().EffectivePowerMode2()); return 0; } catch (...) { return to_hresult(); } }; #endif } // namespace winrt::impl WINRT_EXPORT namespace winrt::Microsoft::Windows::System::Power { inline auto PowerManager::EnergySaverStatus() { return impl::call_factory_cast< winrt::Microsoft::Windows::System::Power::EnergySaverStatus (*)( IPowerManagerStatics const&), PowerManager, IPowerManagerStatics>( [](IPowerManagerStatics const& f) { return f.EnergySaverStatus(); }); } inline auto PowerManager::EnergySaverStatusChanged( winrt::Windows::Foundation::EventHandler< winrt::Windows::Foundation::IInspectable> const& handler) { return impl::call_factory( [&](IPowerManagerStatics const& f) { return f.EnergySaverStatusChanged(handler); }); } inline auto PowerManager::EnergySaverStatusChanged( auto_revoke_t, winrt::Windows::Foundation::EventHandler< winrt::Windows::Foundation::IInspectable> const& handler) { auto f = get_activation_factory< PowerManager, winrt::Microsoft::Windows::System::Power::IPowerManagerStatics>(); 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< winrt::Microsoft::Windows::System::Power::BatteryStatus (*)( IPowerManagerStatics const&), PowerManager, IPowerManagerStatics>( [](IPowerManagerStatics const& f) { return f.BatteryStatus(); }); } inline auto PowerManager::BatteryStatusChanged( winrt::Windows::Foundation::EventHandler< winrt::Windows::Foundation::IInspectable> const& handler) { return impl::call_factory( [&](IPowerManagerStatics const& f) { return f.BatteryStatusChanged(handler); }); } inline auto PowerManager::BatteryStatusChanged( auto_revoke_t, winrt::Windows::Foundation::EventHandler< winrt::Windows::Foundation::IInspectable> const& handler) { auto f = get_activation_factory< PowerManager, winrt::Microsoft::Windows::System::Power::IPowerManagerStatics>(); 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< winrt::Microsoft::Windows::System::Power::PowerSupplyStatus (*)( IPowerManagerStatics const&), PowerManager, IPowerManagerStatics>( [](IPowerManagerStatics const& f) { return f.PowerSupplyStatus(); }); } inline auto PowerManager::PowerSupplyStatusChanged( winrt::Windows::Foundation::EventHandler< winrt::Windows::Foundation::IInspectable> const& handler) { return impl::call_factory( [&](IPowerManagerStatics const& f) { return f.PowerSupplyStatusChanged(handler); }); } inline auto PowerManager::PowerSupplyStatusChanged( auto_revoke_t, winrt::Windows::Foundation::EventHandler< winrt::Windows::Foundation::IInspectable> const& handler) { auto f = get_activation_factory< PowerManager, winrt::Microsoft::Windows::System::Power::IPowerManagerStatics>(); 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< winrt::Windows::Foundation::IInspectable> const& handler) { return impl::call_factory( [&](IPowerManagerStatics const& f) { return f.RemainingChargePercentChanged(handler); }); } inline auto PowerManager::RemainingChargePercentChanged( auto_revoke_t, winrt::Windows::Foundation::EventHandler< winrt::Windows::Foundation::IInspectable> const& handler) { auto f = get_activation_factory< PowerManager, winrt::Microsoft::Windows::System::Power::IPowerManagerStatics>(); 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< winrt::Windows::Foundation::TimeSpan (*)(IPowerManagerStatics const&), PowerManager, IPowerManagerStatics>([](IPowerManagerStatics const& f) { return f.RemainingDischargeTime(); }); } inline auto PowerManager::RemainingDischargeTimeChanged( winrt::Windows::Foundation::EventHandler< winrt::Windows::Foundation::IInspectable> const& handler) { return impl::call_factory( [&](IPowerManagerStatics const& f) { return f.RemainingDischargeTimeChanged(handler); }); } inline auto PowerManager::RemainingDischargeTimeChanged( auto_revoke_t, winrt::Windows::Foundation::EventHandler< winrt::Windows::Foundation::IInspectable> const& handler) { auto f = get_activation_factory< PowerManager, winrt::Microsoft::Windows::System::Power::IPowerManagerStatics>(); 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< winrt::Microsoft::Windows::System::Power::PowerSourceKind (*)( IPowerManagerStatics const&), PowerManager, IPowerManagerStatics>( [](IPowerManagerStatics const& f) { return f.PowerSourceKind(); }); } inline auto PowerManager::PowerSourceKindChanged( winrt::Windows::Foundation::EventHandler< winrt::Windows::Foundation::IInspectable> const& handler) { return impl::call_factory( [&](IPowerManagerStatics const& f) { return f.PowerSourceKindChanged(handler); }); } inline auto PowerManager::PowerSourceKindChanged( auto_revoke_t, winrt::Windows::Foundation::EventHandler< winrt::Windows::Foundation::IInspectable> const& handler) { auto f = get_activation_factory< PowerManager, winrt::Microsoft::Windows::System::Power::IPowerManagerStatics>(); 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< winrt::Microsoft::Windows::System::Power::DisplayStatus (*)( IPowerManagerStatics const&), PowerManager, IPowerManagerStatics>( [](IPowerManagerStatics const& f) { return f.DisplayStatus(); }); } inline auto PowerManager::DisplayStatusChanged( winrt::Windows::Foundation::EventHandler< winrt::Windows::Foundation::IInspectable> const& handler) { return impl::call_factory( [&](IPowerManagerStatics const& f) { return f.DisplayStatusChanged(handler); }); } inline auto PowerManager::DisplayStatusChanged( auto_revoke_t, winrt::Windows::Foundation::EventHandler< winrt::Windows::Foundation::IInspectable> const& handler) { auto f = get_activation_factory< PowerManager, winrt::Microsoft::Windows::System::Power::IPowerManagerStatics>(); 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< winrt::Windows::Foundation::IInspectable> const& handler) { return impl::call_factory( [&](IPowerManagerStatics const& f) { return f.SystemIdleStatusChanged(handler); }); } inline auto PowerManager::SystemIdleStatusChanged( auto_revoke_t, winrt::Windows::Foundation::EventHandler< winrt::Windows::Foundation::IInspectable> const& handler) { auto f = get_activation_factory< PowerManager, winrt::Microsoft::Windows::System::Power::IPowerManagerStatics>(); 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< winrt::Windows::Foundation::IAsyncOperation< winrt::Microsoft::Windows::System::Power::EffectivePowerMode> (*)( IPowerManagerStatics const&), PowerManager, IPowerManagerStatics>( [](IPowerManagerStatics const& f) { return f.EffectivePowerMode(); }); } inline auto PowerManager::EffectivePowerModeChanged( winrt::Windows::Foundation::EventHandler< winrt::Windows::Foundation::IInspectable> const& handler) { return impl::call_factory( [&](IPowerManagerStatics const& f) { return f.EffectivePowerModeChanged(handler); }); } inline auto PowerManager::EffectivePowerModeChanged( auto_revoke_t, winrt::Windows::Foundation::EventHandler< winrt::Windows::Foundation::IInspectable> const& handler) { auto f = get_activation_factory< PowerManager, winrt::Microsoft::Windows::System::Power::IPowerManagerStatics>(); 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< winrt::Microsoft::Windows::System::Power::UserPresenceStatus (*)( IPowerManagerStatics const&), PowerManager, IPowerManagerStatics>( [](IPowerManagerStatics const& f) { return f.UserPresenceStatus(); }); } inline auto PowerManager::UserPresenceStatusChanged( winrt::Windows::Foundation::EventHandler< winrt::Windows::Foundation::IInspectable> const& handler) { return impl::call_factory( [&](IPowerManagerStatics const& f) { return f.UserPresenceStatusChanged(handler); }); } inline auto PowerManager::UserPresenceStatusChanged( auto_revoke_t, winrt::Windows::Foundation::EventHandler< winrt::Windows::Foundation::IInspectable> const& handler) { auto f = get_activation_factory< PowerManager, winrt::Microsoft::Windows::System::Power::IPowerManagerStatics>(); 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< winrt::Microsoft::Windows::System::Power::SystemSuspendStatus (*)( IPowerManagerStatics const&), PowerManager, IPowerManagerStatics>( [](IPowerManagerStatics const& f) { return f.SystemSuspendStatus(); }); } inline auto PowerManager::SystemSuspendStatusChanged( winrt::Windows::Foundation::EventHandler< winrt::Windows::Foundation::IInspectable> const& handler) { return impl::call_factory( [&](IPowerManagerStatics const& f) { return f.SystemSuspendStatusChanged(handler); }); } inline auto PowerManager::SystemSuspendStatusChanged( auto_revoke_t, winrt::Windows::Foundation::EventHandler< winrt::Windows::Foundation::IInspectable> const& handler) { auto f = get_activation_factory< PowerManager, winrt::Microsoft::Windows::System::Power::IPowerManagerStatics>(); 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< winrt::Microsoft::Windows::System::Power::EffectivePowerMode (*)( IPowerManagerStatics2 const&), PowerManager, IPowerManagerStatics2>( [](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 } // namespace std #endif