// WARNING: Please don't edit this file. It was generated by C++/WinRT v2.0.240405.15 #pragma once #ifndef WINRT_Windows_ApplicationModel_Search_Core_H #define WINRT_Windows_ApplicationModel_Search_Core_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/Windows.ApplicationModel.Search.h" #include "winrt/impl/Windows.ApplicationModel.Search.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.ApplicationModel.Search.Core.2.h" namespace winrt::impl { template auto consume_Windows_ApplicationModel_Search_Core_ISearchSuggestion::Kind() const { winrt::Windows::ApplicationModel::Search::Core::SearchSuggestionKind value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::ApplicationModel::Search::Core::ISearchSuggestion)->get_Kind(reinterpret_cast(&value))); return value; } template auto consume_Windows_ApplicationModel_Search_Core_ISearchSuggestion::Text() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::ApplicationModel::Search::Core::ISearchSuggestion)->get_Text(&value)); return hstring{ value, take_ownership_from_abi }; } template auto consume_Windows_ApplicationModel_Search_Core_ISearchSuggestion::Tag() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::ApplicationModel::Search::Core::ISearchSuggestion)->get_Tag(&value)); return hstring{ value, take_ownership_from_abi }; } template auto consume_Windows_ApplicationModel_Search_Core_ISearchSuggestion::DetailText() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::ApplicationModel::Search::Core::ISearchSuggestion)->get_DetailText(&value)); return hstring{ value, take_ownership_from_abi }; } template auto consume_Windows_ApplicationModel_Search_Core_ISearchSuggestion::Image() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::ApplicationModel::Search::Core::ISearchSuggestion)->get_Image(&value)); return winrt::Windows::Storage::Streams::IRandomAccessStreamReference{ value, take_ownership_from_abi }; } template auto consume_Windows_ApplicationModel_Search_Core_ISearchSuggestion::ImageAlternateText() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::ApplicationModel::Search::Core::ISearchSuggestion)->get_ImageAlternateText(&value)); return hstring{ value, take_ownership_from_abi }; } template auto consume_Windows_ApplicationModel_Search_Core_ISearchSuggestionManager::SearchHistoryEnabled() const { bool value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::ApplicationModel::Search::Core::ISearchSuggestionManager)->get_SearchHistoryEnabled(&value)); return value; } template auto consume_Windows_ApplicationModel_Search_Core_ISearchSuggestionManager::SearchHistoryEnabled(bool value) const { check_hresult(WINRT_IMPL_SHIM(winrt::Windows::ApplicationModel::Search::Core::ISearchSuggestionManager)->put_SearchHistoryEnabled(value)); } template auto consume_Windows_ApplicationModel_Search_Core_ISearchSuggestionManager::SearchHistoryContext() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::ApplicationModel::Search::Core::ISearchSuggestionManager)->get_SearchHistoryContext(&value)); return hstring{ value, take_ownership_from_abi }; } template auto consume_Windows_ApplicationModel_Search_Core_ISearchSuggestionManager::SearchHistoryContext(param::hstring const& value) const { check_hresult(WINRT_IMPL_SHIM(winrt::Windows::ApplicationModel::Search::Core::ISearchSuggestionManager)->put_SearchHistoryContext(*(void**)(&value))); } template auto consume_Windows_ApplicationModel_Search_Core_ISearchSuggestionManager::SetLocalContentSuggestionSettings(winrt::Windows::ApplicationModel::Search::LocalContentSuggestionSettings const& settings) const { check_hresult(WINRT_IMPL_SHIM(winrt::Windows::ApplicationModel::Search::Core::ISearchSuggestionManager)->SetLocalContentSuggestionSettings(*(void**)(&settings))); } template auto consume_Windows_ApplicationModel_Search_Core_ISearchSuggestionManager::SetQuery(param::hstring const& queryText) const { check_hresult(WINRT_IMPL_SHIM(winrt::Windows::ApplicationModel::Search::Core::ISearchSuggestionManager)->SetQuery(*(void**)(&queryText))); } template auto consume_Windows_ApplicationModel_Search_Core_ISearchSuggestionManager::SetQuery(param::hstring const& queryText, param::hstring const& language) const { check_hresult(WINRT_IMPL_SHIM(winrt::Windows::ApplicationModel::Search::Core::ISearchSuggestionManager)->SetQueryWithLanguage(*(void**)(&queryText), *(void**)(&language))); } template auto consume_Windows_ApplicationModel_Search_Core_ISearchSuggestionManager::SetQuery(param::hstring const& queryText, param::hstring const& language, winrt::Windows::ApplicationModel::Search::SearchQueryLinguisticDetails const& linguisticDetails) const { check_hresult(WINRT_IMPL_SHIM(winrt::Windows::ApplicationModel::Search::Core::ISearchSuggestionManager)->SetQueryWithSearchQueryLinguisticDetails(*(void**)(&queryText), *(void**)(&language), *(void**)(&linguisticDetails))); } template auto consume_Windows_ApplicationModel_Search_Core_ISearchSuggestionManager::Suggestions() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::ApplicationModel::Search::Core::ISearchSuggestionManager)->get_Suggestions(&value)); return winrt::Windows::Foundation::Collections::IObservableVector{ value, take_ownership_from_abi }; } template auto consume_Windows_ApplicationModel_Search_Core_ISearchSuggestionManager::AddToHistory(param::hstring const& queryText) const { check_hresult(WINRT_IMPL_SHIM(winrt::Windows::ApplicationModel::Search::Core::ISearchSuggestionManager)->AddToHistory(*(void**)(&queryText))); } template auto consume_Windows_ApplicationModel_Search_Core_ISearchSuggestionManager::AddToHistory(param::hstring const& queryText, param::hstring const& language) const { check_hresult(WINRT_IMPL_SHIM(winrt::Windows::ApplicationModel::Search::Core::ISearchSuggestionManager)->AddToHistoryWithLanguage(*(void**)(&queryText), *(void**)(&language))); } template auto consume_Windows_ApplicationModel_Search_Core_ISearchSuggestionManager::ClearHistory() const { check_hresult(WINRT_IMPL_SHIM(winrt::Windows::ApplicationModel::Search::Core::ISearchSuggestionManager)->ClearHistory()); } template auto consume_Windows_ApplicationModel_Search_Core_ISearchSuggestionManager::SuggestionsRequested(winrt::Windows::Foundation::TypedEventHandler const& handler) const { winrt::event_token token{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::ApplicationModel::Search::Core::ISearchSuggestionManager)->add_SuggestionsRequested(*(void**)(&handler), put_abi(token))); return token; } template auto consume_Windows_ApplicationModel_Search_Core_ISearchSuggestionManager::SuggestionsRequested(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const { return impl::make_event_revoker(this, SuggestionsRequested(handler)); } template auto consume_Windows_ApplicationModel_Search_Core_ISearchSuggestionManager::SuggestionsRequested(winrt::event_token const& token) const noexcept { WINRT_IMPL_SHIM(winrt::Windows::ApplicationModel::Search::Core::ISearchSuggestionManager)->remove_SuggestionsRequested(impl::bind_in(token)); } template auto consume_Windows_ApplicationModel_Search_Core_ISearchSuggestionManager::RequestingFocusOnKeyboardInput(winrt::Windows::Foundation::TypedEventHandler const& handler) const { winrt::event_token token{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::ApplicationModel::Search::Core::ISearchSuggestionManager)->add_RequestingFocusOnKeyboardInput(*(void**)(&handler), put_abi(token))); return token; } template auto consume_Windows_ApplicationModel_Search_Core_ISearchSuggestionManager::RequestingFocusOnKeyboardInput(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler const& handler) const { return impl::make_event_revoker(this, RequestingFocusOnKeyboardInput(handler)); } template auto consume_Windows_ApplicationModel_Search_Core_ISearchSuggestionManager::RequestingFocusOnKeyboardInput(winrt::event_token const& token) const noexcept { WINRT_IMPL_SHIM(winrt::Windows::ApplicationModel::Search::Core::ISearchSuggestionManager)->remove_RequestingFocusOnKeyboardInput(impl::bind_in(token)); } template auto consume_Windows_ApplicationModel_Search_Core_ISearchSuggestionsRequestedEventArgs::QueryText() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::ApplicationModel::Search::Core::ISearchSuggestionsRequestedEventArgs)->get_QueryText(&value)); return hstring{ value, take_ownership_from_abi }; } template auto consume_Windows_ApplicationModel_Search_Core_ISearchSuggestionsRequestedEventArgs::Language() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::ApplicationModel::Search::Core::ISearchSuggestionsRequestedEventArgs)->get_Language(&value)); return hstring{ value, take_ownership_from_abi }; } template auto consume_Windows_ApplicationModel_Search_Core_ISearchSuggestionsRequestedEventArgs::LinguisticDetails() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::ApplicationModel::Search::Core::ISearchSuggestionsRequestedEventArgs)->get_LinguisticDetails(&value)); return winrt::Windows::ApplicationModel::Search::SearchQueryLinguisticDetails{ value, take_ownership_from_abi }; } template auto consume_Windows_ApplicationModel_Search_Core_ISearchSuggestionsRequestedEventArgs::Request() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::ApplicationModel::Search::Core::ISearchSuggestionsRequestedEventArgs)->get_Request(&value)); return winrt::Windows::ApplicationModel::Search::SearchSuggestionsRequest{ value, take_ownership_from_abi }; } #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { 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 get_Text(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Text()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Tag(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Tag()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_DetailText(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().DetailText()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Image(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Image()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_ImageAlternateText(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().ImageAlternateText()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_SearchHistoryEnabled(bool* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().SearchHistoryEnabled()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_SearchHistoryEnabled(bool value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().SearchHistoryEnabled(value); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_SearchHistoryContext(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().SearchHistoryContext()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_SearchHistoryContext(void* value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().SearchHistoryContext(*reinterpret_cast(&value)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall SetLocalContentSuggestionSettings(void* settings) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().SetLocalContentSuggestionSettings(*reinterpret_cast(&settings)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall SetQuery(void* queryText) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().SetQuery(*reinterpret_cast(&queryText)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall SetQueryWithLanguage(void* queryText, void* language) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().SetQuery(*reinterpret_cast(&queryText), *reinterpret_cast(&language)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall SetQueryWithSearchQueryLinguisticDetails(void* queryText, void* language, void* linguisticDetails) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().SetQuery(*reinterpret_cast(&queryText), *reinterpret_cast(&language), *reinterpret_cast(&linguisticDetails)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Suggestions(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from>(this->shim().Suggestions()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall AddToHistory(void* queryText) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().AddToHistory(*reinterpret_cast(&queryText)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall AddToHistoryWithLanguage(void* queryText, void* language) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().AddToHistory(*reinterpret_cast(&queryText), *reinterpret_cast(&language)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall ClearHistory() noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().ClearHistory(); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall add_SuggestionsRequested(void* handler, winrt::event_token* token) noexcept final try { zero_abi(token); typename D::abi_guard guard(this->shim()); *token = detach_from(this->shim().SuggestionsRequested(*reinterpret_cast const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_SuggestionsRequested(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().SuggestionsRequested(*reinterpret_cast(&token)); return 0; } int32_t __stdcall add_RequestingFocusOnKeyboardInput(void* handler, winrt::event_token* token) noexcept final try { zero_abi(token); typename D::abi_guard guard(this->shim()); *token = detach_from(this->shim().RequestingFocusOnKeyboardInput(*reinterpret_cast const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_RequestingFocusOnKeyboardInput(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().RequestingFocusOnKeyboardInput(*reinterpret_cast(&token)); return 0; } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_QueryText(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().QueryText()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Language(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Language()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_LinguisticDetails(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().LinguisticDetails()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Request(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Request()); return 0; } catch (...) { return to_hresult(); } }; #endif } WINRT_EXPORT namespace winrt::Windows::ApplicationModel::Search::Core { inline SearchSuggestionManager::SearchSuggestionManager() : SearchSuggestionManager(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 {}; 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