// WARNING: Please don't edit this file. It was generated by C++/WinRT v2.0.240405.15 #pragma once #ifndef WINRT_Windows_UI_Core_Preview_H #define WINRT_Windows_UI_Core_Preview_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.UI.Core.h" #include "winrt/impl/Windows.Foundation.2.h" #include "winrt/impl/Windows.UI.WindowManagement.2.h" #include "winrt/impl/Windows.UI.Core.Preview.2.h" namespace winrt::impl { template auto consume_Windows_UI_Core_Preview_ICoreAppWindowPreviewStatics::GetIdFromWindow(winrt::Windows::UI::WindowManagement::AppWindow const& window) const { int32_t result{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::UI::Core::Preview::ICoreAppWindowPreviewStatics)->GetIdFromWindow(*(void**)(&window), &result)); return result; } template auto consume_Windows_UI_Core_Preview_ISystemNavigationCloseRequestedPreviewEventArgs::Handled() const { bool value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::UI::Core::Preview::ISystemNavigationCloseRequestedPreviewEventArgs)->get_Handled(&value)); return value; } template auto consume_Windows_UI_Core_Preview_ISystemNavigationCloseRequestedPreviewEventArgs::Handled(bool value) const { check_hresult(WINRT_IMPL_SHIM(winrt::Windows::UI::Core::Preview::ISystemNavigationCloseRequestedPreviewEventArgs)->put_Handled(value)); } template auto consume_Windows_UI_Core_Preview_ISystemNavigationCloseRequestedPreviewEventArgs::GetDeferral() const { void* result{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::UI::Core::Preview::ISystemNavigationCloseRequestedPreviewEventArgs)->GetDeferral(&result)); return winrt::Windows::Foundation::Deferral{ result, take_ownership_from_abi }; } template auto consume_Windows_UI_Core_Preview_ISystemNavigationManagerPreview::CloseRequested(winrt::Windows::Foundation::EventHandler const& handler) const { winrt::event_token token{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::UI::Core::Preview::ISystemNavigationManagerPreview)->add_CloseRequested(*(void**)(&handler), put_abi(token))); return token; } template auto consume_Windows_UI_Core_Preview_ISystemNavigationManagerPreview::CloseRequested(auto_revoke_t, winrt::Windows::Foundation::EventHandler const& handler) const { return impl::make_event_revoker(this, CloseRequested(handler)); } template auto consume_Windows_UI_Core_Preview_ISystemNavigationManagerPreview::CloseRequested(winrt::event_token const& token) const noexcept { WINRT_IMPL_SHIM(winrt::Windows::UI::Core::Preview::ISystemNavigationManagerPreview)->remove_CloseRequested(impl::bind_in(token)); } template auto consume_Windows_UI_Core_Preview_ISystemNavigationManagerPreviewStatics::GetForCurrentView() const { void* loader{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::UI::Core::Preview::ISystemNavigationManagerPreviewStatics)->GetForCurrentView(&loader)); return winrt::Windows::UI::Core::Preview::SystemNavigationManagerPreview{ loader, 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 GetIdFromWindow(void* window, int32_t* result) noexcept final try { typename D::abi_guard guard(this->shim()); *result = detach_from(this->shim().GetIdFromWindow(*reinterpret_cast(&window))); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_Handled(bool* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Handled()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_Handled(bool value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().Handled(value); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall GetDeferral(void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from(this->shim().GetDeferral()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall add_CloseRequested(void* handler, winrt::event_token* token) noexcept final try { zero_abi(token); typename D::abi_guard guard(this->shim()); *token = detach_from(this->shim().CloseRequested(*reinterpret_cast const*>(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_CloseRequested(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().CloseRequested(*reinterpret_cast(&token)); return 0; } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall GetForCurrentView(void** loader) noexcept final try { clear_abi(loader); typename D::abi_guard guard(this->shim()); *loader = detach_from(this->shim().GetForCurrentView()); return 0; } catch (...) { return to_hresult(); } }; #endif } WINRT_EXPORT namespace winrt::Windows::UI::Core::Preview { inline auto CoreAppWindowPreview::GetIdFromWindow(winrt::Windows::UI::WindowManagement::AppWindow const& window) { return impl::call_factory([&](ICoreAppWindowPreviewStatics const& f) { return f.GetIdFromWindow(window); }); } inline auto SystemNavigationManagerPreview::GetForCurrentView() { return impl::call_factory_cast([](ISystemNavigationManagerPreviewStatics const& f) { return f.GetForCurrentView(); }); } } 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