blob: 654cb73b2d35112d24deae06df898c8f21deaeb5 [file] [log] [blame]
#[doc(hidden)]
#[repr(transparent)]
pub struct IPdfDocument(::windows::core::IUnknown);
unsafe impl ::windows::core::Interface for IPdfDocument {
type Vtable = IPdfDocument_Vtbl;
}
impl ::core::clone::Clone for IPdfDocument {
fn clone(&self) -> Self {
Self(self.0.clone())
}
}
unsafe impl ::windows::core::ComInterface for IPdfDocument {
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xac7ebedd_80fa_4089_846e_81b77ff5a86c);
}
#[repr(C)]
#[doc(hidden)]
pub struct IPdfDocument_Vtbl {
pub base__: ::windows::core::IInspectable_Vtbl,
pub GetPage: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, pageindex: u32, result__: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT,
pub PageCount: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut u32) -> ::windows::core::HRESULT,
pub IsPasswordProtected: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut bool) -> ::windows::core::HRESULT,
}
#[doc(hidden)]
#[repr(transparent)]
pub struct IPdfDocumentStatics(::windows::core::IUnknown);
unsafe impl ::windows::core::Interface for IPdfDocumentStatics {
type Vtable = IPdfDocumentStatics_Vtbl;
}
impl ::core::clone::Clone for IPdfDocumentStatics {
fn clone(&self) -> Self {
Self(self.0.clone())
}
}
unsafe impl ::windows::core::ComInterface for IPdfDocumentStatics {
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x433a0b5f_c007_4788_90f2_08143d922599);
}
#[repr(C)]
#[doc(hidden)]
pub struct IPdfDocumentStatics_Vtbl {
pub base__: ::windows::core::IInspectable_Vtbl,
#[cfg(all(feature = "Foundation", feature = "Storage"))]
pub LoadFromFileAsync: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, file: *mut ::core::ffi::c_void, result__: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Foundation", feature = "Storage")))]
LoadFromFileAsync: usize,
#[cfg(all(feature = "Foundation", feature = "Storage"))]
pub LoadFromFileWithPasswordAsync: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, file: *mut ::core::ffi::c_void, password: ::std::mem::MaybeUninit<::windows::core::HSTRING>, result__: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Foundation", feature = "Storage")))]
LoadFromFileWithPasswordAsync: usize,
#[cfg(all(feature = "Foundation", feature = "Storage_Streams"))]
pub LoadFromStreamAsync: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, inputstream: *mut ::core::ffi::c_void, result__: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Foundation", feature = "Storage_Streams")))]
LoadFromStreamAsync: usize,
#[cfg(all(feature = "Foundation", feature = "Storage_Streams"))]
pub LoadFromStreamWithPasswordAsync: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, inputstream: *mut ::core::ffi::c_void, password: ::std::mem::MaybeUninit<::windows::core::HSTRING>, result__: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Foundation", feature = "Storage_Streams")))]
LoadFromStreamWithPasswordAsync: usize,
}
#[doc(hidden)]
#[repr(transparent)]
pub struct IPdfPage(::windows::core::IUnknown);
unsafe impl ::windows::core::Interface for IPdfPage {
type Vtable = IPdfPage_Vtbl;
}
impl ::core::clone::Clone for IPdfPage {
fn clone(&self) -> Self {
Self(self.0.clone())
}
}
unsafe impl ::windows::core::ComInterface for IPdfPage {
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x9db4b0c8_5320_4cfc_ad76_493fdad0e594);
}
#[repr(C)]
#[doc(hidden)]
pub struct IPdfPage_Vtbl {
pub base__: ::windows::core::IInspectable_Vtbl,
#[cfg(all(feature = "Foundation", feature = "Storage_Streams"))]
pub RenderToStreamAsync: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, outputstream: *mut ::core::ffi::c_void, result__: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Foundation", feature = "Storage_Streams")))]
RenderToStreamAsync: usize,
#[cfg(all(feature = "Foundation", feature = "Storage_Streams"))]
pub RenderWithOptionsToStreamAsync: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, outputstream: *mut ::core::ffi::c_void, options: *mut ::core::ffi::c_void, result__: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Foundation", feature = "Storage_Streams")))]
RenderWithOptionsToStreamAsync: usize,
#[cfg(feature = "Foundation")]
pub PreparePageAsync: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Foundation"))]
PreparePageAsync: usize,
pub Index: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut u32) -> ::windows::core::HRESULT,
#[cfg(feature = "Foundation")]
pub Size: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut super::super::Foundation::Size) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Foundation"))]
Size: usize,
pub Dimensions: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT,
pub Rotation: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut PdfPageRotation) -> ::windows::core::HRESULT,
pub PreferredZoom: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut f32) -> ::windows::core::HRESULT,
}
#[doc(hidden)]
#[repr(transparent)]
pub struct IPdfPageDimensions(::windows::core::IUnknown);
unsafe impl ::windows::core::Interface for IPdfPageDimensions {
type Vtable = IPdfPageDimensions_Vtbl;
}
impl ::core::clone::Clone for IPdfPageDimensions {
fn clone(&self) -> Self {
Self(self.0.clone())
}
}
unsafe impl ::windows::core::ComInterface for IPdfPageDimensions {
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x22170471_313e_44e8_835d_63a3e7624a10);
}
#[repr(C)]
#[doc(hidden)]
pub struct IPdfPageDimensions_Vtbl {
pub base__: ::windows::core::IInspectable_Vtbl,
#[cfg(feature = "Foundation")]
pub MediaBox: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut super::super::Foundation::Rect) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Foundation"))]
MediaBox: usize,
#[cfg(feature = "Foundation")]
pub CropBox: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut super::super::Foundation::Rect) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Foundation"))]
CropBox: usize,
#[cfg(feature = "Foundation")]
pub BleedBox: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut super::super::Foundation::Rect) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Foundation"))]
BleedBox: usize,
#[cfg(feature = "Foundation")]
pub TrimBox: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut super::super::Foundation::Rect) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Foundation"))]
TrimBox: usize,
#[cfg(feature = "Foundation")]
pub ArtBox: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut super::super::Foundation::Rect) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Foundation"))]
ArtBox: usize,
}
#[doc(hidden)]
#[repr(transparent)]
pub struct IPdfPageRenderOptions(::windows::core::IUnknown);
unsafe impl ::windows::core::Interface for IPdfPageRenderOptions {
type Vtable = IPdfPageRenderOptions_Vtbl;
}
impl ::core::clone::Clone for IPdfPageRenderOptions {
fn clone(&self) -> Self {
Self(self.0.clone())
}
}
unsafe impl ::windows::core::ComInterface for IPdfPageRenderOptions {
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x3c98056f_b7cf_4c29_9a04_52d90267f425);
}
#[repr(C)]
#[doc(hidden)]
pub struct IPdfPageRenderOptions_Vtbl {
pub base__: ::windows::core::IInspectable_Vtbl,
#[cfg(feature = "Foundation")]
pub SourceRect: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut super::super::Foundation::Rect) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Foundation"))]
SourceRect: usize,
#[cfg(feature = "Foundation")]
pub SetSourceRect: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, value: super::super::Foundation::Rect) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Foundation"))]
SetSourceRect: usize,
pub DestinationWidth: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut u32) -> ::windows::core::HRESULT,
pub SetDestinationWidth: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, value: u32) -> ::windows::core::HRESULT,
pub DestinationHeight: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut u32) -> ::windows::core::HRESULT,
pub SetDestinationHeight: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, value: u32) -> ::windows::core::HRESULT,
#[cfg(feature = "UI")]
pub BackgroundColor: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut super::super::UI::Color) -> ::windows::core::HRESULT,
#[cfg(not(feature = "UI"))]
BackgroundColor: usize,
#[cfg(feature = "UI")]
pub SetBackgroundColor: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, value: super::super::UI::Color) -> ::windows::core::HRESULT,
#[cfg(not(feature = "UI"))]
SetBackgroundColor: usize,
pub IsIgnoringHighContrast: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut bool) -> ::windows::core::HRESULT,
pub SetIsIgnoringHighContrast: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, value: bool) -> ::windows::core::HRESULT,
pub BitmapEncoderId: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut ::windows::core::GUID) -> ::windows::core::HRESULT,
pub SetBitmapEncoderId: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, value: ::windows::core::GUID) -> ::windows::core::HRESULT,
}
#[doc = "*Required features: `\"Data_Pdf\"`*"]
#[repr(transparent)]
pub struct PdfDocument(::windows::core::IUnknown);
impl PdfDocument {
pub fn GetPage(&self, pageindex: u32) -> ::windows::core::Result<PdfPage> {
let this = self;
unsafe {
let mut result__ = ::windows::core::zeroed::<PdfPage>();
(::windows::core::Interface::vtable(this).GetPage)(::windows::core::Interface::as_raw(this), pageindex, &mut result__).from_abi(result__)
}
}
pub fn PageCount(&self) -> ::windows::core::Result<u32> {
let this = self;
unsafe {
let mut result__ = ::windows::core::zeroed::<u32>();
(::windows::core::Interface::vtable(this).PageCount)(::windows::core::Interface::as_raw(this), &mut result__).from_abi(result__)
}
}
pub fn IsPasswordProtected(&self) -> ::windows::core::Result<bool> {
let this = self;
unsafe {
let mut result__ = ::windows::core::zeroed::<bool>();
(::windows::core::Interface::vtable(this).IsPasswordProtected)(::windows::core::Interface::as_raw(this), &mut result__).from_abi(result__)
}
}
#[doc = "*Required features: `\"Foundation\"`, `\"Storage\"`*"]
#[cfg(all(feature = "Foundation", feature = "Storage"))]
pub fn LoadFromFileAsync<P0>(file: P0) -> ::windows::core::Result<super::super::Foundation::IAsyncOperation<PdfDocument>>
where
P0: ::windows::core::TryIntoParam<super::super::Storage::IStorageFile>,
{
Self::IPdfDocumentStatics(|this| unsafe {
let mut result__ = ::windows::core::zeroed::<super::super::Foundation::IAsyncOperation<PdfDocument>>();
(::windows::core::Interface::vtable(this).LoadFromFileAsync)(::windows::core::Interface::as_raw(this), file.try_into_param()?.abi(), &mut result__).from_abi(result__)
})
}
#[doc = "*Required features: `\"Foundation\"`, `\"Storage\"`*"]
#[cfg(all(feature = "Foundation", feature = "Storage"))]
pub fn LoadFromFileWithPasswordAsync<P0>(file: P0, password: &::windows::core::HSTRING) -> ::windows::core::Result<super::super::Foundation::IAsyncOperation<PdfDocument>>
where
P0: ::windows::core::TryIntoParam<super::super::Storage::IStorageFile>,
{
Self::IPdfDocumentStatics(|this| unsafe {
let mut result__ = ::windows::core::zeroed::<super::super::Foundation::IAsyncOperation<PdfDocument>>();
(::windows::core::Interface::vtable(this).LoadFromFileWithPasswordAsync)(::windows::core::Interface::as_raw(this), file.try_into_param()?.abi(), ::core::mem::transmute_copy(password), &mut result__).from_abi(result__)
})
}
#[doc = "*Required features: `\"Foundation\"`, `\"Storage_Streams\"`*"]
#[cfg(all(feature = "Foundation", feature = "Storage_Streams"))]
pub fn LoadFromStreamAsync<P0>(inputstream: P0) -> ::windows::core::Result<super::super::Foundation::IAsyncOperation<PdfDocument>>
where
P0: ::windows::core::TryIntoParam<super::super::Storage::Streams::IRandomAccessStream>,
{
Self::IPdfDocumentStatics(|this| unsafe {
let mut result__ = ::windows::core::zeroed::<super::super::Foundation::IAsyncOperation<PdfDocument>>();
(::windows::core::Interface::vtable(this).LoadFromStreamAsync)(::windows::core::Interface::as_raw(this), inputstream.try_into_param()?.abi(), &mut result__).from_abi(result__)
})
}
#[doc = "*Required features: `\"Foundation\"`, `\"Storage_Streams\"`*"]
#[cfg(all(feature = "Foundation", feature = "Storage_Streams"))]
pub fn LoadFromStreamWithPasswordAsync<P0>(inputstream: P0, password: &::windows::core::HSTRING) -> ::windows::core::Result<super::super::Foundation::IAsyncOperation<PdfDocument>>
where
P0: ::windows::core::TryIntoParam<super::super::Storage::Streams::IRandomAccessStream>,
{
Self::IPdfDocumentStatics(|this| unsafe {
let mut result__ = ::windows::core::zeroed::<super::super::Foundation::IAsyncOperation<PdfDocument>>();
(::windows::core::Interface::vtable(this).LoadFromStreamWithPasswordAsync)(::windows::core::Interface::as_raw(this), inputstream.try_into_param()?.abi(), ::core::mem::transmute_copy(password), &mut result__).from_abi(result__)
})
}
#[doc(hidden)]
pub fn IPdfDocumentStatics<R, F: FnOnce(&IPdfDocumentStatics) -> ::windows::core::Result<R>>(callback: F) -> ::windows::core::Result<R> {
static SHARED: ::windows::imp::FactoryCache<PdfDocument, IPdfDocumentStatics> = ::windows::imp::FactoryCache::new();
SHARED.call(callback)
}
}
impl ::core::cmp::PartialEq for PdfDocument {
fn eq(&self, other: &Self) -> bool {
self.0 == other.0
}
}
impl ::core::cmp::Eq for PdfDocument {}
impl ::core::fmt::Debug for PdfDocument {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_tuple("PdfDocument").field(&self.0).finish()
}
}
impl ::windows::core::RuntimeType for PdfDocument {
const SIGNATURE: ::windows::imp::ConstBuffer = ::windows::imp::ConstBuffer::from_slice(b"rc(Windows.Data.Pdf.PdfDocument;{ac7ebedd-80fa-4089-846e-81b77ff5a86c})");
}
impl ::core::clone::Clone for PdfDocument {
fn clone(&self) -> Self {
Self(self.0.clone())
}
}
unsafe impl ::windows::core::Interface for PdfDocument {
type Vtable = IPdfDocument_Vtbl;
}
unsafe impl ::windows::core::ComInterface for PdfDocument {
const IID: ::windows::core::GUID = <IPdfDocument as ::windows::core::ComInterface>::IID;
}
impl ::windows::core::RuntimeName for PdfDocument {
const NAME: &'static str = "Windows.Data.Pdf.PdfDocument";
}
::windows::imp::interface_hierarchy!(PdfDocument, ::windows::core::IUnknown, ::windows::core::IInspectable);
unsafe impl ::core::marker::Send for PdfDocument {}
unsafe impl ::core::marker::Sync for PdfDocument {}
#[doc = "*Required features: `\"Data_Pdf\"`*"]
#[repr(transparent)]
pub struct PdfPage(::windows::core::IUnknown);
impl PdfPage {
#[doc = "*Required features: `\"Foundation\"`*"]
#[cfg(feature = "Foundation")]
pub fn Close(&self) -> ::windows::core::Result<()> {
let this = &::windows::core::ComInterface::cast::<super::super::Foundation::IClosable>(self)?;
unsafe { (::windows::core::Interface::vtable(this).Close)(::windows::core::Interface::as_raw(this)).ok() }
}
#[doc = "*Required features: `\"Foundation\"`, `\"Storage_Streams\"`*"]
#[cfg(all(feature = "Foundation", feature = "Storage_Streams"))]
pub fn RenderToStreamAsync<P0>(&self, outputstream: P0) -> ::windows::core::Result<super::super::Foundation::IAsyncAction>
where
P0: ::windows::core::TryIntoParam<super::super::Storage::Streams::IRandomAccessStream>,
{
let this = self;
unsafe {
let mut result__ = ::windows::core::zeroed::<super::super::Foundation::IAsyncAction>();
(::windows::core::Interface::vtable(this).RenderToStreamAsync)(::windows::core::Interface::as_raw(this), outputstream.try_into_param()?.abi(), &mut result__).from_abi(result__)
}
}
#[doc = "*Required features: `\"Foundation\"`, `\"Storage_Streams\"`*"]
#[cfg(all(feature = "Foundation", feature = "Storage_Streams"))]
pub fn RenderWithOptionsToStreamAsync<P0>(&self, outputstream: P0, options: &PdfPageRenderOptions) -> ::windows::core::Result<super::super::Foundation::IAsyncAction>
where
P0: ::windows::core::TryIntoParam<super::super::Storage::Streams::IRandomAccessStream>,
{
let this = self;
unsafe {
let mut result__ = ::windows::core::zeroed::<super::super::Foundation::IAsyncAction>();
(::windows::core::Interface::vtable(this).RenderWithOptionsToStreamAsync)(::windows::core::Interface::as_raw(this), outputstream.try_into_param()?.abi(), ::core::mem::transmute_copy(options), &mut result__).from_abi(result__)
}
}
#[doc = "*Required features: `\"Foundation\"`*"]
#[cfg(feature = "Foundation")]
pub fn PreparePageAsync(&self) -> ::windows::core::Result<super::super::Foundation::IAsyncAction> {
let this = self;
unsafe {
let mut result__ = ::windows::core::zeroed::<super::super::Foundation::IAsyncAction>();
(::windows::core::Interface::vtable(this).PreparePageAsync)(::windows::core::Interface::as_raw(this), &mut result__).from_abi(result__)
}
}
pub fn Index(&self) -> ::windows::core::Result<u32> {
let this = self;
unsafe {
let mut result__ = ::windows::core::zeroed::<u32>();
(::windows::core::Interface::vtable(this).Index)(::windows::core::Interface::as_raw(this), &mut result__).from_abi(result__)
}
}
#[doc = "*Required features: `\"Foundation\"`*"]
#[cfg(feature = "Foundation")]
pub fn Size(&self) -> ::windows::core::Result<super::super::Foundation::Size> {
let this = self;
unsafe {
let mut result__ = ::windows::core::zeroed::<super::super::Foundation::Size>();
(::windows::core::Interface::vtable(this).Size)(::windows::core::Interface::as_raw(this), &mut result__).from_abi(result__)
}
}
pub fn Dimensions(&self) -> ::windows::core::Result<PdfPageDimensions> {
let this = self;
unsafe {
let mut result__ = ::windows::core::zeroed::<PdfPageDimensions>();
(::windows::core::Interface::vtable(this).Dimensions)(::windows::core::Interface::as_raw(this), &mut result__).from_abi(result__)
}
}
pub fn Rotation(&self) -> ::windows::core::Result<PdfPageRotation> {
let this = self;
unsafe {
let mut result__ = ::windows::core::zeroed::<PdfPageRotation>();
(::windows::core::Interface::vtable(this).Rotation)(::windows::core::Interface::as_raw(this), &mut result__).from_abi(result__)
}
}
pub fn PreferredZoom(&self) -> ::windows::core::Result<f32> {
let this = self;
unsafe {
let mut result__ = ::windows::core::zeroed::<f32>();
(::windows::core::Interface::vtable(this).PreferredZoom)(::windows::core::Interface::as_raw(this), &mut result__).from_abi(result__)
}
}
}
impl ::core::cmp::PartialEq for PdfPage {
fn eq(&self, other: &Self) -> bool {
self.0 == other.0
}
}
impl ::core::cmp::Eq for PdfPage {}
impl ::core::fmt::Debug for PdfPage {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_tuple("PdfPage").field(&self.0).finish()
}
}
impl ::windows::core::RuntimeType for PdfPage {
const SIGNATURE: ::windows::imp::ConstBuffer = ::windows::imp::ConstBuffer::from_slice(b"rc(Windows.Data.Pdf.PdfPage;{9db4b0c8-5320-4cfc-ad76-493fdad0e594})");
}
impl ::core::clone::Clone for PdfPage {
fn clone(&self) -> Self {
Self(self.0.clone())
}
}
unsafe impl ::windows::core::Interface for PdfPage {
type Vtable = IPdfPage_Vtbl;
}
unsafe impl ::windows::core::ComInterface for PdfPage {
const IID: ::windows::core::GUID = <IPdfPage as ::windows::core::ComInterface>::IID;
}
impl ::windows::core::RuntimeName for PdfPage {
const NAME: &'static str = "Windows.Data.Pdf.PdfPage";
}
::windows::imp::interface_hierarchy!(PdfPage, ::windows::core::IUnknown, ::windows::core::IInspectable);
#[cfg(feature = "Foundation")]
impl ::windows::core::CanTryInto<super::super::Foundation::IClosable> for PdfPage {}
unsafe impl ::core::marker::Send for PdfPage {}
unsafe impl ::core::marker::Sync for PdfPage {}
#[doc = "*Required features: `\"Data_Pdf\"`*"]
#[repr(transparent)]
pub struct PdfPageDimensions(::windows::core::IUnknown);
impl PdfPageDimensions {
#[doc = "*Required features: `\"Foundation\"`*"]
#[cfg(feature = "Foundation")]
pub fn MediaBox(&self) -> ::windows::core::Result<super::super::Foundation::Rect> {
let this = self;
unsafe {
let mut result__ = ::windows::core::zeroed::<super::super::Foundation::Rect>();
(::windows::core::Interface::vtable(this).MediaBox)(::windows::core::Interface::as_raw(this), &mut result__).from_abi(result__)
}
}
#[doc = "*Required features: `\"Foundation\"`*"]
#[cfg(feature = "Foundation")]
pub fn CropBox(&self) -> ::windows::core::Result<super::super::Foundation::Rect> {
let this = self;
unsafe {
let mut result__ = ::windows::core::zeroed::<super::super::Foundation::Rect>();
(::windows::core::Interface::vtable(this).CropBox)(::windows::core::Interface::as_raw(this), &mut result__).from_abi(result__)
}
}
#[doc = "*Required features: `\"Foundation\"`*"]
#[cfg(feature = "Foundation")]
pub fn BleedBox(&self) -> ::windows::core::Result<super::super::Foundation::Rect> {
let this = self;
unsafe {
let mut result__ = ::windows::core::zeroed::<super::super::Foundation::Rect>();
(::windows::core::Interface::vtable(this).BleedBox)(::windows::core::Interface::as_raw(this), &mut result__).from_abi(result__)
}
}
#[doc = "*Required features: `\"Foundation\"`*"]
#[cfg(feature = "Foundation")]
pub fn TrimBox(&self) -> ::windows::core::Result<super::super::Foundation::Rect> {
let this = self;
unsafe {
let mut result__ = ::windows::core::zeroed::<super::super::Foundation::Rect>();
(::windows::core::Interface::vtable(this).TrimBox)(::windows::core::Interface::as_raw(this), &mut result__).from_abi(result__)
}
}
#[doc = "*Required features: `\"Foundation\"`*"]
#[cfg(feature = "Foundation")]
pub fn ArtBox(&self) -> ::windows::core::Result<super::super::Foundation::Rect> {
let this = self;
unsafe {
let mut result__ = ::windows::core::zeroed::<super::super::Foundation::Rect>();
(::windows::core::Interface::vtable(this).ArtBox)(::windows::core::Interface::as_raw(this), &mut result__).from_abi(result__)
}
}
}
impl ::core::cmp::PartialEq for PdfPageDimensions {
fn eq(&self, other: &Self) -> bool {
self.0 == other.0
}
}
impl ::core::cmp::Eq for PdfPageDimensions {}
impl ::core::fmt::Debug for PdfPageDimensions {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_tuple("PdfPageDimensions").field(&self.0).finish()
}
}
impl ::windows::core::RuntimeType for PdfPageDimensions {
const SIGNATURE: ::windows::imp::ConstBuffer = ::windows::imp::ConstBuffer::from_slice(b"rc(Windows.Data.Pdf.PdfPageDimensions;{22170471-313e-44e8-835d-63a3e7624a10})");
}
impl ::core::clone::Clone for PdfPageDimensions {
fn clone(&self) -> Self {
Self(self.0.clone())
}
}
unsafe impl ::windows::core::Interface for PdfPageDimensions {
type Vtable = IPdfPageDimensions_Vtbl;
}
unsafe impl ::windows::core::ComInterface for PdfPageDimensions {
const IID: ::windows::core::GUID = <IPdfPageDimensions as ::windows::core::ComInterface>::IID;
}
impl ::windows::core::RuntimeName for PdfPageDimensions {
const NAME: &'static str = "Windows.Data.Pdf.PdfPageDimensions";
}
::windows::imp::interface_hierarchy!(PdfPageDimensions, ::windows::core::IUnknown, ::windows::core::IInspectable);
unsafe impl ::core::marker::Send for PdfPageDimensions {}
unsafe impl ::core::marker::Sync for PdfPageDimensions {}
#[doc = "*Required features: `\"Data_Pdf\"`*"]
#[repr(transparent)]
pub struct PdfPageRenderOptions(::windows::core::IUnknown);
impl PdfPageRenderOptions {
pub fn new() -> ::windows::core::Result<Self> {
Self::IActivationFactory(|f| f.ActivateInstance::<Self>())
}
fn IActivationFactory<R, F: FnOnce(&::windows::imp::IGenericFactory) -> ::windows::core::Result<R>>(callback: F) -> ::windows::core::Result<R> {
static SHARED: ::windows::imp::FactoryCache<PdfPageRenderOptions, ::windows::imp::IGenericFactory> = ::windows::imp::FactoryCache::new();
SHARED.call(callback)
}
#[doc = "*Required features: `\"Foundation\"`*"]
#[cfg(feature = "Foundation")]
pub fn SourceRect(&self) -> ::windows::core::Result<super::super::Foundation::Rect> {
let this = self;
unsafe {
let mut result__ = ::windows::core::zeroed::<super::super::Foundation::Rect>();
(::windows::core::Interface::vtable(this).SourceRect)(::windows::core::Interface::as_raw(this), &mut result__).from_abi(result__)
}
}
#[doc = "*Required features: `\"Foundation\"`*"]
#[cfg(feature = "Foundation")]
pub fn SetSourceRect(&self, value: super::super::Foundation::Rect) -> ::windows::core::Result<()> {
let this = self;
unsafe { (::windows::core::Interface::vtable(this).SetSourceRect)(::windows::core::Interface::as_raw(this), value).ok() }
}
pub fn DestinationWidth(&self) -> ::windows::core::Result<u32> {
let this = self;
unsafe {
let mut result__ = ::windows::core::zeroed::<u32>();
(::windows::core::Interface::vtable(this).DestinationWidth)(::windows::core::Interface::as_raw(this), &mut result__).from_abi(result__)
}
}
pub fn SetDestinationWidth(&self, value: u32) -> ::windows::core::Result<()> {
let this = self;
unsafe { (::windows::core::Interface::vtable(this).SetDestinationWidth)(::windows::core::Interface::as_raw(this), value).ok() }
}
pub fn DestinationHeight(&self) -> ::windows::core::Result<u32> {
let this = self;
unsafe {
let mut result__ = ::windows::core::zeroed::<u32>();
(::windows::core::Interface::vtable(this).DestinationHeight)(::windows::core::Interface::as_raw(this), &mut result__).from_abi(result__)
}
}
pub fn SetDestinationHeight(&self, value: u32) -> ::windows::core::Result<()> {
let this = self;
unsafe { (::windows::core::Interface::vtable(this).SetDestinationHeight)(::windows::core::Interface::as_raw(this), value).ok() }
}
#[doc = "*Required features: `\"UI\"`*"]
#[cfg(feature = "UI")]
pub fn BackgroundColor(&self) -> ::windows::core::Result<super::super::UI::Color> {
let this = self;
unsafe {
let mut result__ = ::windows::core::zeroed::<super::super::UI::Color>();
(::windows::core::Interface::vtable(this).BackgroundColor)(::windows::core::Interface::as_raw(this), &mut result__).from_abi(result__)
}
}
#[doc = "*Required features: `\"UI\"`*"]
#[cfg(feature = "UI")]
pub fn SetBackgroundColor(&self, value: super::super::UI::Color) -> ::windows::core::Result<()> {
let this = self;
unsafe { (::windows::core::Interface::vtable(this).SetBackgroundColor)(::windows::core::Interface::as_raw(this), value).ok() }
}
pub fn IsIgnoringHighContrast(&self) -> ::windows::core::Result<bool> {
let this = self;
unsafe {
let mut result__ = ::windows::core::zeroed::<bool>();
(::windows::core::Interface::vtable(this).IsIgnoringHighContrast)(::windows::core::Interface::as_raw(this), &mut result__).from_abi(result__)
}
}
pub fn SetIsIgnoringHighContrast(&self, value: bool) -> ::windows::core::Result<()> {
let this = self;
unsafe { (::windows::core::Interface::vtable(this).SetIsIgnoringHighContrast)(::windows::core::Interface::as_raw(this), value).ok() }
}
pub fn BitmapEncoderId(&self) -> ::windows::core::Result<::windows::core::GUID> {
let this = self;
unsafe {
let mut result__ = ::windows::core::zeroed::<::windows::core::GUID>();
(::windows::core::Interface::vtable(this).BitmapEncoderId)(::windows::core::Interface::as_raw(this), &mut result__).from_abi(result__)
}
}
pub fn SetBitmapEncoderId(&self, value: ::windows::core::GUID) -> ::windows::core::Result<()> {
let this = self;
unsafe { (::windows::core::Interface::vtable(this).SetBitmapEncoderId)(::windows::core::Interface::as_raw(this), value).ok() }
}
}
impl ::core::cmp::PartialEq for PdfPageRenderOptions {
fn eq(&self, other: &Self) -> bool {
self.0 == other.0
}
}
impl ::core::cmp::Eq for PdfPageRenderOptions {}
impl ::core::fmt::Debug for PdfPageRenderOptions {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_tuple("PdfPageRenderOptions").field(&self.0).finish()
}
}
impl ::windows::core::RuntimeType for PdfPageRenderOptions {
const SIGNATURE: ::windows::imp::ConstBuffer = ::windows::imp::ConstBuffer::from_slice(b"rc(Windows.Data.Pdf.PdfPageRenderOptions;{3c98056f-b7cf-4c29-9a04-52d90267f425})");
}
impl ::core::clone::Clone for PdfPageRenderOptions {
fn clone(&self) -> Self {
Self(self.0.clone())
}
}
unsafe impl ::windows::core::Interface for PdfPageRenderOptions {
type Vtable = IPdfPageRenderOptions_Vtbl;
}
unsafe impl ::windows::core::ComInterface for PdfPageRenderOptions {
const IID: ::windows::core::GUID = <IPdfPageRenderOptions as ::windows::core::ComInterface>::IID;
}
impl ::windows::core::RuntimeName for PdfPageRenderOptions {
const NAME: &'static str = "Windows.Data.Pdf.PdfPageRenderOptions";
}
::windows::imp::interface_hierarchy!(PdfPageRenderOptions, ::windows::core::IUnknown, ::windows::core::IInspectable);
unsafe impl ::core::marker::Send for PdfPageRenderOptions {}
unsafe impl ::core::marker::Sync for PdfPageRenderOptions {}
#[doc = "*Required features: `\"Data_Pdf\"`*"]
#[repr(transparent)]
#[derive(::core::cmp::PartialEq, ::core::cmp::Eq)]
pub struct PdfPageRotation(pub i32);
impl PdfPageRotation {
pub const Normal: Self = Self(0i32);
pub const Rotate90: Self = Self(1i32);
pub const Rotate180: Self = Self(2i32);
pub const Rotate270: Self = Self(3i32);
}
impl ::core::marker::Copy for PdfPageRotation {}
impl ::core::clone::Clone for PdfPageRotation {
fn clone(&self) -> Self {
*self
}
}
impl ::core::default::Default for PdfPageRotation {
fn default() -> Self {
Self(0)
}
}
impl ::windows::core::TypeKind for PdfPageRotation {
type TypeKind = ::windows::core::CopyType;
}
impl ::core::fmt::Debug for PdfPageRotation {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_tuple("PdfPageRotation").field(&self.0).finish()
}
}
impl ::windows::core::RuntimeType for PdfPageRotation {
const SIGNATURE: ::windows::imp::ConstBuffer = ::windows::imp::ConstBuffer::from_slice(b"enum(Windows.Data.Pdf.PdfPageRotation;i4)");
}
#[cfg(feature = "implement")]
::core::include!("impl.rs");