Files
nearby/internal/platform/implementation/windows/generated/winrt/Microsoft.Windows.ApplicationModel.Background.h
T
2026-01-27 23:46:02 -08:00

351 lines
16 KiB
C++

// 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 <typename D>
auto consume_Microsoft_Windows_ApplicationModel_Background_IBackgroundTaskBuilder<
D>::SetTrigger(winrt::Windows::ApplicationModel::Background::
IBackgroundTrigger const& trigger) const {
if constexpr (!std::is_same_v<D, winrt::Microsoft::Windows::ApplicationModel::
Background::IBackgroundTaskBuilder>) {
winrt::hresult _winrt_cast_result_code;
auto const _winrt_casted_result =
impl::try_as_with_reason<winrt::Microsoft::Windows::ApplicationModel::
Background::IBackgroundTaskBuilder,
D const*>(static_cast<D const*>(this),
_winrt_cast_result_code);
check_hresult(_winrt_cast_result_code);
auto const _winrt_abi_type =
*(abi_t<winrt::Microsoft::Windows::ApplicationModel::Background::
IBackgroundTaskBuilder>**)&_winrt_casted_result;
check_hresult(_winrt_abi_type->SetTrigger(*(void**)(&trigger)));
} else {
auto const _winrt_abi_type =
*(abi_t<winrt::Microsoft::Windows::ApplicationModel::Background::
IBackgroundTaskBuilder>**)this;
check_hresult(_winrt_abi_type->SetTrigger(*(void**)(&trigger)));
}
}
template <typename D>
auto consume_Microsoft_Windows_ApplicationModel_Background_IBackgroundTaskBuilder<
D>::SetTaskEntryPointClsid(winrt::guid const& clsId) const {
if constexpr (!std::is_same_v<D, winrt::Microsoft::Windows::ApplicationModel::
Background::IBackgroundTaskBuilder>) {
winrt::hresult _winrt_cast_result_code;
auto const _winrt_casted_result =
impl::try_as_with_reason<winrt::Microsoft::Windows::ApplicationModel::
Background::IBackgroundTaskBuilder,
D const*>(static_cast<D const*>(this),
_winrt_cast_result_code);
check_hresult(_winrt_cast_result_code);
auto const _winrt_abi_type =
*(abi_t<winrt::Microsoft::Windows::ApplicationModel::Background::
IBackgroundTaskBuilder>**)&_winrt_casted_result;
check_hresult(
_winrt_abi_type->SetTaskEntryPointClsid(impl::bind_in(clsId)));
} else {
auto const _winrt_abi_type =
*(abi_t<winrt::Microsoft::Windows::ApplicationModel::Background::
IBackgroundTaskBuilder>**)this;
check_hresult(
_winrt_abi_type->SetTaskEntryPointClsid(impl::bind_in(clsId)));
}
}
template <typename D>
auto consume_Microsoft_Windows_ApplicationModel_Background_IBackgroundTaskBuilder<
D>::AddCondition(winrt::Windows::ApplicationModel::Background::
IBackgroundCondition const& condition) const {
if constexpr (!std::is_same_v<D, winrt::Microsoft::Windows::ApplicationModel::
Background::IBackgroundTaskBuilder>) {
winrt::hresult _winrt_cast_result_code;
auto const _winrt_casted_result =
impl::try_as_with_reason<winrt::Microsoft::Windows::ApplicationModel::
Background::IBackgroundTaskBuilder,
D const*>(static_cast<D const*>(this),
_winrt_cast_result_code);
check_hresult(_winrt_cast_result_code);
auto const _winrt_abi_type =
*(abi_t<winrt::Microsoft::Windows::ApplicationModel::Background::
IBackgroundTaskBuilder>**)&_winrt_casted_result;
check_hresult(_winrt_abi_type->AddCondition(*(void**)(&condition)));
} else {
auto const _winrt_abi_type =
*(abi_t<winrt::Microsoft::Windows::ApplicationModel::Background::
IBackgroundTaskBuilder>**)this;
check_hresult(_winrt_abi_type->AddCondition(*(void**)(&condition)));
}
}
template <typename D>
auto consume_Microsoft_Windows_ApplicationModel_Background_IBackgroundTaskBuilder<
D>::Name(param::hstring const& value) const {
if constexpr (!std::is_same_v<D, winrt::Microsoft::Windows::ApplicationModel::
Background::IBackgroundTaskBuilder>) {
winrt::hresult _winrt_cast_result_code;
auto const _winrt_casted_result =
impl::try_as_with_reason<winrt::Microsoft::Windows::ApplicationModel::
Background::IBackgroundTaskBuilder,
D const*>(static_cast<D const*>(this),
_winrt_cast_result_code);
check_hresult(_winrt_cast_result_code);
auto const _winrt_abi_type =
*(abi_t<winrt::Microsoft::Windows::ApplicationModel::Background::
IBackgroundTaskBuilder>**)&_winrt_casted_result;
check_hresult(_winrt_abi_type->put_Name(*(void**)(&value)));
} else {
auto const _winrt_abi_type =
*(abi_t<winrt::Microsoft::Windows::ApplicationModel::Background::
IBackgroundTaskBuilder>**)this;
check_hresult(_winrt_abi_type->put_Name(*(void**)(&value)));
}
}
template <typename D>
auto consume_Microsoft_Windows_ApplicationModel_Background_IBackgroundTaskBuilder<
D>::Name() const {
void* value{};
if constexpr (!std::is_same_v<D, winrt::Microsoft::Windows::ApplicationModel::
Background::IBackgroundTaskBuilder>) {
winrt::hresult _winrt_cast_result_code;
auto const _winrt_casted_result =
impl::try_as_with_reason<winrt::Microsoft::Windows::ApplicationModel::
Background::IBackgroundTaskBuilder,
D const*>(static_cast<D const*>(this),
_winrt_cast_result_code);
check_hresult(_winrt_cast_result_code);
auto const _winrt_abi_type =
*(abi_t<winrt::Microsoft::Windows::ApplicationModel::Background::
IBackgroundTaskBuilder>**)&_winrt_casted_result;
check_hresult(_winrt_abi_type->get_Name(&value));
} else {
auto const _winrt_abi_type =
*(abi_t<winrt::Microsoft::Windows::ApplicationModel::Background::
IBackgroundTaskBuilder>**)this;
check_hresult(_winrt_abi_type->get_Name(&value));
}
return hstring{value, take_ownership_from_abi};
}
template <typename D>
auto consume_Microsoft_Windows_ApplicationModel_Background_IBackgroundTaskBuilder<
D>::TaskGroup(winrt::Windows::ApplicationModel::Background::
BackgroundTaskRegistrationGroup const& value) const {
if constexpr (!std::is_same_v<D, winrt::Microsoft::Windows::ApplicationModel::
Background::IBackgroundTaskBuilder>) {
winrt::hresult _winrt_cast_result_code;
auto const _winrt_casted_result =
impl::try_as_with_reason<winrt::Microsoft::Windows::ApplicationModel::
Background::IBackgroundTaskBuilder,
D const*>(static_cast<D const*>(this),
_winrt_cast_result_code);
check_hresult(_winrt_cast_result_code);
auto const _winrt_abi_type =
*(abi_t<winrt::Microsoft::Windows::ApplicationModel::Background::
IBackgroundTaskBuilder>**)&_winrt_casted_result;
check_hresult(_winrt_abi_type->put_TaskGroup(*(void**)(&value)));
} else {
auto const _winrt_abi_type =
*(abi_t<winrt::Microsoft::Windows::ApplicationModel::Background::
IBackgroundTaskBuilder>**)this;
check_hresult(_winrt_abi_type->put_TaskGroup(*(void**)(&value)));
}
}
template <typename D>
auto consume_Microsoft_Windows_ApplicationModel_Background_IBackgroundTaskBuilder<
D>::TaskGroup() const {
void* value{};
if constexpr (!std::is_same_v<D, winrt::Microsoft::Windows::ApplicationModel::
Background::IBackgroundTaskBuilder>) {
winrt::hresult _winrt_cast_result_code;
auto const _winrt_casted_result =
impl::try_as_with_reason<winrt::Microsoft::Windows::ApplicationModel::
Background::IBackgroundTaskBuilder,
D const*>(static_cast<D const*>(this),
_winrt_cast_result_code);
check_hresult(_winrt_cast_result_code);
auto const _winrt_abi_type =
*(abi_t<winrt::Microsoft::Windows::ApplicationModel::Background::
IBackgroundTaskBuilder>**)&_winrt_casted_result;
check_hresult(_winrt_abi_type->get_TaskGroup(&value));
} else {
auto const _winrt_abi_type =
*(abi_t<winrt::Microsoft::Windows::ApplicationModel::Background::
IBackgroundTaskBuilder>**)this;
check_hresult(_winrt_abi_type->get_TaskGroup(&value));
}
return winrt::Windows::ApplicationModel::Background::
BackgroundTaskRegistrationGroup{value, take_ownership_from_abi};
}
template <typename D>
auto consume_Microsoft_Windows_ApplicationModel_Background_IBackgroundTaskBuilder<
D>::Register() const {
void* task{};
if constexpr (!std::is_same_v<D, winrt::Microsoft::Windows::ApplicationModel::
Background::IBackgroundTaskBuilder>) {
winrt::hresult _winrt_cast_result_code;
auto const _winrt_casted_result =
impl::try_as_with_reason<winrt::Microsoft::Windows::ApplicationModel::
Background::IBackgroundTaskBuilder,
D const*>(static_cast<D const*>(this),
_winrt_cast_result_code);
check_hresult(_winrt_cast_result_code);
auto const _winrt_abi_type =
*(abi_t<winrt::Microsoft::Windows::ApplicationModel::Background::
IBackgroundTaskBuilder>**)&_winrt_casted_result;
check_hresult(_winrt_abi_type->Register(&task));
} else {
auto const _winrt_abi_type =
*(abi_t<winrt::Microsoft::Windows::ApplicationModel::Background::
IBackgroundTaskBuilder>**)this;
check_hresult(_winrt_abi_type->Register(&task));
}
return winrt::Windows::ApplicationModel::Background::
BackgroundTaskRegistration{task, take_ownership_from_abi};
}
template <typename D>
auto consume_Microsoft_Windows_ApplicationModel_Background_IBackgroundTaskBuilder<
D>::Register(param::hstring const& name) const {
void* task{};
if constexpr (!std::is_same_v<D, winrt::Microsoft::Windows::ApplicationModel::
Background::IBackgroundTaskBuilder>) {
winrt::hresult _winrt_cast_result_code;
auto const _winrt_casted_result =
impl::try_as_with_reason<winrt::Microsoft::Windows::ApplicationModel::
Background::IBackgroundTaskBuilder,
D const*>(static_cast<D const*>(this),
_winrt_cast_result_code);
check_hresult(_winrt_cast_result_code);
auto const _winrt_abi_type =
*(abi_t<winrt::Microsoft::Windows::ApplicationModel::Background::
IBackgroundTaskBuilder>**)&_winrt_casted_result;
check_hresult(_winrt_abi_type->Register2(*(void**)(&name), &task));
} else {
auto const _winrt_abi_type =
*(abi_t<winrt::Microsoft::Windows::ApplicationModel::Background::
IBackgroundTaskBuilder>**)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 <typename D>
struct produce<D, winrt::Microsoft::Windows::ApplicationModel::Background::
IBackgroundTaskBuilder>
: produce_base<D, winrt::Microsoft::Windows::ApplicationModel::Background::
IBackgroundTaskBuilder> {
int32_t __stdcall SetTrigger(void* trigger) noexcept final try {
typename D::abi_guard guard(this->shim());
this->shim().SetTrigger(
*reinterpret_cast<winrt::Windows::ApplicationModel::Background::
IBackgroundTrigger const*>(&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<winrt::guid const*>(&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<winrt::Windows::ApplicationModel::Background::
IBackgroundCondition const*>(&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<hstring const*>(&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<hstring>(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<winrt::Windows::ApplicationModel::Background::
BackgroundTaskRegistrationGroup const*>(&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<winrt::Windows::ApplicationModel::Background::
BackgroundTaskRegistrationGroup>(
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<winrt::Windows::ApplicationModel::Background::
BackgroundTaskRegistration>(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<winrt::Windows::ApplicationModel::Background::
BackgroundTaskRegistration>(
this->shim().Register(*reinterpret_cast<hstring const*>(&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<BackgroundTaskBuilder>();
})) {}
}
namespace std {
#ifndef WINRT_LEAN_AND_MEAN
template <>
struct hash<winrt::Microsoft::Windows::ApplicationModel::Background::
IBackgroundTaskBuilder> : winrt::impl::hash_base {};
template <>
struct hash<winrt::Microsoft::Windows::ApplicationModel::Background::
BackgroundTaskBuilder> : winrt::impl::hash_base {};
#endif
#ifdef __cpp_lib_format
#endif
} // namespace std
#endif