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

/// [Apple's documentation](https://developer.apple.com/documentation/webkit/dom_allow_keyboard_input?language=objc)
#[deprecated]
pub const DOM_ALLOW_KEYBOARD_INPUT: c_uint = 1;

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

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

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

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

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

#[cfg(all(
    feature = "DOMNode",
    feature = "DOMObject",
    feature = "WebScriptObject"
))]
impl DOMElement {
    extern_methods!(
        #[deprecated]
        #[unsafe(method(tagName))]
        #[unsafe(method_family = none)]
        pub unsafe fn tagName(&self) -> Retained<NSString>;

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

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

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

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

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

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

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

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

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

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

        /// Setter for [`scrollLeft`][Self::scrollLeft].
        #[deprecated]
        #[unsafe(method(setScrollLeft:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setScrollLeft(&self, scroll_left: c_int);

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

        /// Setter for [`scrollTop`][Self::scrollTop].
        #[deprecated]
        #[unsafe(method(setScrollTop:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setScrollTop(&self, scroll_top: c_int);

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

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

        #[deprecated]
        #[unsafe(method(offsetParent))]
        #[unsafe(method_family = none)]
        pub unsafe fn offsetParent(&self) -> Option<Retained<DOMElement>>;

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

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

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

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

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

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

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

        #[unsafe(method(previousElementSibling))]
        #[unsafe(method_family = none)]
        pub unsafe fn previousElementSibling(&self) -> Option<Retained<DOMElement>>;

        #[unsafe(method(nextElementSibling))]
        #[unsafe(method_family = none)]
        pub unsafe fn nextElementSibling(&self) -> Option<Retained<DOMElement>>;

        #[unsafe(method(firstElementChild))]
        #[unsafe(method_family = none)]
        pub unsafe fn firstElementChild(&self) -> Option<Retained<DOMElement>>;

        #[unsafe(method(lastElementChild))]
        #[unsafe(method_family = none)]
        pub unsafe fn lastElementChild(&self) -> Option<Retained<DOMElement>>;

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

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

        /// # Safety
        ///
        /// - `name` might not allow `None`.
        /// - `value` might not allow `None`.
        #[unsafe(method(setAttribute:value:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setAttribute_value(&self, name: Option<&NSString>, value: Option<&NSString>);

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

        #[cfg(feature = "DOMAttr")]
        /// # Safety
        ///
        /// `name` might not allow `None`.
        #[deprecated]
        #[unsafe(method(getAttributeNode:))]
        #[unsafe(method_family = none)]
        pub unsafe fn getAttributeNode(&self, name: Option<&NSString>)
            -> Option<Retained<DOMAttr>>;

        #[cfg(feature = "DOMAttr")]
        /// # Safety
        ///
        /// `new_attr` might not allow `None`.
        #[deprecated]
        #[unsafe(method(setAttributeNode:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setAttributeNode(
            &self,
            new_attr: Option<&DOMAttr>,
        ) -> Option<Retained<DOMAttr>>;

        #[cfg(feature = "DOMAttr")]
        /// # Safety
        ///
        /// `old_attr` might not allow `None`.
        #[deprecated]
        #[unsafe(method(removeAttributeNode:))]
        #[unsafe(method_family = none)]
        pub unsafe fn removeAttributeNode(
            &self,
            old_attr: Option<&DOMAttr>,
        ) -> Option<Retained<DOMAttr>>;

        #[cfg(feature = "DOMNodeList")]
        /// # Safety
        ///
        /// `name` might not allow `None`.
        #[deprecated]
        #[unsafe(method(getElementsByTagName:))]
        #[unsafe(method_family = none)]
        pub unsafe fn getElementsByTagName(
            &self,
            name: Option<&NSString>,
        ) -> Option<Retained<DOMNodeList>>;

        /// # Safety
        ///
        /// - `namespace_uri` might not allow `None`.
        /// - `local_name` might not allow `None`.
        #[unsafe(method(getAttributeNS:localName:))]
        #[unsafe(method_family = none)]
        pub unsafe fn getAttributeNS_localName(
            &self,
            namespace_uri: Option<&NSString>,
            local_name: Option<&NSString>,
        ) -> Option<Retained<NSString>>;

