// C++/WinRT v2.0.230511.6 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. #pragma once #ifndef WINRT_Windows_AI_Actions_Hosting_H #define WINRT_Windows_AI_Actions_Hosting_H #include "winrt/base.h" static_assert(winrt::check_version(CPPWINRT_VERSION, "2.0.230511.6"), "Mismatched C++/WinRT headers."); #define CPPWINRT_VERSION "2.0.230511.6" #include "winrt/Windows.AI.Actions.h" #include "winrt/impl/Windows.AI.Actions.2.h" #include "winrt/impl/Windows.Foundation.2.h" #include "winrt/impl/Windows.AI.Actions.Hosting.2.h" namespace winrt::impl { template auto consume_Windows_AI_Actions_Hosting_IActionCatalog::GetAllActions() const { uint32_t result_impl_size{}; void** result{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::AI::Actions::Hosting::IActionCatalog)->GetAllActions(&result_impl_size, &result)); return com_array{ result, result_impl_size, take_ownership_from_abi }; } template auto consume_Windows_AI_Actions_Hosting_IActionCatalog::Changed(winrt::Windows::Foundation::TypedEventHandler const& handler) const { winrt::event_token token{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::AI::Actions::Hosting::IActionCatalog)->add_Changed(*(void**)(&handler), put_abi(token))); return token; } template typename consume_Windows_AI_Actions_Hosting_IActionCatalog::Changed_revoker consume_Windows_AI_Actions_Hosting_IActionCatalog::Changed(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const { return impl::make_event_revoker(this, Changed(handler)); } template auto consume_Windows_AI_Actions_Hosting_IActionCatalog::Changed(winrt::event_token const& token) const noexcept { WINRT_IMPL_SHIM(winrt::Windows::AI::Actions::Hosting::IActionCatalog)->remove_Changed(impl::bind_in(token)); } template auto consume_Windows_AI_Actions_Hosting_IActionDefinition::Id() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::AI::Actions::Hosting::IActionDefinition)->get_Id(&value)); return hstring{ value, take_ownership_from_abi }; } template auto consume_Windows_AI_Actions_Hosting_IActionDefinition::Description() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::AI::Actions::Hosting::IActionDefinition)->get_Description(&value)); return hstring{ value, take_ownership_from_abi }; } template auto consume_Windows_AI_Actions_Hosting_IActionDefinition::IconFullPath() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::AI::Actions::Hosting::IActionDefinition)->get_IconFullPath(&value)); return hstring{ value, take_ownership_from_abi }; } template auto consume_Windows_AI_Actions_Hosting_IActionDefinition::PackageFamilyName() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::AI::Actions::Hosting::IActionDefinition)->get_PackageFamilyName(&value)); return hstring{ value, take_ownership_from_abi }; } template auto consume_Windows_AI_Actions_Hosting_IActionDefinition::GetInputs() const { uint32_t result_impl_size{}; void** result{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::AI::Actions::Hosting::IActionDefinition)->GetInputs(&result_impl_size, &result)); return com_array{ result, result_impl_size, take_ownership_from_abi }; } template auto consume_Windows_AI_Actions_Hosting_IActionDefinition::GetOutputs() const { uint32_t result_impl_size{}; void** result{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::AI::Actions::Hosting::IActionDefinition)->GetOutputs(&result_impl_size, &result)); return com_array{ result, result_impl_size, take_ownership_from_abi }; } template auto consume_Windows_AI_Actions_Hosting_IActionDefinition::GetOverloads() const { uint32_t result_impl_size{}; void** result{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::AI::Actions::Hosting::IActionDefinition)->GetOverloads(&result_impl_size, &result)); return com_array{ result, result_impl_size, take_ownership_from_abi }; } template auto consume_Windows_AI_Actions_Hosting_IActionDefinition2::DisplaysUI() const { bool value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::AI::Actions::Hosting::IActionDefinition2)->get_DisplaysUI(&value)); return value; } template auto consume_Windows_AI_Actions_Hosting_IActionDefinition2::DisclaimerKind() const { winrt::Windows::AI::Actions::Hosting::ActionDisclaimerKind value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::AI::Actions::Hosting::IActionDefinition2)->get_DisclaimerKind(reinterpret_cast(&value))); return value; } template auto consume_Windows_AI_Actions_Hosting_IActionDefinition2::SchemaVersion() const { uint32_t value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::AI::Actions::Hosting::IActionDefinition2)->get_SchemaVersion(&value)); return value; } template auto consume_Windows_AI_Actions_Hosting_IActionDefinition2::PackageRelativeApplicationId() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::AI::Actions::Hosting::IActionDefinition2)->get_PackageRelativeApplicationId(&value)); return hstring{ value, take_ownership_from_abi }; } template auto consume_Windows_AI_Actions_Hosting_IActionEntityRegistrationInfo::Name() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::AI::Actions::Hosting::IActionEntityRegistrationInfo)->get_Name(&value)); return hstring{ value, take_ownership_from_abi }; } template auto consume_Windows_AI_Actions_Hosting_IActionEntityRegistrationInfo::Name(param::hstring const& value) const { check_hresult(WINRT_IMPL_SHIM(winrt::Windows::AI::Actions::Hosting::IActionEntityRegistrationInfo)->put_Name(*(void**)(&value))); } template auto consume_Windows_AI_Actions_Hosting_IActionEntityRegistrationInfo::Kind() const { winrt::Windows::AI::Actions::ActionEntityKind value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::AI::Actions::Hosting::IActionEntityRegistrationInfo)->get_Kind(reinterpret_cast(&value))); return value; } template auto consume_Windows_AI_Actions_Hosting_IActionEntityRegistrationInfo::Kind(winrt::Windows::AI::Actions::ActionEntityKind const& value) const { check_hresult(WINRT_IMPL_SHIM(winrt::Windows::AI::Actions::Hosting::IActionEntityRegistrationInfo)->put_Kind(static_cast(value))); } template auto consume_Windows_AI_Actions_Hosting_IActionOverload::DescriptionTemplate() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::AI::Actions::Hosting::IActionOverload)->get_DescriptionTemplate(&value)); return hstring{ value, take_ownership_from_abi }; } template auto consume_Windows_AI_Actions_Hosting_IActionOverload::GetInputs() const { uint32_t result_impl_size{}; void** result{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::AI::Actions::Hosting::IActionOverload)->GetInputs(&result_impl_size, &result)); return com_array{ result, result_impl_size, take_ownership_from_abi }; } template auto consume_Windows_AI_Actions_Hosting_IActionOverload::InvokeAsync(winrt::Windows::AI::Actions::ActionInvocationContext const& context) const { void* operation{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::AI::Actions::Hosting::IActionOverload)->InvokeAsync(*(void**)(&context), &operation)); return winrt::Windows::Foundation::IAsyncAction{ operation, take_ownership_from_abi }; } template auto consume_Windows_AI_Actions_Hosting_IActionOverload2::InvokeFeedbackAsync(winrt::Windows::AI::Actions::ActionInvocationContext const& context, winrt::Windows::AI::Actions::ActionFeedback const& feedback) const { void* operation{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::AI::Actions::Hosting::IActionOverload2)->InvokeFeedbackAsync(*(void**)(&context), *(void**)(&feedback), &operation)); return winrt::Windows::Foundation::IAsyncAction{ operation, take_ownership_from_abi }; } template auto consume_Windows_AI_Actions_Hosting_IActionOverload2::GetSupportsFeedback() const { bool result{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::AI::Actions::Hosting::IActionOverload2)->GetSupportsFeedback(&result)); return result; } #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall GetAllActions(uint32_t* __resultSize, void*** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); std::tie(*__resultSize, *result) = detach_abi(this->shim().GetAllActions()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall add_Changed(void* handler, winrt::event_token* token) noexcept final try { zero_abi(token); typename D::abi_guard guard(this->shim()); *token = detach_from(this->shim().Changed(*reinterpret_cast const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_Changed(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().Changed(*reinterpret_cast(&token)); return 0; } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_Id(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Id()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Description(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Description()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_IconFullPath(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().IconFullPath()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_PackageFamilyName(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().PackageFamilyName()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GetInputs(uint32_t* __resultSize, void*** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); std::tie(*__resultSize, *result) = detach_abi(this->shim().GetInputs()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GetOutputs(uint32_t* __resultSize, void*** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); std::tie(*__resultSize, *result) = detach_abi(this->shim().GetOutputs()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GetOverloads(uint32_t* __resultSize, void*** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); std::tie(*__resultSize, *result) = detach_abi(this->shim().GetOverloads()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_DisplaysUI(bool* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().DisplaysUI()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_DisclaimerKind(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().DisclaimerKind()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_SchemaVersion(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().SchemaVersion()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_PackageRelativeApplicationId(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().PackageRelativeApplicationId()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { 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_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_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(); } int32_t __stdcall put_Kind(int32_t value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().Kind(*reinterpret_cast(&value)); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_DescriptionTemplate(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().DescriptionTemplate()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GetInputs(uint32_t* __resultSize, void*** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); std::tie(*__resultSize, *result) = detach_abi(this->shim().GetInputs()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall InvokeAsync(void* context, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from(this->shim().InvokeAsync(*reinterpret_cast(&context))); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall InvokeFeedbackAsync(void* context, void* feedback, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from(this->shim().InvokeFeedbackAsync(*reinterpret_cast(&context), *reinterpret_cast(&feedback))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GetSupportsFeedback(bool* result) noexcept final try { typename D::abi_guard guard(this->shim()); *result = detach_from(this->shim().GetSupportsFeedback()); return 0; } catch (...) { return to_hresult(); } }; #endif } WINRT_EXPORT namespace winrt::Windows::AI::Actions::Hosting { } 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 {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; 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