objc2_web_kit/generated/
WKPDFConfiguration.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12extern_class!(
13    /// [Apple's documentation](https://developer.apple.com/documentation/webkit/wkpdfconfiguration?language=objc)
14    #[unsafe(super(NSObject))]
15    #[thread_kind = MainThreadOnly]
16    #[derive(Debug, PartialEq, Eq, Hash)]
17    pub struct WKPDFConfiguration;
18);
19
20extern_conformance!(
21    unsafe impl NSCopying for WKPDFConfiguration {}
22);
23
24unsafe impl CopyingHelper for WKPDFConfiguration {
25    type Result = Self;
26}
27
28extern_conformance!(
29    unsafe impl NSObjectProtocol for WKPDFConfiguration {}
30);
31
32impl WKPDFConfiguration {
33    extern_methods!(
34        #[cfg(feature = "objc2-core-foundation")]
35        /// The rect to capture in web page coordinates
36        ///
37        /// If the rect is set to the null rect, the bounds of the currently displayed web page will be used.
38        /// The initial value is the null rect.
39        #[unsafe(method(rect))]
40        #[unsafe(method_family = none)]
41        pub unsafe fn rect(&self) -> CGRect;
42
43        #[cfg(feature = "objc2-core-foundation")]
44        /// Setter for [`rect`][Self::rect].
45        #[unsafe(method(setRect:))]
46        #[unsafe(method_family = none)]
47        pub unsafe fn setRect(&self, rect: CGRect);
48
49        /// A Boolean value indicating whether the PDF should allow transparent backgrounds.
50        ///
51        /// The default value is `NO`.
52        #[unsafe(method(allowTransparentBackground))]
53        #[unsafe(method_family = none)]
54        pub unsafe fn allowTransparentBackground(&self) -> bool;
55
56        /// Setter for [`allowTransparentBackground`][Self::allowTransparentBackground].
57        #[unsafe(method(setAllowTransparentBackground:))]
58        #[unsafe(method_family = none)]
59        pub unsafe fn setAllowTransparentBackground(&self, allow_transparent_background: bool);
60    );
61}
62
63/// Methods declared on superclass `NSObject`.
64impl WKPDFConfiguration {
65    extern_methods!(
66        #[unsafe(method(init))]
67        #[unsafe(method_family = init)]
68        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
69
70        #[unsafe(method(new))]
71        #[unsafe(method_family = new)]
72        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
73    );
74}