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_modification?language=objc)
#[deprecated]
pub const DOM_MODIFICATION: c_uint = 1;
/// [Apple's documentation](https://developer.apple.com/documentation/webkit/dom_addition?language=objc)
#[deprecated]
pub const DOM_ADDITION: c_uint = 2;
/// [Apple's documentation](https://developer.apple.com/documentation/webkit/dom_removal?language=objc)
#[deprecated]
pub const DOM_REMOVAL: c_uint = 3;

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

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

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

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

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

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

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

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

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

        #[cfg(feature = "DOMNode")]
        /// # Safety
        ///
        /// - `type` might not allow `None`.
        /// - `related_node` might not allow `None`.
        /// - `prev_value` might not allow `None`.
        /// - `new_value` might not allow `None`.
        /// - `attr_name` might not allow `None`.
        #[unsafe(method(initMutationEvent:canBubble:cancelable:relatedNode:prevValue:newValue:attrName:attrChange:))]
        #[unsafe(method_family = none)]
        pub unsafe fn initMutationEvent_canBubble_cancelable_relatedNode_prevValue_newValue_attrName_attrChange(
            &self,
            r#type: Option<&NSString>,
            can_bubble: bool,
            cancelable: bool,
            related_node: Option<&DOMNode>,
            prev_value: Option<&NSString>,
            new_value: Option<&NSString>,
            attr_name: Option<&NSString>,
            attr_change: c_ushort,
        );
    );
}

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

/// DOMMutationEventDeprecated.
#[deprecated]
#[cfg(all(
    feature = "DOMEvent",
    feature = "DOMObject",
    feature = "WebScriptObject"
))]
impl DOMMutationEvent {
    extern_methods!(
        #[cfg(feature = "DOMNode")]
        /// # Safety
        ///
        /// - `type` might not allow `None`.
        /// - `related_node` might not allow `None`.
        /// - `prev_value` might not allow `None`.
        /// - `new_value` might not allow `None`.
        /// - `attr_name` might not allow `None`.
        #[deprecated]
        #[unsafe(method(initMutationEvent::::::::))]
        #[unsafe(method_family = none)]
        pub unsafe fn initMutationEvent(
            &self,
            r#type: Option<&NSString>,
            can_bubble: bool,
            cancelable: bool,
            related_node: Option<&DOMNode>,
            prev_value: Option<&NSString>,
            new_value: Option<&NSString>,
            attr_name: Option<&NSString>,
            attr_change: c_ushort,
        );
    );
}