        /// # Safety
        ///
        /// - `namespace_uri` might not allow `None`.
        /// - `qualified_name` might not allow `None`.
        /// - `value` might not allow `None`.
        #[unsafe(method(setAttributeNS:qualifiedName:value:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setAttributeNS_qualifiedName_value(
            &self,
            namespace_uri: Option<&NSString>,
            qualified_name: Option<&NSString>,
            value: Option<&NSString>,
        );

        /// # Safety
        ///
        /// - `namespace_uri` might not allow `None`.
        /// - `local_name` might not allow `None`.
        #[unsafe(method(removeAttributeNS:localName:))]
        #[unsafe(method_family = none)]
        pub unsafe fn removeAttributeNS_localName(
            &self,
            namespace_uri: Option<&NSString>,
            local_name: Option<&NSString>,
        );

        #[cfg(feature = "DOMNodeList")]
        /// # Safety
        ///
        /// - `namespace_uri` might not allow `None`.
        /// - `local_name` might not allow `None`.
        #[unsafe(method(getElementsByTagNameNS:localName:))]
        #[unsafe(method_family = none)]
        pub unsafe fn getElementsByTagNameNS_localName(
            &self,
            namespace_uri: Option<&NSString>,
            local_name: Option<&NSString>,
        ) -> Option<Retained<DOMNodeList>>;

        #[cfg(feature = "DOMAttr")]
        /// # Safety
        ///
        /// - `namespace_uri` might not allow `None`.
        /// - `local_name` might not allow `None`.
        #[unsafe(method(getAttributeNodeNS:localName:))]
        #[unsafe(method_family = none)]
        pub unsafe fn getAttributeNodeNS_localName(
            &self,
            namespace_uri: Option<&NSString>,
            local_name: Option<&NSString>,
        ) -> Option<Retained<DOMAttr>>;

        #[cfg(feature = "DOMAttr")]
        /// # Safety
        ///
        /// `new_attr` might not allow `None`.
        #[deprecated]
        #[unsafe(method(setAttributeNodeNS:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setAttributeNodeNS(
            &self,
            new_attr: Option<&DOMAttr>,
        ) -> Option<Retained<DOMAttr>>;

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

        /// # Safety
        ///
        /// - `namespace_uri` might not allow `None`.
        /// - `local_name` might not allow `None`.
        #[unsafe(method(hasAttributeNS:localName:))]
        #[unsafe(method_family = none)]
        pub unsafe fn hasAttributeNS_localName(
            &self,
            namespace_uri: Option<&NSString>,
            local_name: Option<&NSString>,
        ) -> bool;

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

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

        #[unsafe(method(scrollIntoView:))]
        #[unsafe(method_family = none)]
        pub unsafe fn scrollIntoView(&self, align_with_top: bool);

        #[unsafe(method(scrollIntoViewIfNeeded:))]
        #[unsafe(method_family = none)]
        pub unsafe fn scrollIntoViewIfNeeded(&self, center_if_needed: bool);

        #[cfg(feature = "DOMNodeList")]
        /// # Safety
        ///
        /// `name` might not allow `None`.
        #[unsafe(method(getElementsByClassName:))]
        #[unsafe(method_family = none)]
        pub unsafe fn getElementsByClassName(
            &self,
            name: Option<&NSString>,
        ) -> Option<Retained<DOMNodeList>>;

        #[unsafe(method(webkitRequestFullScreen:))]
        #[unsafe(method_family = none)]
        pub unsafe fn webkitRequestFullScreen(&self, flags: c_ushort);

        /// # Safety
        ///
        /// `selectors` might not allow `None`.
        #[unsafe(method(querySelector:))]
        #[unsafe(method_family = none)]
        pub unsafe fn querySelector(
            &self,
            selectors: Option<&NSString>,
        ) -> Option<Retained<DOMElement>>;

        #[cfg(feature = "DOMNodeList")]
        /// # Safety
        ///
        /// `selectors` might not allow `None`.
        #[unsafe(method(querySelectorAll:))]
        #[unsafe(method_family = none)]
        pub unsafe fn querySelectorAll(
            &self,
            selectors: Option<&NSString>,
        ) -> Option<Retained<DOMNodeList>>;
    );
}

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

/// DOMElementDeprecated.
#[deprecated]
#[cfg(all(
    feature = "DOMNode",
    feature = "DOMObject",
    feature = "WebScriptObject"
))]
impl DOMElement {
    extern_methods!(
        /// # Safety
        ///
        /// - `name` might not allow `None`.
        /// - `value` might not allow `None`.
        #[deprecated]
        #[unsafe(method(setAttribute::))]
        #[unsafe(method_family = none)]
        pub unsafe fn setAttribute(&self, name: Option<&NSString>, value: Option<&NSString>);

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

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

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

        #[cfg(feature = "DOMNodeList")]
        /// # Safety
        ///
        /// - `namespace_uri` might not allow `None`.
        /// - `local_name` might not allow `None`.
        #[deprecated]
        #[unsafe(method(getElementsByTagNameNS::))]
        #[unsafe(method_family = none)]
        pub unsafe fn getElementsByTagNameNS(
            &self,
            namespace_uri: Option<&NSString>,
            local_name: Option<&NSString>,
        ) -> Option<Retained<DOMNodeList>>;

        #[cfg(feature = "DOMAttr")]
        /// # Safety
        ///
        /// - `namespace_uri` might not allow `None`.
        /// - `local_name` might not allow `None`.
        #[deprecated]
        #[unsafe(method(getAttributeNodeNS::))]
        #[unsafe(method_family = none)]
        pub unsafe fn getAttributeNodeNS(
            &self,
            namespace_uri: Option<&NSString>,
            local_name: Option<&NSString>,
        ) -> Option<Retained<DOMAttr>>;

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

        #[deprecated]
        #[unsafe(method(scrollByLines:))]
        #[unsafe(method_family = none)]
        pub unsafe fn scrollByLines(&self, lines: c_int);

        #[deprecated]
        #[unsafe(method(scrollByPages:))]
        #[unsafe(method_family = none)]
        pub unsafe fn scrollByPages(&self, pages: c_int);
    );
}
