// WARNING: Please don't edit this file. It was generated by C++/WinRT v2.0.240405.15 #pragma once #ifndef WINRT_Windows_Services_Cortana_H #define WINRT_Windows_Services_Cortana_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.DataTransfer.2.h" #include "winrt/impl/Windows.Foundation.2.h" #include "winrt/impl/Windows.Foundation.Collections.2.h" #include "winrt/impl/Windows.Storage.Streams.2.h" #include "winrt/impl/Windows.System.2.h" #include "winrt/impl/Windows.Services.Cortana.2.h" namespace winrt::impl { template auto consume_Windows_Services_Cortana_ICortanaActionableInsights::User() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Services::Cortana::ICortanaActionableInsights)->get_User(&value)); return winrt::Windows::System::User{ value, take_ownership_from_abi }; } template auto consume_Windows_Services_Cortana_ICortanaActionableInsights::IsAvailableAsync() const { void* operation{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Services::Cortana::ICortanaActionableInsights)->IsAvailableAsync(&operation)); return winrt::Windows::Foundation::IAsyncOperation{ operation, take_ownership_from_abi }; } template auto consume_Windows_Services_Cortana_ICortanaActionableInsights::ShowInsightsForImageAsync(winrt::Windows::Storage::Streams::IRandomAccessStreamReference const& imageStream) const { void* operation{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Services::Cortana::ICortanaActionableInsights)->ShowInsightsForImageAsync(*(void**)(&imageStream), &operation)); return winrt::Windows::Foundation::IAsyncAction{ operation, take_ownership_from_abi }; } template auto consume_Windows_Services_Cortana_ICortanaActionableInsights::ShowInsightsForImageAsync(winrt::Windows::Storage::Streams::IRandomAccessStreamReference const& imageStream, winrt::Windows::Services::Cortana::CortanaActionableInsightsOptions const& options) const { void* operation{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Services::Cortana::ICortanaActionableInsights)->ShowInsightsForImageWithOptionsAsync(*(void**)(&imageStream), *(void**)(&options), &operation)); return winrt::Windows::Foundation::IAsyncAction{ operation, take_ownership_from_abi }; } template auto consume_Windows_Services_Cortana_ICortanaActionableInsights::ShowInsightsForTextAsync(param::hstring const& text) const { void* operation{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Services::Cortana::ICortanaActionableInsights)->ShowInsightsForTextAsync(*(void**)(&text), &operation)); return winrt::Windows::Foundation::IAsyncAction{ operation, take_ownership_from_abi }; } template auto consume_Windows_Services_Cortana_ICortanaActionableInsights::ShowInsightsForTextAsync(param::hstring const& text, winrt::Windows::Services::Cortana::CortanaActionableInsightsOptions const& options) const { void* operation{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Services::Cortana::ICortanaActionableInsights)->ShowInsightsForTextWithOptionsAsync(*(void**)(&text), *(void**)(&options), &operation)); return winrt::Windows::Foundation::IAsyncAction{ operation, take_ownership_from_abi }; } template auto consume_Windows_Services_Cortana_ICortanaActionableInsights::ShowInsightsAsync(winrt::Windows::ApplicationModel::DataTransfer::DataPackage const& datapackage) const { void* operation{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Services::Cortana::ICortanaActionableInsights)->ShowInsightsAsync(*(void**)(&datapackage), &operation)); return winrt::Windows::Foundation::IAsyncAction{ operation, take_ownership_from_abi }; } template auto consume_Windows_Services_Cortana_ICortanaActionableInsights::ShowInsightsAsync(winrt::Windows::ApplicationModel::DataTransfer::DataPackage const& datapackage, winrt::Windows::Services::Cortana::CortanaActionableInsightsOptions const& options) const { void* operation{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Services::Cortana::ICortanaActionableInsights)->ShowInsightsWithOptionsAsync(*(void**)(&datapackage), *(void**)(&options), &operation)); return winrt::Windows::Foundation::IAsyncAction{ operation, take_ownership_from_abi }; } template auto consume_Windows_Services_Cortana_ICortanaActionableInsightsOptions::ContentSourceWebLink() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Services::Cortana::ICortanaActionableInsightsOptions)->get_ContentSourceWebLink(&value)); return winrt::Windows::Foundation::Uri{ value, take_ownership_from_abi }; } template auto consume_Windows_Services_Cortana_ICortanaActionableInsightsOptions::ContentSourceWebLink(winrt::Windows::Foundation::Uri const& value) const { check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Services::Cortana::ICortanaActionableInsightsOptions)->put_ContentSourceWebLink(*(void**)(&value))); } template auto consume_Windows_Services_Cortana_ICortanaActionableInsightsOptions::SurroundingText() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Services::Cortana::ICortanaActionableInsightsOptions)->get_SurroundingText(&value)); return hstring{ value, take_ownership_from_abi }; } template auto consume_Windows_Services_Cortana_ICortanaActionableInsightsOptions::SurroundingText(param::hstring const& value) const { check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Services::Cortana::ICortanaActionableInsightsOptions)->put_SurroundingText(*(void**)(&value))); } template auto consume_Windows_Services_Cortana_ICortanaActionableInsightsStatics::GetDefault() const { void* result{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Services::Cortana::ICortanaActionableInsightsStatics)->GetDefault(&result)); return winrt::Windows::Services::Cortana::CortanaActionableInsights{ result, take_ownership_from_abi }; } template auto consume_Windows_Services_Cortana_ICortanaActionableInsightsStatics::GetForUser(winrt::Windows::System::User const& user) const { void* result{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Services::Cortana::ICortanaActionableInsightsStatics)->GetForUser(*(void**)(&user), &result)); return winrt::Windows::Services::Cortana::CortanaActionableInsights{ result, take_ownership_from_abi }; } template auto consume_Windows_Services_Cortana_ICortanaPermissionsManager::IsSupported() const { bool result{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Services::Cortana::ICortanaPermissionsManager)->IsSupported(&result)); return result; } template auto consume_Windows_Services_Cortana_ICortanaPermissionsManager::ArePermissionsGrantedAsync(param::async_iterable const& permissions) const { void* getGrantedPermissionsOperation{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Services::Cortana::ICortanaPermissionsManager)->ArePermissionsGrantedAsync(*(void**)(&permissions), &getGrantedPermissionsOperation)); return winrt::Windows::Foundation::IAsyncOperation{ getGrantedPermissionsOperation, take_ownership_from_abi }; } template auto consume_Windows_Services_Cortana_ICortanaPermissionsManager::GrantPermissionsAsync(param::async_iterable const& permissions) const { void* grantOperation{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Services::Cortana::ICortanaPermissionsManager)->GrantPermissionsAsync(*(void**)(&permissions), &grantOperation)); return winrt::Windows::Foundation::IAsyncOperation{ grantOperation, take_ownership_from_abi }; } template auto consume_Windows_Services_Cortana_ICortanaPermissionsManager::RevokePermissionsAsync(param::async_iterable const& permissions) const { void* revokeOperation{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Services::Cortana::ICortanaPermissionsManager)->RevokePermissionsAsync(*(void**)(&permissions), &revokeOperation)); return winrt::Windows::Foundation::IAsyncOperation{ revokeOperation, take_ownership_from_abi }; } template auto consume_Windows_Services_Cortana_ICortanaPermissionsManagerStatics::GetDefault() const { void* result{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Services::Cortana::ICortanaPermissionsManagerStatics)->GetDefault(&result)); return winrt::Windows::Services::Cortana::CortanaPermissionsManager{ result, take_ownership_from_abi }; } template auto consume_Windows_Services_Cortana_ICortanaSettings::HasUserConsentToVoiceActivation() const { bool value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Services::Cortana::ICortanaSettings)->get_HasUserConsentToVoiceActivation(&value)); return value; } template auto consume_Windows_Services_Cortana_ICortanaSettings::IsVoiceActivationEnabled() const { bool value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Services::Cortana::ICortanaSettings)->get_IsVoiceActivationEnabled(&value)); return value; } template auto consume_Windows_Services_Cortana_ICortanaSettings::IsVoiceActivationEnabled(bool value) const { check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Services::Cortana::ICortanaSettings)->put_IsVoiceActivationEnabled(value)); } template auto consume_Windows_Services_Cortana_ICortanaSettingsStatics::IsSupported() const { bool value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Services::Cortana::ICortanaSettingsStatics)->IsSupported(&value)); return value; } template auto consume_Windows_Services_Cortana_ICortanaSettingsStatics::GetDefault() const { void* result{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Services::Cortana::ICortanaSettingsStatics)->GetDefault(&result)); return winrt::Windows::Services::Cortana::CortanaSettings{ result, take_ownership_from_abi }; } #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_User(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().User()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall IsAvailableAsync(void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from>(this->shim().IsAvailableAsync()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall ShowInsightsForImageAsync(void* imageStream, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from(this->shim().ShowInsightsForImageAsync(*reinterpret_cast(&imageStream))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall ShowInsightsForImageWithOptionsAsync(void* imageStream, void* options, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from(this->shim().ShowInsightsForImageAsync(*reinterpret_cast(&imageStream), *reinterpret_cast(&options))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall ShowInsightsForTextAsync(void* text, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from(this->shim().ShowInsightsForTextAsync(*reinterpret_cast(&text))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall ShowInsightsForTextWithOptionsAsync(void* text, void* options, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from(this->shim().ShowInsightsForTextAsync(*reinterpret_cast(&text), *reinterpret_cast(&options))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall ShowInsightsAsync(void* datapackage, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from(this->shim().ShowInsightsAsync(*reinterpret_cast(&datapackage))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall ShowInsightsWithOptionsAsync(void* datapackage, void* options, void** operation) noexcept final try { clear_abi(operation); typename D::abi_guard guard(this->shim()); *operation = detach_from(this->shim().ShowInsightsAsync(*reinterpret_cast(&datapackage), *reinterpret_cast(&options))); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_ContentSourceWebLink(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().ContentSourceWebLink()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_ContentSourceWebLink(void* value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().ContentSourceWebLink(*reinterpret_cast(&value)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_SurroundingText(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().SurroundingText()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_SurroundingText(void* value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().SurroundingText(*reinterpret_cast(&value)); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall GetDefault(void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from(this->shim().GetDefault()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GetForUser(void* user, void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from(this->shim().GetForUser(*reinterpret_cast(&user))); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall IsSupported(bool* result) noexcept final try { typename D::abi_guard guard(this->shim()); *result = detach_from(this->shim().IsSupported()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall ArePermissionsGrantedAsync(void* permissions, void** getGrantedPermissionsOperation) noexcept final try { clear_abi(getGrantedPermissionsOperation); typename D::abi_guard guard(this->shim()); *getGrantedPermissionsOperation = detach_from>(this->shim().ArePermissionsGrantedAsync(*reinterpret_cast const*>(&permissions))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GrantPermissionsAsync(void* permissions, void** grantOperation) noexcept final try { clear_abi(grantOperation); typename D::abi_guard guard(this->shim()); *grantOperation = detach_from>(this->shim().GrantPermissionsAsync(*reinterpret_cast const*>(&permissions))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall RevokePermissionsAsync(void* permissions, void** revokeOperation) noexcept final try { clear_abi(revokeOperation); typename D::abi_guard guard(this->shim()); *revokeOperation = detach_from>(this->shim().RevokePermissionsAsync(*reinterpret_cast const*>(&permissions))); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall GetDefault(void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from(this->shim().GetDefault()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_HasUserConsentToVoiceActivation(bool* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().HasUserConsentToVoiceActivation()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_IsVoiceActivationEnabled(bool* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().IsVoiceActivationEnabled()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_IsVoiceActivationEnabled(bool value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().IsVoiceActivationEnabled(value); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall IsSupported(bool* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().IsSupported()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GetDefault(void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from(this->shim().GetDefault()); return 0; } catch (...) { return to_hresult(); } }; #endif } WINRT_EXPORT namespace winrt::Windows::Services::Cortana { inline auto CortanaActionableInsights::GetDefault() { return impl::call_factory_cast([](ICortanaActionableInsightsStatics const& f) { return f.GetDefault(); }); } inline auto CortanaActionableInsights::GetForUser(winrt::Windows::System::User const& user) { return impl::call_factory([&](ICortanaActionableInsightsStatics const& f) { return f.GetForUser(user); }); } inline CortanaActionableInsightsOptions::CortanaActionableInsightsOptions() : CortanaActionableInsightsOptions(impl::call_factory_cast([](winrt::Windows::Foundation::IActivationFactory const& f) { return f.template ActivateInstance(); })) { } inline auto CortanaPermissionsManager::GetDefault() { return impl::call_factory_cast([](ICortanaPermissionsManagerStatics const& f) { return f.GetDefault(); }); } inline auto CortanaSettings::IsSupported() { return impl::call_factory_cast([](ICortanaSettingsStatics const& f) { return f.IsSupported(); }); } inline auto CortanaSettings::GetDefault() { return impl::call_factory_cast([](ICortanaSettingsStatics const& f) { return f.GetDefault(); }); } } 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 {}; template<> struct hash : winrt::impl::hash_base {}; #endif #ifdef __cpp_lib_format #endif } #endif