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

use crate::*;

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

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

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

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

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

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

        /// Setter for [`data`][Self::data].
        #[deprecated]
        #[unsafe(method(setData:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setData(&self, data: Option<&NSString>);

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

        #[unsafe(method(substringData:length:))]
        #[unsafe(method_family = none)]
        pub unsafe fn substringData_length(
            &self,
            offset: c_uint,
            length: c_uint,
        ) -> Option<Retained<NSString>>;

        #[deprecated]
        #[unsafe(method(appendData:))]
        #[unsafe(method_family = none)]
        pub unsafe fn appendData(&self, data: Option<&NSString>);

        #[unsafe(method(insertData:data:))]
        #[unsafe(method_family = none)]
        pub unsafe fn insertData_data(&self, offset: c_uint, data: Option<&NSString>);

        #[unsafe(method(deleteData:length:))]
        #[unsafe(method_family = none)]
        pub unsafe fn deleteData_length(&self, offset: c_uint, length: c_uint);

        #[unsafe(method(replaceData:length:data:))]
        #[unsafe(method_family = none)]
        pub unsafe fn replaceData_length_data(
            &self,
            offset: c_uint,
            length: c_uint,
            data: Option<&NSString>,
        );
    );
}

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

/// DOMCharacterDataDeprecated.
#[cfg(all(
    feature = "DOMNode",
    feature = "DOMObject",
    feature = "WebScriptObject"
))]
impl DOMCharacterData {
    extern_methods!(
        #[deprecated]
        #[unsafe(method(substringData::))]
        #[unsafe(method_family = none)]
        pub unsafe fn substringData(
            &self,
            offset: c_uint,
            length: c_uint,
        ) -> Option<Retained<NSString>>;

        #[deprecated]
        #[unsafe(method(insertData::))]
        #[unsafe(method_family = none)]
        pub unsafe fn insertData(&self, offset: c_uint, data: Option<&NSString>);

        #[deprecated]
        #[unsafe(method(deleteData::))]
        #[unsafe(method_family = none)]
        pub unsafe fn deleteData(&self, offset: c_uint, length: c_uint);

        #[deprecated]
        #[unsafe(method(replaceData:::))]
        #[unsafe(method_family = none)]
        pub unsafe fn replaceData(&self, offset: c_uint, length: c_uint, data: Option<&NSString>);
    );
}