objc2-web-kit 0.3.1

Bindings to the WebKit framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/webkit/wkpdfconfiguration?language=objc)
    #[unsafe(super(NSObject))]
    #[thread_kind = MainThreadOnly]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct WKPDFConfiguration;
);

extern_conformance!(
    unsafe impl NSCopying for WKPDFConfiguration {}
);

unsafe impl CopyingHelper for WKPDFConfiguration {
    type Result = Self;
}

extern_conformance!(
    unsafe impl NSObjectProtocol for WKPDFConfiguration {}
);

impl WKPDFConfiguration {
    extern_methods!(
        #[cfg(feature = "objc2-core-foundation")]
        /// The rect to capture in web page coordinates
        ///
        /// If the rect is set to the null rect, the bounds of the currently displayed web page will be used.
        /// The initial value is the null rect.
        #[unsafe(method(rect))]
        #[unsafe(method_family = none)]
        pub unsafe fn rect(&self) -> CGRect;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`rect`][Self::rect].
        #[unsafe(method(setRect:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setRect(&self, rect: CGRect);

        /// A Boolean value indicating whether the PDF should allow transparent backgrounds.
        ///
        /// The default value is `NO`.
        #[unsafe(method(allowTransparentBackground))]
        #[unsafe(method_family = none)]
        pub unsafe fn allowTransparentBackground(&self) -> bool;

        /// Setter for [`allowTransparentBackground`][Self::allowTransparentBackground].
        #[unsafe(method(setAllowTransparentBackground:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setAllowTransparentBackground(&self, allow_transparent_background: bool);
    );
}

/// Methods declared on superclass `NSObject`.
impl WKPDFConfiguration {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
    );
}