objc2-web-kit 0.3.2

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

use crate::*;

/// [Apple's documentation](https://developer.apple.com/documentation/webkit/dom_start_to_start?language=objc)
#[deprecated]
pub const DOM_START_TO_START: c_uint = 0;
/// [Apple's documentation](https://developer.apple.com/documentation/webkit/dom_start_to_end?language=objc)
#[deprecated]
pub const DOM_START_TO_END: c_uint = 1;
/// [Apple's documentation](https://developer.apple.com/documentation/webkit/dom_end_to_end?language=objc)
#[deprecated]
pub const DOM_END_TO_END: c_uint = 2;
/// [Apple's documentation](https://developer.apple.com/documentation/webkit/dom_end_to_start?language=objc)
#[deprecated]
pub const DOM_END_TO_START: c_uint = 3;
/// [Apple's documentation](https://developer.apple.com/documentation/webkit/dom_node_before?language=objc)
#[deprecated]
pub const DOM_NODE_BEFORE: c_uint = 0;
/// [Apple's documentation](https://developer.apple.com/documentation/webkit/dom_node_after?language=objc)
#[deprecated]
pub const DOM_NODE_AFTER: c_uint = 1;
/// [Apple's documentation](https://developer.apple.com/documentation/webkit/dom_node_before_and_after?language=objc)
#[deprecated]
pub const DOM_NODE_BEFORE_AND_AFTER: c_uint = 2;
/// [Apple's documentation](https://developer.apple.com/documentation/webkit/dom_node_inside?language=objc)
#[deprecated]
pub const DOM_NODE_INSIDE: c_uint = 3;

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

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

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

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

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

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

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

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

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

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

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

        #[cfg(feature = "DOMNode")]
        /// # Safety
        ///
        /// `ref_node` might not allow `None`.
        #[unsafe(method(setStart:offset:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setStart_offset(&self, ref_node: Option<&DOMNode>, offset: c_int);

        #[cfg(feature = "DOMNode")]
        /// # Safety
        ///
        /// `ref_node` might not allow `None`.
        #[unsafe(method(setEnd:offset:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setEnd_offset(&self, ref_node: Option<&DOMNode>, offset: c_int);

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

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

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

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

        #[deprecated]
        #[unsafe(method(collapse:))]
        #[unsafe(method_family = none)]
        pub unsafe fn collapse(&self, to_start: bool);

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

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

        /// # Safety
        ///
        /// `source_range` might not allow `None`.
        #[unsafe(method(compareBoundaryPoints:sourceRange:))]
        #[unsafe(method_family = none)]
        pub unsafe fn compareBoundaryPoints_sourceRange(
            &self,
            how: c_ushort,
            source_range: Option<&DOMRange>,
        ) -> c_short;

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

        #[cfg(all(feature = "DOMDocumentFragment", feature = "DOMNode"))]
        #[deprecated]
        #[unsafe(method(extractContents))]
        #[unsafe(method_family = none)]
        pub unsafe fn extractContents(&self) -> Option<Retained<DOMDocumentFragment>>;

        #[cfg(all(feature = "DOMDocumentFragment", feature = "DOMNode"))]
        #[deprecated]
        #[unsafe(method(cloneContents))]
        #[unsafe(method_family = none)]
        pub unsafe fn cloneContents(&self) -> Option<Retained<DOMDocumentFragment>>;

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

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

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

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

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

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

        #[cfg(feature = "DOMNode")]
        /// # Safety
        ///
        /// `ref_node` might not allow `None`.
        #[unsafe(method(compareNode:))]
        #[unsafe(method_family = none)]
        pub unsafe fn compareNode(&self, ref_node: Option<&DOMNode>) -> c_short;

        #[cfg(feature = "DOMNode")]
        /// # Safety
        ///
        /// `ref_node` might not allow `None`.
        #[unsafe(method(intersectsNode:))]
        #[unsafe(method_family = none)]
        pub unsafe fn intersectsNode(&self, ref_node: Option<&DOMNode>) -> bool;

        #[cfg(feature = "DOMNode")]
        /// # Safety
        ///
        /// `ref_node` might not allow `None`.
        #[unsafe(method(comparePoint:offset:))]
        #[unsafe(method_family = none)]
        pub unsafe fn comparePoint_offset(
            &self,
            ref_node: Option<&DOMNode>,
            offset: c_int,
        ) -> c_short;

        #[cfg(feature = "DOMNode")]
        /// # Safety
        ///
        /// `ref_node` might not allow `None`.
        #[unsafe(method(isPointInRange:offset:))]
        #[unsafe(method_family = none)]
        pub unsafe fn isPointInRange_offset(
            &self,
            ref_node: Option<&DOMNode>,
            offset: c_int,
        ) -> bool;
    );
}

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

/// DOMRangeDeprecated.
#[deprecated]
#[cfg(all(feature = "DOMObject", feature = "WebScriptObject"))]
impl DOMRange {
    extern_methods!(
        #[cfg(feature = "DOMNode")]
        /// # Safety
        ///
        /// `ref_node` might not allow `None`.
        #[deprecated]
        #[unsafe(method(setStart::))]
        #[unsafe(method_family = none)]
        pub unsafe fn setStart(&self, ref_node: Option<&DOMNode>, offset: c_int);

        #[cfg(feature = "DOMNode")]
        /// # Safety
        ///
        /// `ref_node` might not allow `None`.
        #[deprecated]
        #[unsafe(method(setEnd::))]
        #[unsafe(method_family = none)]
        pub unsafe fn setEnd(&self, ref_node: Option<&DOMNode>, offset: c_int);

        /// # Safety
        ///
        /// `source_range` might not allow `None`.
        #[deprecated]
        #[unsafe(method(compareBoundaryPoints::))]
        #[unsafe(method_family = none)]
        pub unsafe fn compareBoundaryPoints(
            &self,
            how: c_ushort,
            source_range: Option<&DOMRange>,
        ) -> c_short;
    );
}