// WARNING: Please don't edit this file. It was generated by C++/WinRT v2.0.240405.15 #pragma once #ifndef WINRT_Windows_UI_Xaml_Printing_H #define WINRT_Windows_UI_Xaml_Printing_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.Xaml.h" #include "winrt/impl/Windows.Foundation.2.h" #include "winrt/impl/Windows.Graphics.Printing.2.h" #include "winrt/impl/Windows.UI.Xaml.2.h" #include "winrt/impl/Windows.UI.Xaml.Printing.2.h" namespace winrt::impl { template auto consume_Windows_UI_Xaml_Printing_IAddPagesEventArgs::PrintTaskOptions() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::UI::Xaml::Printing::IAddPagesEventArgs)->get_PrintTaskOptions(&value)); return winrt::Windows::Graphics::Printing::PrintTaskOptions{ value, take_ownership_from_abi }; } template auto consume_Windows_UI_Xaml_Printing_IGetPreviewPageEventArgs::PageNumber() const { int32_t value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::UI::Xaml::Printing::IGetPreviewPageEventArgs)->get_PageNumber(&value)); return value; } template auto consume_Windows_UI_Xaml_Printing_IPaginateEventArgs::PrintTaskOptions() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::UI::Xaml::Printing::IPaginateEventArgs)->get_PrintTaskOptions(&value)); return winrt::Windows::Graphics::Printing::PrintTaskOptions{ value, take_ownership_from_abi }; } template auto consume_Windows_UI_Xaml_Printing_IPaginateEventArgs::CurrentPreviewPageNumber() const { int32_t value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::UI::Xaml::Printing::IPaginateEventArgs)->get_CurrentPreviewPageNumber(&value)); return value; } template auto consume_Windows_UI_Xaml_Printing_IPrintDocument::DocumentSource() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::UI::Xaml::Printing::IPrintDocument)->get_DocumentSource(&value)); return winrt::Windows::Graphics::Printing::IPrintDocumentSource{ value, take_ownership_from_abi }; } template auto consume_Windows_UI_Xaml_Printing_IPrintDocument::Paginate(winrt::Windows::UI::Xaml::Printing::PaginateEventHandler const& handler) const { winrt::event_token token{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::UI::Xaml::Printing::IPrintDocument)->add_Paginate(*(void**)(&handler), put_abi(token))); return token; } template auto consume_Windows_UI_Xaml_Printing_IPrintDocument::Paginate(auto_revoke_t, winrt::Windows::UI::Xaml::Printing::PaginateEventHandler const& handler) const { return impl::make_event_revoker(this, Paginate(handler)); } template auto consume_Windows_UI_Xaml_Printing_IPrintDocument::Paginate(winrt::event_token const& token) const noexcept { WINRT_IMPL_SHIM(winrt::Windows::UI::Xaml::Printing::IPrintDocument)->remove_Paginate(impl::bind_in(token)); } template auto consume_Windows_UI_Xaml_Printing_IPrintDocument::GetPreviewPage(winrt::Windows::UI::Xaml::Printing::GetPreviewPageEventHandler const& handler) const { winrt::event_token token{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::UI::Xaml::Printing::IPrintDocument)->add_GetPreviewPage(*(void**)(&handler), put_abi(token))); return token; } template auto consume_Windows_UI_Xaml_Printing_IPrintDocument::GetPreviewPage(auto_revoke_t, winrt::Windows::UI::Xaml::Printing::GetPreviewPageEventHandler const& handler) const { return impl::make_event_revoker(this, GetPreviewPage(handler)); } template auto consume_Windows_UI_Xaml_Printing_IPrintDocument::GetPreviewPage(winrt::event_token const& token) const noexcept { WINRT_IMPL_SHIM(winrt::Windows::UI::Xaml::Printing::IPrintDocument)->remove_GetPreviewPage(impl::bind_in(token)); } template auto consume_Windows_UI_Xaml_Printing_IPrintDocument::AddPages(winrt::Windows::UI::Xaml::Printing::AddPagesEventHandler const& handler) const { winrt::event_token token{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::UI::Xaml::Printing::IPrintDocument)->add_AddPages(*(void**)(&handler), put_abi(token))); return token; } template auto consume_Windows_UI_Xaml_Printing_IPrintDocument::AddPages(auto_revoke_t, winrt::Windows::UI::Xaml::Printing::AddPagesEventHandler const& handler) const { return impl::make_event_revoker(this, AddPages(handler)); } template auto consume_Windows_UI_Xaml_Printing_IPrintDocument::AddPages(winrt::event_token const& token) const noexcept { WINRT_IMPL_SHIM(winrt::Windows::UI::Xaml::Printing::IPrintDocument)->remove_AddPages(impl::bind_in(token)); } template auto consume_Windows_UI_Xaml_Printing_IPrintDocument::AddPage(winrt::Windows::UI::Xaml::UIElement const& pageVisual) const { check_hresult(WINRT_IMPL_SHIM(winrt::Windows::UI::Xaml::Printing::IPrintDocument)->AddPage(*(void**)(&pageVisual))); } template auto consume_Windows_UI_Xaml_Printing_IPrintDocument::AddPagesComplete() const { check_hresult(WINRT_IMPL_SHIM(winrt::Windows::UI::Xaml::Printing::IPrintDocument)->AddPagesComplete()); } template auto consume_Windows_UI_Xaml_Printing_IPrintDocument::SetPreviewPageCount(int32_t count, winrt::Windows::UI::Xaml::Printing::PreviewPageCountType const& type) const { check_hresult(WINRT_IMPL_SHIM(winrt::Windows::UI::Xaml::Printing::IPrintDocument)->SetPreviewPageCount(count, static_cast(type))); } template auto consume_Windows_UI_Xaml_Printing_IPrintDocument::SetPreviewPage(int32_t pageNumber, winrt::Windows::UI::Xaml::UIElement const& pageVisual) const { check_hresult(WINRT_IMPL_SHIM(winrt::Windows::UI::Xaml::Printing::IPrintDocument)->SetPreviewPage(pageNumber, *(void**)(&pageVisual))); } template auto consume_Windows_UI_Xaml_Printing_IPrintDocument::InvalidatePreview() const { check_hresult(WINRT_IMPL_SHIM(winrt::Windows::UI::Xaml::Printing::IPrintDocument)->InvalidatePreview()); } template auto consume_Windows_UI_Xaml_Printing_IPrintDocumentFactory::CreateInstance(winrt::Windows::Foundation::IInspectable const& baseInterface, winrt::Windows::Foundation::IInspectable& innerInterface) const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::UI::Xaml::Printing::IPrintDocumentFactory)->CreateInstance(*(void**)(&baseInterface), impl::bind_out(innerInterface), &value)); return winrt::Windows::UI::Xaml::Printing::PrintDocument{ value, take_ownership_from_abi }; } template auto consume_Windows_UI_Xaml_Printing_IPrintDocumentStatics::DocumentSourceProperty() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::UI::Xaml::Printing::IPrintDocumentStatics)->get_DocumentSourceProperty(&value)); return winrt::Windows::UI::Xaml::DependencyProperty{ value, take_ownership_from_abi }; } template struct delegate final : implements_delegate { delegate(H&& handler) : implements_delegate(std::forward(handler)) {} int32_t __stdcall Invoke(void* sender, void* e) noexcept final try { (*this)(*reinterpret_cast(&sender), *reinterpret_cast(&e)); return 0; } catch (...) { return to_hresult(); } }; template struct delegate final : implements_delegate { delegate(H&& handler) : implements_delegate(std::forward(handler)) {} int32_t __stdcall Invoke(void* sender, void* e) noexcept final try { (*this)(*reinterpret_cast(&sender), *reinterpret_cast(&e)); return 0; } catch (...) { return to_hresult(); } }; template struct delegate final : implements_delegate { delegate(H&& handler) : implements_delegate(std::forward(handler)) {} int32_t __stdcall Invoke(void* sender, void* e) noexcept final try { (*this)(*reinterpret_cast(&sender), *reinterpret_cast(&e)); return 0; } catch (...) { return to_hresult(); } }; #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_PrintTaskOptions(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().PrintTaskOptions()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_PageNumber(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().PageNumber()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_PrintTaskOptions(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().PrintTaskOptions()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_CurrentPreviewPageNumber(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().CurrentPreviewPageNumber()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_DocumentSource(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().DocumentSource()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall add_Paginate(void* handler, winrt::event_token* token) noexcept final try { zero_abi(token); typename D::abi_guard guard(this->shim()); *token = detach_from(this->shim().Paginate(*reinterpret_cast(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_Paginate(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().Paginate(*reinterpret_cast(&token)); return 0; } int32_t __stdcall add_GetPreviewPage(void* handler, winrt::event_token* token) noexcept final try { zero_abi(token); typename D::abi_guard guard(this->shim()); *token = detach_from(this->shim().GetPreviewPage(*reinterpret_cast(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_GetPreviewPage(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().GetPreviewPage(*reinterpret_cast(&token)); return 0; } int32_t __stdcall add_AddPages(void* handler, winrt::event_token* token) noexcept final try { zero_abi(token); typename D::abi_guard guard(this->shim()); *token = detach_from(this->shim().AddPages(*reinterpret_cast(&handler))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall remove_AddPages(winrt::event_token token) noexcept final { typename D::abi_guard guard(this->shim()); this->shim().AddPages(*reinterpret_cast(&token)); return 0; } int32_t __stdcall AddPage(void* pageVisual) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().AddPage(*reinterpret_cast(&pageVisual)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall AddPagesComplete() noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().AddPagesComplete(); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall SetPreviewPageCount(int32_t count, int32_t type) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().SetPreviewPageCount(count, *reinterpret_cast(&type)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall SetPreviewPage(int32_t pageNumber, void* pageVisual) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().SetPreviewPage(pageNumber, *reinterpret_cast(&pageVisual)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall InvalidatePreview() noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().InvalidatePreview(); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall CreateInstance(void* baseInterface, void** innerInterface, void** value) noexcept final try { if (innerInterface) *innerInterface = nullptr; winrt::Windows::Foundation::IInspectable winrt_impl_innerInterface; clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().CreateInstance(*reinterpret_cast(&baseInterface), winrt_impl_innerInterface)); if (innerInterface) *innerInterface = detach_abi(winrt_impl_innerInterface); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_DocumentSourceProperty(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().DocumentSourceProperty()); return 0; } catch (...) { return to_hresult(); } }; #endif } WINRT_EXPORT namespace winrt::Windows::UI::Xaml::Printing { inline AddPagesEventArgs::AddPagesEventArgs() : AddPagesEventArgs(impl::call_factory_cast([](winrt::Windows::Foundation::IActivationFactory const& f) { return f.template ActivateInstance(); })) { } inline GetPreviewPageEventArgs::GetPreviewPageEventArgs() : GetPreviewPageEventArgs(impl::call_factory_cast([](winrt::Windows::Foundation::IActivationFactory const& f) { return f.template ActivateInstance(); })) { } inline PaginateEventArgs::PaginateEventArgs() : PaginateEventArgs(impl::call_factory_cast([](winrt::Windows::Foundation::IActivationFactory const& f) { return f.template ActivateInstance(); })) { } inline PrintDocument::PrintDocument() { winrt::Windows::Foundation::IInspectable baseInterface, innerInterface; *this = impl::call_factory([&](IPrintDocumentFactory const& f) { return f.CreateInstance(baseInterface, innerInterface); }); } inline auto PrintDocument::DocumentSourceProperty() { return impl::call_factory_cast([](IPrintDocumentStatics const& f) { return f.DocumentSourceProperty(); }); } template AddPagesEventHandler::AddPagesEventHandler(L handler) : AddPagesEventHandler(impl::make_delegate(std::forward(handler))) { } template AddPagesEventHandler::AddPagesEventHandler(F* handler) : AddPagesEventHandler([=](auto&&... args) { return handler(args...); }) { } template AddPagesEventHandler::AddPagesEventHandler(O* object, M method) : AddPagesEventHandler([=](auto&&... args) { return ((*object).*(method))(args...); }) { } template AddPagesEventHandler::AddPagesEventHandler(com_ptr&& object, M method) : AddPagesEventHandler([o = std::move(object), method](auto&&... args) { return ((*o).*(method))(args...); }) { } template AddPagesEventHandler::AddPagesEventHandler(weak_ref&& object, LM&& lambda_or_method) : AddPagesEventHandler([o = std::move(object), lm = std::forward(lambda_or_method)](auto&&... args) { if (auto s = o.get()) { if constexpr (std::is_member_function_pointer_v) ((*s).*(lm))(args...); else lm(args...); } }) { } template AddPagesEventHandler::AddPagesEventHandler(std::shared_ptr&& object, M method) : AddPagesEventHandler([o = std::move(object), method](auto&&... args) { return ((*o).*(method))(args...); }) { } template AddPagesEventHandler::AddPagesEventHandler(std::weak_ptr&& object, LM&& lambda_or_method) : AddPagesEventHandler([o = std::move(object), lm = std::forward(lambda_or_method)](auto&&... args) { if (auto s = o.lock()) { if constexpr (std::is_member_function_pointer_v) ((*s).*(lm))(args...); else lm(args...); } }) { } inline auto AddPagesEventHandler::operator()(winrt::Windows::Foundation::IInspectable const& sender, winrt::Windows::UI::Xaml::Printing::AddPagesEventArgs const& e) const { check_hresult((*(impl::abi_t**)this)->Invoke(*(void**)(&sender), *(void**)(&e))); } template GetPreviewPageEventHandler::GetPreviewPageEventHandler(L handler) : GetPreviewPageEventHandler(impl::make_delegate(std::forward(handler))) { } template GetPreviewPageEventHandler::GetPreviewPageEventHandler(F* handler) : GetPreviewPageEventHandler([=](auto&&... args) { return handler(args...); }) { } template GetPreviewPageEventHandler::GetPreviewPageEventHandler(O* object, M method) : GetPreviewPageEventHandler([=](auto&&... args) { return ((*object).*(method))(args...); }) { } template GetPreviewPageEventHandler::GetPreviewPageEventHandler(com_ptr&& object, M method) : GetPreviewPageEventHandler([o = std::move(object), method](auto&&... args) { return ((*o).*(method))(args...); }) { } template GetPreviewPageEventHandler::GetPreviewPageEventHandler(weak_ref&& object, LM&& lambda_or_method) : GetPreviewPageEventHandler([o = std::move(object), lm = std::forward(lambda_or_method)](auto&&... args) { if (auto s = o.get()) { if constexpr (std::is_member_function_pointer_v) ((*s).*(lm))(args...); else lm(args...); } }) { } template GetPreviewPageEventHandler::GetPreviewPageEventHandler(std::shared_ptr&& object, M method) : GetPreviewPageEventHandler([o = std::move(object), method](auto&&... args) { return ((*o).*(method))(args...); }) { } template GetPreviewPageEventHandler::GetPreviewPageEventHandler(std::weak_ptr&& object, LM&& lambda_or_method) : GetPreviewPageEventHandler([o = std::move(object), lm = std::forward(lambda_or_method)](auto&&... args) { if (auto s = o.lock()) { if constexpr (std::is_member_function_pointer_v) ((*s).*(lm))(args...); else lm(args...); } }) { } inline auto GetPreviewPageEventHandler::operator()(winrt::Windows::Foundation::IInspectable const& sender, winrt::Windows::UI::Xaml::Printing::GetPreviewPageEventArgs const& e) const { check_hresult((*(impl::abi_t**)this)->Invoke(*(void**)(&sender), *(void**)(&e))); } template PaginateEventHandler::PaginateEventHandler(L handler) : PaginateEventHandler(impl::make_delegate(std::forward(handler))) { } template PaginateEventHandler::PaginateEventHandler(F* handler) : PaginateEventHandler([=](auto&&... args) { return handler(args...); }) { } template PaginateEventHandler::PaginateEventHandler(O* object, M method) : PaginateEventHandler([=](auto&&... args) { return ((*object).*(method))(args...); }) { } template PaginateEventHandler::PaginateEventHandler(com_ptr&& object, M method) : PaginateEventHandler([o = std::move(object), method](auto&&... args) { return ((*o).*(method))(args...); }) { } template PaginateEventHandler::PaginateEventHandler(weak_ref&& object, LM&& lambda_or_method) : PaginateEventHandler([o = std::move(object), lm = std::forward(lambda_or_method)](auto&&... args) { if (auto s = o.get()) { if constexpr (std::is_member_function_pointer_v) ((*s).*(lm))(args...); else lm(args...); } }) { } template PaginateEventHandler::PaginateEventHandler(std::shared_ptr&& object, M method) : PaginateEventHandler([o = std::move(object), method](auto&&... args) { return ((*o).*(method))(args...); }) { } template PaginateEventHandler::PaginateEventHandler(std::weak_ptr&& object, LM&& lambda_or_method) : PaginateEventHandler([o = std::move(object), lm = std::forward(lambda_or_method)](auto&&... args) { if (auto s = o.lock()) { if constexpr (std::is_member_function_pointer_v) ((*s).*(lm))(args...); else lm(args...); } }) { } inline auto PaginateEventHandler::operator()(winrt::Windows::Foundation::IInspectable const& sender, winrt::Windows::UI::Xaml::Printing::PaginateEventArgs const& e) const { check_hresult((*(impl::abi_t**)this)->Invoke(*(void**)(&sender), *(void**)(&e))); } template struct PrintDocumentT : implements, impl::require, impl::base { using composable = PrintDocument; protected: PrintDocumentT() { impl::call_factory([&](IPrintDocumentFactory const& f) { [[maybe_unused]] auto winrt_impl_discarded = f.CreateInstance(*this, this->m_inner); }); } }; } 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