objc2-web-kit 0.3.0

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-app-kit")]
#[cfg(target_os = "macos")]
use objc2_app_kit::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/webkit/webframeview?language=objc)
    #[unsafe(super(NSView, NSResponder, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "objc2-app-kit")]
    #[cfg(target_os = "macos")]
    #[deprecated]
    pub struct WebFrameView;
);

#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
unsafe impl NSAccessibility for WebFrameView {}

#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
unsafe impl NSAccessibilityElementProtocol for WebFrameView {}

#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
unsafe impl NSAnimatablePropertyContainer for WebFrameView {}

#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
unsafe impl NSAppearanceCustomization for WebFrameView {}

#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
unsafe impl NSCoding for WebFrameView {}

#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
unsafe impl NSDraggingDestination for WebFrameView {}

#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
unsafe impl NSObjectProtocol for WebFrameView {}

#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
unsafe impl NSUserInterfaceItemIdentification for WebFrameView {}

#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
impl WebFrameView {
    extern_methods!(
        #[cfg(feature = "WebFrame")]
        /// The WebFrame associated with this WebFrameView
        #[deprecated]
        #[unsafe(method(webFrame))]
        #[unsafe(method_family = none)]
        pub unsafe fn webFrame(&self) -> Option<Retained<WebFrame>>;

        #[cfg(feature = "WebDocument")]
        /// The WebFrameView's document subview
        ///
        /// The subview that renders the WebFrameView's contents
        #[deprecated]
        #[unsafe(method(documentView))]
        #[unsafe(method_family = none)]
        pub unsafe fn documentView(&self) -> Option<Retained<NSView>>;

        /// Whether the WebFrameView allows its document to be scrolled
        #[deprecated]
        #[unsafe(method(allowsScrolling))]
        #[unsafe(method_family = none)]
        pub unsafe fn allowsScrolling(&self) -> bool;

        /// Setter for [`allowsScrolling`][Self::allowsScrolling].
        #[deprecated]
        #[unsafe(method(setAllowsScrolling:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setAllowsScrolling(&self, allows_scrolling: bool);

        /// Whether this frame can print headers and footers
        #[deprecated]
        #[unsafe(method(canPrintHeadersAndFooters))]
        #[unsafe(method_family = none)]
        pub unsafe fn canPrintHeadersAndFooters(&self) -> bool;

        /// Creates a print operation set up to print this frame
        ///
        /// Returns: A newly created print operation object
        #[deprecated]
        #[unsafe(method(printOperationWithPrintInfo:))]
        #[unsafe(method_family = none)]
        pub unsafe fn printOperationWithPrintInfo(
            &self,
            print_info: Option<&NSPrintInfo>,
        ) -> Option<Retained<NSPrintOperation>>;

        /// Called by the host application before it initializes and runs a print operation.
        ///
        /// If NO is returned, the host application will abort its print operation and call -printDocumentView on the
        /// WebFrameView.  The document view is then expected to run its own print operation.  If YES is returned, the host
        /// application's print operation will continue as normal.
        #[deprecated]
        #[unsafe(method(documentViewShouldHandlePrint))]
        #[unsafe(method_family = none)]
        pub unsafe fn documentViewShouldHandlePrint(&self) -> bool;

        /// Called by the host application when the WebFrameView returns YES from -documentViewShouldHandlePrint.
        #[deprecated]
        #[unsafe(method(printDocumentView))]
        #[unsafe(method_family = none)]
        pub unsafe fn printDocumentView(&self);
    );
}

/// Methods declared on superclass `NSView`.
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
impl WebFrameView {
    extern_methods!(
        #[unsafe(method(initWithFrame:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;

        #[unsafe(method(initWithCoder:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithCoder(
            this: Allocated<Self>,
            coder: &NSCoder,
        ) -> Option<Retained<Self>>;
    );
}

/// Methods declared on superclass `NSResponder`.
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
impl WebFrameView {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
    );
}

/// Methods declared on superclass `NSObject`.
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
impl WebFrameView {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
    );
}