// WARNING: Please don't edit this file. It was generated by C++/WinRT // v2.0.250303.1 #pragma once #ifndef WINRT_Microsoft_Windows_ApplicationModel_Background_H #define WINRT_Microsoft_Windows_ApplicationModel_Background_H #include "winrt/base.h" static_assert(winrt::check_version(CPPWINRT_VERSION, "2.0.250303.1"), "Mismatched C++/WinRT headers."); #define CPPWINRT_VERSION "2.0.250303.1" #include "winrt/impl/Microsoft.Windows.ApplicationModel.Background.2.h" #include "winrt/impl/Windows.ApplicationModel.Background.2.h" namespace winrt::impl { template auto consume_Microsoft_Windows_ApplicationModel_Background_IBackgroundTaskBuilder< D>::SetTrigger(winrt::Windows::ApplicationModel::Background:: IBackgroundTrigger const& trigger) const { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(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->SetTrigger(*(void**)(&trigger))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->SetTrigger(*(void**)(&trigger))); } } template auto consume_Microsoft_Windows_ApplicationModel_Background_IBackgroundTaskBuilder< D>::SetTaskEntryPointClsid(winrt::guid const& clsId) const { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(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->SetTaskEntryPointClsid(impl::bind_in(clsId))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult( _winrt_abi_type->SetTaskEntryPointClsid(impl::bind_in(clsId))); } } template auto consume_Microsoft_Windows_ApplicationModel_Background_IBackgroundTaskBuilder< D>::AddCondition(winrt::Windows::ApplicationModel::Background:: IBackgroundCondition const& condition) const { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(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->AddCondition(*(void**)(&condition))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->AddCondition(*(void**)(&condition))); } } template auto consume_Microsoft_Windows_ApplicationModel_Background_IBackgroundTaskBuilder< D>::Name(param::hstring const& value) const { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(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->put_Name(*(void**)(&value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->put_Name(*(void**)(&value))); } } template auto consume_Microsoft_Windows_ApplicationModel_Background_IBackgroundTaskBuilder< D>::Name() 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(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_Name(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_Name(&value)); } return hstring{value, take_ownership_from_abi}; } template auto consume_Microsoft_Windows_ApplicationModel_Background_IBackgroundTaskBuilder< D>::TaskGroup(winrt::Windows::ApplicationModel::Background:: BackgroundTaskRegistrationGroup const& value) const { if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(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->put_TaskGroup(*(void**)(&value))); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->put_TaskGroup(*(void**)(&value))); } } template auto consume_Microsoft_Windows_ApplicationModel_Background_IBackgroundTaskBuilder< D>::TaskGroup() 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(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_TaskGroup(&value)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->get_TaskGroup(&value)); } return winrt::Windows::ApplicationModel::Background:: BackgroundTaskRegistrationGroup{value, take_ownership_from_abi}; } template auto consume_Microsoft_Windows_ApplicationModel_Background_IBackgroundTaskBuilder< D>::Register() const { void* task{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(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->Register(&task)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->Register(&task)); } return winrt::Windows::ApplicationModel::Background:: BackgroundTaskRegistration{task, take_ownership_from_abi}; } template auto consume_Microsoft_Windows_ApplicationModel_Background_IBackgroundTaskBuilder< D>::Register(param::hstring const& name) const { void* task{}; if constexpr (!std::is_same_v) { winrt::hresult _winrt_cast_result_code; auto const _winrt_casted_result = impl::try_as_with_reason(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->Register2(*(void**)(&name), &task)); } else { auto const _winrt_abi_type = *(abi_t**)this; check_hresult(_winrt_abi_type->Register2(*(void**)(&name), &task)); } return winrt::Windows::ApplicationModel::Background:: BackgroundTaskRegistration{task, take_ownership_from_abi}; } #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall SetTrigger(void* trigger) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().SetTrigger( *reinterpret_cast(&trigger)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall SetTaskEntryPointClsid(winrt::guid clsId) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().SetTaskEntryPointClsid( *reinterpret_cast(&clsId)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall AddCondition(void* condition) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().AddCondition( *reinterpret_cast(&condition)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_Name(void* value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().Name(*reinterpret_cast(&value)); 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 put_TaskGroup(void* value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().TaskGroup( *reinterpret_cast(&value)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_TaskGroup(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from( this->shim().TaskGroup()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall Register(void** task) noexcept final try { clear_abi(task); typename D::abi_guard guard(this->shim()); *task = detach_from(this->shim().Register()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall Register2(void* name, void** task) noexcept final try { clear_abi(task); typename D::abi_guard guard(this->shim()); *task = detach_from( this->shim().Register(*reinterpret_cast(&name))); return 0; } catch (...) { return to_hresult(); } }; #endif } // namespace winrt::impl WINRT_EXPORT namespace winrt::Microsoft::Windows::ApplicationModel::Background { inline BackgroundTaskBuilder::BackgroundTaskBuilder() : BackgroundTaskBuilder( impl::call_factory_cast< BackgroundTaskBuilder (*)( winrt::Windows::Foundation::IActivationFactory const&), BackgroundTaskBuilder>( [](winrt::Windows::Foundation::IActivationFactory const& f) { return f.template ActivateInstance(); })) {} } namespace std { #ifndef WINRT_LEAN_AND_MEAN template <> struct hash : winrt::impl::hash_base {}; template <> struct hash : winrt::impl::hash_base {}; #endif #ifdef __cpp_lib_format #endif } // namespace std #endif