//! 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::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/webkit/domhtmldocument?language=objc)
    #[unsafe(super(DOMDocument, DOMNode, DOMObject, WebScriptObject, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(all(
        feature = "DOMDocument",
        feature = "DOMNode",
        feature = "DOMObject",
        feature = "WebScriptObject"
    ))]
    #[deprecated]
    pub struct DOMHTMLDocument;
);

#[cfg(all(
    feature = "DOMDocument",
    feature = "DOMEventTarget",
    feature = "DOMNode",
    feature = "DOMObject",
    feature = "WebScriptObject"
))]
extern_conformance!(
    unsafe impl DOMEventTarget for DOMHTMLDocument {}
);

#[cfg(all(
    feature = "DOMDocument",
    feature = "DOMNode",
    feature = "DOMObject",
    feature = "WebScriptObject"
))]
extern_conformance!(
    unsafe impl NSCopying for DOMHTMLDocument {}
);

#[cfg(all(
    feature = "DOMDocument",
    feature = "DOMNode",
    feature = "DOMObject",
    feature = "WebScriptObject"
))]
unsafe impl CopyingHelper for DOMHTMLDocument {
    type Result = Self;
}

#[cfg(all(
    feature = "DOMDocument",
    feature = "DOMNode",
    feature = "DOMObject",
    feature = "WebScriptObject"
))]
extern_conformance!(
    unsafe impl NSObjectProtocol for DOMHTMLDocument {}
);

#[cfg(all(
    feature = "DOMDocument",
    feature = "DOMNode",
    feature = "DOMObject",
    feature = "WebScriptObject"
))]
impl DOMHTMLDocument {
    extern_methods!(
        #[cfg(feature = "DOMHTMLCollection")]
        #[unsafe(method(embeds))]
        #[unsafe(method_family = none)]
        pub unsafe fn embeds(&self) -> Option<Retained<DOMHTMLCollection>>;

        #[cfg(feature = "DOMHTMLCollection")]
        #[unsafe(method(plugins))]
        #[unsafe(method_family = none)]
        pub unsafe fn plugins(&self) -> Option<Retained<DOMHTMLCollection>>;

        #[cfg(feature = "DOMHTMLCollection")]
        #[unsafe(method(scripts))]
        #[unsafe(method_family = none)]
        pub unsafe fn scripts(&self) -> Option<Retained<DOMHTMLCollection>>;

        #[unsafe(method(width))]
        #[unsafe(method_family = none)]
        pub unsafe fn width(&self) -> c_int;

        #[unsafe(method(height))]
        #[unsafe(method_family = none)]
        pub unsafe fn height(&self) -> c_int;

        #[unsafe(method(dir))]
        #[unsafe(method_family = none)]
        pub unsafe fn dir(&self) -> Retained<NSString>;

        /// Setter for [`dir`][Self::dir].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setDir:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setDir(&self, dir: Option<&NSString>);

        #[unsafe(method(designMode))]
        #[unsafe(method_family = none)]
        pub unsafe fn designMode(&self) -> Retained<NSString>;

        /// Setter for [`designMode`][Self::designMode].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setDesignMode:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setDesignMode(&self, design_mode: Option<&NSString>);

        #[unsafe(method(compatMode))]
        #[unsafe(method_family = none)]
        pub unsafe fn compatMode(&self) -> Retained<NSString>;

        #[unsafe(method(bgColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn bgColor(&self) -> Retained<NSString>;

        /// Setter for [`bgColor`][Self::bgColor].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setBgColor:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setBgColor(&self, bg_color: Option<&NSString>);

        #[unsafe(method(fgColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn fgColor(&self) -> Retained<NSString>;

        /// Setter for [`fgColor`][Self::fgColor].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setFgColor:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setFgColor(&self, fg_color: Option<&NSString>);

        #[unsafe(method(alinkColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn alinkColor(&self) -> Retained<NSString>;

        /// Setter for [`alinkColor`][Self::alinkColor].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setAlinkColor:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setAlinkColor(&self, alink_color: Option<&NSString>);

        #[unsafe(method(linkColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn linkColor(&self) -> Retained<NSString>;

        /// Setter for [`linkColor`][Self::linkColor].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setLinkColor:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setLinkColor(&self, link_color: Option<&NSString>);

        #[unsafe(method(vlinkColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn vlinkColor(&self) -> Retained<NSString>;

        /// Setter for [`vlinkColor`][Self::vlinkColor].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setVlinkColor:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setVlinkColor(&self, vlink_color: Option<&NSString>);

        #[deprecated]
        #[unsafe(method(open))]
        #[unsafe(method_family = none)]
        pub unsafe fn open(&self);

        #[deprecated]
        #[unsafe(method(close))]
        #[unsafe(method_family = none)]
        pub unsafe fn close(&self);

        /// # Safety
        ///
        /// `text` might not allow `None`.
        #[deprecated]
        #[unsafe(method(write:))]
        #[unsafe(method_family = none)]
        pub unsafe fn write(&self, text: Option<&NSString>);

        /// # Safety
        ///
        /// `text` might not allow `None`.
        #[deprecated]
        #[unsafe(method(writeln:))]
        #[unsafe(method_family = none)]
        pub unsafe fn writeln(&self, text: Option<&NSString>);

        #[unsafe(method(clear))]
        #[unsafe(method_family = none)]
        pub unsafe fn clear(&self);

        #[unsafe(method(captureEvents))]
        #[unsafe(method_family = none)]
        pub unsafe fn captureEvents(&self);

        #[unsafe(method(releaseEvents))]
        #[unsafe(method_family = none)]
        pub unsafe fn releaseEvents(&self);
    );
}

/// Methods declared on superclass `DOMObject`.
#[cfg(all(
    feature = "DOMDocument",
    feature = "DOMNode",
    feature = "DOMObject",
    feature = "WebScriptObject"
))]
impl DOMHTMLDocument {
    extern_methods!(
        #[deprecated]
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
    );
}

/// Methods declared on superclass `NSObject`.
#[cfg(all(
    feature = "DOMDocument",
    feature = "DOMNode",
    feature = "DOMObject",
    feature = "WebScriptObject"
))]
impl DOMHTMLDocument {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}
