// WARNING: Please don't edit this file. It was generated by C++/WinRT v2.0.240405.15 #pragma once #ifndef WINRT_Windows_Data_Pdf_H #define WINRT_Windows_Data_Pdf_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.Foundation.2.h" #include "winrt/impl/Windows.Storage.2.h" #include "winrt/impl/Windows.Storage.Streams.2.h" #include "winrt/impl/Windows.UI.2.h" #include "winrt/impl/Windows.Data.Pdf.2.h" namespace winrt::impl { template auto consume_Windows_Data_Pdf_IPdfDocument::GetPage(uint32_t pageIndex) const { void* pdfPage{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Data::Pdf::IPdfDocument)->GetPage(pageIndex, &pdfPage)); return winrt::Windows::Data::Pdf::PdfPage{ pdfPage, take_ownership_from_abi }; } template auto consume_Windows_Data_Pdf_IPdfDocument::PageCount() const { uint32_t value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Data::Pdf::IPdfDocument)->get_PageCount(&value)); return value; } template auto consume_Windows_Data_Pdf_IPdfDocument::IsPasswordProtected() const { bool value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Data::Pdf::IPdfDocument)->get_IsPasswordProtected(&value)); return value; } template auto consume_Windows_Data_Pdf_IPdfDocumentStatics::LoadFromFileAsync(winrt::Windows::Storage::IStorageFile const& file) const { void* asyncInfo{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Data::Pdf::IPdfDocumentStatics)->LoadFromFileAsync(*(void**)(&file), &asyncInfo)); return winrt::Windows::Foundation::IAsyncOperation{ asyncInfo, take_ownership_from_abi }; } template auto consume_Windows_Data_Pdf_IPdfDocumentStatics::LoadFromFileAsync(winrt::Windows::Storage::IStorageFile const& file, param::hstring const& password) const { void* asyncInfo{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Data::Pdf::IPdfDocumentStatics)->LoadFromFileWithPasswordAsync(*(void**)(&file), *(void**)(&password), &asyncInfo)); return winrt::Windows::Foundation::IAsyncOperation{ asyncInfo, take_ownership_from_abi }; } template auto consume_Windows_Data_Pdf_IPdfDocumentStatics::LoadFromStreamAsync(winrt::Windows::Storage::Streams::IRandomAccessStream const& inputStream) const { void* asyncInfo{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Data::Pdf::IPdfDocumentStatics)->LoadFromStreamAsync(*(void**)(&inputStream), &asyncInfo)); return winrt::Windows::Foundation::IAsyncOperation{ asyncInfo, take_ownership_from_abi }; } template auto consume_Windows_Data_Pdf_IPdfDocumentStatics::LoadFromStreamAsync(winrt::Windows::Storage::Streams::IRandomAccessStream const& inputStream, param::hstring const& password) const { void* asyncInfo{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Data::Pdf::IPdfDocumentStatics)->LoadFromStreamWithPasswordAsync(*(void**)(&inputStream), *(void**)(&password), &asyncInfo)); return winrt::Windows::Foundation::IAsyncOperation{ asyncInfo, take_ownership_from_abi }; } template auto consume_Windows_Data_Pdf_IPdfPage::RenderToStreamAsync(winrt::Windows::Storage::Streams::IRandomAccessStream const& outputStream) const { void* asyncInfo{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Data::Pdf::IPdfPage)->RenderToStreamAsync(*(void**)(&outputStream), &asyncInfo)); return winrt::Windows::Foundation::IAsyncAction{ asyncInfo, take_ownership_from_abi }; } template auto consume_Windows_Data_Pdf_IPdfPage::RenderToStreamAsync(winrt::Windows::Storage::Streams::IRandomAccessStream const& outputStream, winrt::Windows::Data::Pdf::PdfPageRenderOptions const& options) const { void* asyncInfo{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Data::Pdf::IPdfPage)->RenderWithOptionsToStreamAsync(*(void**)(&outputStream), *(void**)(&options), &asyncInfo)); return winrt::Windows::Foundation::IAsyncAction{ asyncInfo, take_ownership_from_abi }; } template auto consume_Windows_Data_Pdf_IPdfPage::PreparePageAsync() const { void* asyncInfo{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Data::Pdf::IPdfPage)->PreparePageAsync(&asyncInfo)); return winrt::Windows::Foundation::IAsyncAction{ asyncInfo, take_ownership_from_abi }; } template auto consume_Windows_Data_Pdf_IPdfPage::Index() const { uint32_t value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Data::Pdf::IPdfPage)->get_Index(&value)); return value; } template auto consume_Windows_Data_Pdf_IPdfPage::Size() const { winrt::Windows::Foundation::Size value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Data::Pdf::IPdfPage)->get_Size(put_abi(value))); return value; } template auto consume_Windows_Data_Pdf_IPdfPage::Dimensions() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Data::Pdf::IPdfPage)->get_Dimensions(&value)); return winrt::Windows::Data::Pdf::PdfPageDimensions{ value, take_ownership_from_abi }; } template auto consume_Windows_Data_Pdf_IPdfPage::Rotation() const { winrt::Windows::Data::Pdf::PdfPageRotation value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Data::Pdf::IPdfPage)->get_Rotation(reinterpret_cast(&value))); return value; } template auto consume_Windows_Data_Pdf_IPdfPage::PreferredZoom() const { float value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Data::Pdf::IPdfPage)->get_PreferredZoom(&value)); return value; } template auto consume_Windows_Data_Pdf_IPdfPageDimensions::MediaBox() const { winrt::Windows::Foundation::Rect value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Data::Pdf::IPdfPageDimensions)->get_MediaBox(put_abi(value))); return value; } template auto consume_Windows_Data_Pdf_IPdfPageDimensions::CropBox() const { winrt::Windows::Foundation::Rect value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Data::Pdf::IPdfPageDimensions)->get_CropBox(put_abi(value))); return value; } template auto consume_Windows_Data_Pdf_IPdfPageDimensions::BleedBox() const { winrt::Windows::Foundation::Rect value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Data::Pdf::IPdfPageDimensions)->get_BleedBox(put_abi(value))); return value; } template auto consume_Windows_Data_Pdf_IPdfPageDimensions::TrimBox() const { winrt::Windows::Foundation::Rect value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Data::Pdf::IPdfPageDimensions)->get_TrimBox(put_abi(value))); return value; } template auto consume_Windows_Data_Pdf_IPdfPageDimensions::ArtBox() const { winrt::Windows::Foundation::Rect value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Data::Pdf::IPdfPageDimensions)->get_ArtBox(put_abi(value))); return value; } template auto consume_Windows_Data_Pdf_IPdfPageRenderOptions::SourceRect() const { winrt::Windows::Foundation::Rect value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Data::Pdf::IPdfPageRenderOptions)->get_SourceRect(put_abi(value))); return value; } template auto consume_Windows_Data_Pdf_IPdfPageRenderOptions::SourceRect(winrt::Windows::Foundation::Rect const& value) const { check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Data::Pdf::IPdfPageRenderOptions)->put_SourceRect(impl::bind_in(value))); } template auto consume_Windows_Data_Pdf_IPdfPageRenderOptions::DestinationWidth() const { uint32_t value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Data::Pdf::IPdfPageRenderOptions)->get_DestinationWidth(&value)); return value; } template auto consume_Windows_Data_Pdf_IPdfPageRenderOptions::DestinationWidth(uint32_t value) const { check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Data::Pdf::IPdfPageRenderOptions)->put_DestinationWidth(value)); } template auto consume_Windows_Data_Pdf_IPdfPageRenderOptions::DestinationHeight() const { uint32_t value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Data::Pdf::IPdfPageRenderOptions)->get_DestinationHeight(&value)); return value; } template auto consume_Windows_Data_Pdf_IPdfPageRenderOptions::DestinationHeight(uint32_t value) const { check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Data::Pdf::IPdfPageRenderOptions)->put_DestinationHeight(value)); } template auto consume_Windows_Data_Pdf_IPdfPageRenderOptions::BackgroundColor() const { winrt::Windows::UI::Color value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Data::Pdf::IPdfPageRenderOptions)->get_BackgroundColor(put_abi(value))); return value; } template auto consume_Windows_Data_Pdf_IPdfPageRenderOptions::BackgroundColor(winrt::Windows::UI::Color const& value) const { check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Data::Pdf::IPdfPageRenderOptions)->put_BackgroundColor(impl::bind_in(value))); } template auto consume_Windows_Data_Pdf_IPdfPageRenderOptions::IsIgnoringHighContrast() const { bool value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Data::Pdf::IPdfPageRenderOptions)->get_IsIgnoringHighContrast(&value)); return value; } template auto consume_Windows_Data_Pdf_IPdfPageRenderOptions::IsIgnoringHighContrast(bool value) const { check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Data::Pdf::IPdfPageRenderOptions)->put_IsIgnoringHighContrast(value)); } template auto consume_Windows_Data_Pdf_IPdfPageRenderOptions::BitmapEncoderId() const { winrt::guid value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Data::Pdf::IPdfPageRenderOptions)->get_BitmapEncoderId(put_abi(value))); return value; } template auto consume_Windows_Data_Pdf_IPdfPageRenderOptions::BitmapEncoderId(winrt::guid const& value) const { check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Data::Pdf::IPdfPageRenderOptions)->put_BitmapEncoderId(impl::bind_in(value))); } #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall GetPage(uint32_t pageIndex, void** pdfPage) noexcept final try { clear_abi(pdfPage); typename D::abi_guard guard(this->shim()); *pdfPage = detach_from(this->shim().GetPage(pageIndex)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_PageCount(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().PageCount()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_IsPasswordProtected(bool* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().IsPasswordProtected()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall LoadFromFileAsync(void* file, void** asyncInfo) noexcept final try { clear_abi(asyncInfo); typename D::abi_guard guard(this->shim()); *asyncInfo = detach_from>(this->shim().LoadFromFileAsync(*reinterpret_cast(&file))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall LoadFromFileWithPasswordAsync(void* file, void* password, void** asyncInfo) noexcept final try { clear_abi(asyncInfo); typename D::abi_guard guard(this->shim()); *asyncInfo = detach_from>(this->shim().LoadFromFileAsync(*reinterpret_cast(&file), *reinterpret_cast(&password))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall LoadFromStreamAsync(void* inputStream, void** asyncInfo) noexcept final try { clear_abi(asyncInfo); typename D::abi_guard guard(this->shim()); *asyncInfo = detach_from>(this->shim().LoadFromStreamAsync(*reinterpret_cast(&inputStream))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall LoadFromStreamWithPasswordAsync(void* inputStream, void* password, void** asyncInfo) noexcept final try { clear_abi(asyncInfo); typename D::abi_guard guard(this->shim()); *asyncInfo = detach_from>(this->shim().LoadFromStreamAsync(*reinterpret_cast(&inputStream), *reinterpret_cast(&password))); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall RenderToStreamAsync(void* outputStream, void** asyncInfo) noexcept final try { clear_abi(asyncInfo); typename D::abi_guard guard(this->shim()); *asyncInfo = detach_from(this->shim().RenderToStreamAsync(*reinterpret_cast(&outputStream))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall RenderWithOptionsToStreamAsync(void* outputStream, void* options, void** asyncInfo) noexcept final try { clear_abi(asyncInfo); typename D::abi_guard guard(this->shim()); *asyncInfo = detach_from(this->shim().RenderToStreamAsync(*reinterpret_cast(&outputStream), *reinterpret_cast(&options))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall PreparePageAsync(void** asyncInfo) noexcept final try { clear_abi(asyncInfo); typename D::abi_guard guard(this->shim()); *asyncInfo = detach_from(this->shim().PreparePageAsync()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Index(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Index()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Size(winrt::Windows::Foundation::Size* value) noexcept final try { zero_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Size()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Dimensions(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Dimensions()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Rotation(int32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Rotation()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_PreferredZoom(float* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().PreferredZoom()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_MediaBox(winrt::Windows::Foundation::Rect* value) noexcept final try { zero_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().MediaBox()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_CropBox(winrt::Windows::Foundation::Rect* value) noexcept final try { zero_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().CropBox()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_BleedBox(winrt::Windows::Foundation::Rect* value) noexcept final try { zero_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().BleedBox()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_TrimBox(winrt::Windows::Foundation::Rect* value) noexcept final try { zero_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().TrimBox()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_ArtBox(winrt::Windows::Foundation::Rect* value) noexcept final try { zero_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().ArtBox()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_SourceRect(winrt::Windows::Foundation::Rect* value) noexcept final try { zero_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().SourceRect()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_SourceRect(winrt::Windows::Foundation::Rect value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().SourceRect(*reinterpret_cast(&value)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_DestinationWidth(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().DestinationWidth()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_DestinationWidth(uint32_t value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().DestinationWidth(value); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_DestinationHeight(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().DestinationHeight()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_DestinationHeight(uint32_t value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().DestinationHeight(value); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_BackgroundColor(struct struct_Windows_UI_Color* value) noexcept final try { zero_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().BackgroundColor()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_BackgroundColor(struct struct_Windows_UI_Color value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().BackgroundColor(*reinterpret_cast(&value)); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_IsIgnoringHighContrast(bool* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().IsIgnoringHighContrast()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_IsIgnoringHighContrast(bool value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().IsIgnoringHighContrast(value); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_BitmapEncoderId(winrt::guid* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().BitmapEncoderId()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall put_BitmapEncoderId(winrt::guid value) noexcept final try { typename D::abi_guard guard(this->shim()); this->shim().BitmapEncoderId(*reinterpret_cast(&value)); return 0; } catch (...) { return to_hresult(); } }; #endif } WINRT_EXPORT namespace winrt::Windows::Data::Pdf { inline auto PdfDocument::LoadFromFileAsync(winrt::Windows::Storage::IStorageFile const& file) { return impl::call_factory([&](IPdfDocumentStatics const& f) { return f.LoadFromFileAsync(file); }); } inline auto PdfDocument::LoadFromFileAsync(winrt::Windows::Storage::IStorageFile const& file, param::hstring const& password) { return impl::call_factory([&](IPdfDocumentStatics const& f) { return f.LoadFromFileAsync(file, password); }); } inline auto PdfDocument::LoadFromStreamAsync(winrt::Windows::Storage::Streams::IRandomAccessStream const& inputStream) { return impl::call_factory([&](IPdfDocumentStatics const& f) { return f.LoadFromStreamAsync(inputStream); }); } inline auto PdfDocument::LoadFromStreamAsync(winrt::Windows::Storage::Streams::IRandomAccessStream const& inputStream, param::hstring const& password) { return impl::call_factory([&](IPdfDocumentStatics const& f) { return f.LoadFromStreamAsync(inputStream, password); }); } inline PdfPageRenderOptions::PdfPageRenderOptions() : PdfPageRenderOptions(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 {}; template<> struct hash : winrt::impl::hash_base {}; #endif #ifdef __cpp_lib_format #endif } #endif