// WARNING: Please don't edit this file. It was generated by C++/WinRT v2.0.240405.15 #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.240405.15"), "Mismatched C++/WinRT headers."); #define CPPWINRT_VERSION "2.0.240405.15" #include "winrt/impl/Windows.ApplicationModel.Background.2.h" #include "winrt/impl/Microsoft.Windows.ApplicationModel.Background.2.h" namespace winrt::impl { template auto consume_Microsoft_Windows_ApplicationModel_Background_IBackgroundTaskBuilder::SetTrigger(winrt::Windows::ApplicationModel::Background::IBackgroundTrigger const& trigger) const { check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::ApplicationModel::Background::IBackgroundTaskBuilder)->SetTrigger(*(void**)(&trigger))); } template auto consume_Microsoft_Windows_ApplicationModel_Background_IBackgroundTaskBuilder::SetTaskEntryPointClsid(winrt::guid const& clsId) const { check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::ApplicationModel::Background::IBackgroundTaskBuilder)->SetTaskEntryPointClsid(impl::bind_in(clsId))); } template auto consume_Microsoft_Windows_ApplicationModel_Background_IBackgroundTaskBuilder::AddCondition(winrt::Windows::ApplicationModel::Background::IBackgroundCondition const& condition) const { check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::ApplicationModel::Background::IBackgroundTaskBuilder)->AddCondition(*(void**)(&condition))); } template auto consume_Microsoft_Windows_ApplicationModel_Background_IBackgroundTaskBuilder::Name(param::hstring const& value) const { check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::ApplicationModel::Background::IBackgroundTaskBuilder)->put_Name(*(void**)(&value))); } template auto consume_Microsoft_Windows_ApplicationModel_Background_IBackgroundTaskBuilder::Name() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::ApplicationModel::Background::IBackgroundTaskBuilder)->get_Name(&value)); return hstring{ value, take_ownership_from_abi }; } template auto consume_Microsoft_Windows_ApplicationModel_Background_IBackgroundTaskBuilder::TaskGroup(winrt::Windows::ApplicationModel::Background::BackgroundTaskRegistrationGroup const& value) const { check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::ApplicationModel::Background::IBackgroundTaskBuilder)->put_TaskGroup(*(void**)(&value))); } template auto consume_Microsoft_Windows_ApplicationModel_Background_IBackgroundTaskBuilder::TaskGroup() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::ApplicationModel::Background::IBackgroundTaskBuilder)->get_TaskGroup(&value)); return winrt::Windows::ApplicationModel::Background::BackgroundTaskRegistrationGroup{ value, take_ownership_from_abi }; } template auto consume_Microsoft_Windows_ApplicationModel_Background_IBackgroundTaskBuilder::Register() const { void* task{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::ApplicationModel::Background::IBackgroundTaskBuilder)->Register(&task)); return winrt::Windows::ApplicationModel::Background::BackgroundTaskRegistration{ task, take_ownership_from_abi }; } template auto consume_Microsoft_Windows_ApplicationModel_Background_IBackgroundTaskBuilder::Register(param::hstring const& name) const { void* task{}; check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::ApplicationModel::Background::IBackgroundTaskBuilder)->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 } WINRT_EXPORT namespace winrt::Microsoft::Windows::ApplicationModel::Background { inline BackgroundTaskBuilder::BackgroundTaskBuilder() : BackgroundTaskBuilder(impl::call_factory_cast([](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 } #endif