// WARNING: Please don't edit this file. It was generated by C++/WinRT v2.0.240405.15 #pragma once #ifndef WINRT_Windows_Devices_Radios_H #define WINRT_Windows_Devices_Radios_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/Windows.Devices.h" #include "winrt/impl/Windows.Foundation.2.h" #include "winrt/impl/Windows.Foundation.Collections.2.h" #include "winrt/impl/Windows.Devices.Radios.2.h" namespace winrt::impl { template auto consume_Windows_Devices_Radios_IRadio::SetStateAsync(winrt::Windows::Devices::Radios::RadioState const& value) const { void* retval{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Radios::IRadio)->SetStateAsync(static_cast(value), &retval)); return winrt::Windows::Foundation::IAsyncOperation{ retval, take_ownership_from_abi }; } template auto consume_Windows_Devices_Radios_IRadio::StateChanged(winrt::Windows::Foundation::TypedEventHandler const& handler) const { winrt::event_token eventCookie{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Radios::IRadio)->add_StateChanged(*(void**)(&handler), put_abi(eventCookie))); return eventCookie; } template auto consume_Windows_Devices_Radios_IRadio::StateChanged(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const { return impl::make_event_revoker(this, StateChanged(handler)); } template auto consume_Windows_Devices_Radios_IRadio::StateChanged(winrt::event_token const& eventCookie) const noexcept { WINRT_IMPL_SHIM(winrt::Windows::Devices::Radios::IRadio)->remove_StateChanged(impl::bind_in(eventCookie)); } template auto consume_Windows_Devices_Radios_IRadio::State() const { winrt::Windows::Devices::Radios::RadioState value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Radios::IRadio)->get_State(reinterpret_cast(&value))); return value; } template auto consume_Windows_Devices_Radios_IRadio::Name() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Radios::IRadio)->get_Name(&value)); return hstring{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Radios_IRadio::Kind() const { winrt::Windows::Devices::Radios::RadioKind value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Radios::IRadio)->get_Kind(reinterpret_cast(&value))); return value; } template auto consume_Windows_Devices_Radios_IRadioStatics::GetRadiosAsync() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Radios::IRadioStatics)->GetRadiosAsync(&value)); return winrt::Windows::Foundation::IAsyncOperation>{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Radios_IRadioStatics::GetDeviceSelector() const { void* deviceSelector{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Radios::IRadioStatics)->GetDeviceSelector(&deviceSelector)); return hstring{ deviceSelector, take_ownership_from_abi }; } template auto consume_Windows_Devices_Radios_IRadioStatics::FromIdAsync(param::hstring const& deviceId) const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Radios::IRadioStatics)->FromIdAsync(*(void**)(&deviceId), &value)); return winrt::Windows::Foundation::IAsyncOperation{ value, take_ownership_from_abi }; } template auto consume_Windows_Devices_Radios_IRadioStatics::RequestAccessAsync() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Devices::Radios::IRadioStatics)->RequestAccessAsync(&value)); return winrt::Windows::Foundation::IAsyncOperation{ value, take_ownership_from_abi }; } #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall SetStateAsync(int32_t value, void** retval) noexcept final try { clear_abi(retval); typename D::abi_guard guard(this->shim()); *retval = detach_from>(this->shim().SetStateAsync(*reinterpret_cast(&value))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall add_StateChanged(void* handler, winrt::event_token* eventCookie) noexcept final try { zero_abi(eventCookie); typename D::abi_guard guard(this->shim()); *eventCookie = detach_from(this->shim().StateChanged(*reinterpret_cast const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_StateChanged(winrt::event_token eventCookie) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().StateChanged(*reinterpret_cast(&eventCookie)); return 0; } int32_t __stdcall get_State(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().State()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Name(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Name()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Kind(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Kind()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall GetRadiosAsync(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from>>(this->shim().GetRadiosAsync()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GetDeviceSelector(void** deviceSelector) noexcept final try { clear_abi(deviceSelector); typename D::abi_guard guard(this->shim()); *deviceSelector = detach_from(this->shim().GetDeviceSelector()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall FromIdAsync(void* deviceId, void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from>(this->shim().FromIdAsync(*reinterpret_cast(&deviceId))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall RequestAccessAsync(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from>(this->shim().RequestAccessAsync()); return 0; } catch (...) { return to_hresult(); } }; #endif } WINRT_EXPORT namespace winrt::Windows::Devices::Radios { inline auto Radio::GetRadiosAsync() { return impl::call_factory_cast>(*)(IRadioStatics const&), Radio, IRadioStatics>([](IRadioStatics const& f) { return f.GetRadiosAsync(); }); } inline auto Radio::GetDeviceSelector() { return impl::call_factory_cast([](IRadioStatics const& f) { return f.GetDeviceSelector(); }); } inline auto Radio::FromIdAsync(param::hstring const& deviceId) { return impl::call_factory([&](IRadioStatics const& f) { return f.FromIdAsync(deviceId); }); } inline auto Radio::RequestAccessAsync() { return impl::call_factory_cast(*)(IRadioStatics const&), Radio, IRadioStatics>([](IRadioStatics const& f) { return f.RequestAccessAsync(); }); } } 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