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_none?language=objc)
#[deprecated]
pub const DOM_NONE: c_uint = 0;
/// [Apple's documentation](https://developer.apple.com/documentation/webkit/dom_capturing_phase?language=objc)
#[deprecated]
pub const DOM_CAPTURING_PHASE: c_uint = 1;
/// [Apple's documentation](https://developer.apple.com/documentation/webkit/dom_at_target?language=objc)
#[deprecated]
pub const DOM_AT_TARGET: c_uint = 2;
/// [Apple's documentation](https://developer.apple.com/documentation/webkit/dom_bubbling_phase?language=objc)
#[deprecated]
pub const DOM_BUBBLING_PHASE: c_uint = 3;

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

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

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

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

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

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

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

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

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

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

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

        #[cfg(feature = "DOMEventTarget")]
        #[unsafe(method(srcElement))]
        #[unsafe(method_family = none)]
        pub unsafe fn srcElement(&self) -> Option<Retained<ProtocolObject<dyn DOMEventTarget>>>;

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

        /// Setter for [`returnValue`][Self::returnValue].
        #[unsafe(method(setReturnValue:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setReturnValue(&self, return_value: bool);

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

        /// Setter for [`cancelBubble`][Self::cancelBubble].
        #[unsafe(method(setCancelBubble:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setCancelBubble(&self, cancel_bubble: bool);

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

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

        /// # Safety
        ///
        /// `event_type_arg` might not allow `None`.
        #[unsafe(method(initEvent:canBubbleArg:cancelableArg:))]
        #[unsafe(method_family = none)]
        pub unsafe fn initEvent_canBubbleArg_cancelableArg(
            &self,
            event_type_arg: Option<&NSString>,
            can_bubble_arg: bool,
            cancelable_arg: bool,
        );
    );
}

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

/// DOMEventDeprecated.
#[deprecated]
#[cfg(all(feature = "DOMObject", feature = "WebScriptObject"))]
impl DOMEvent {
    extern_methods!(
        /// # Safety
        ///
        /// `event_type_arg` might not allow `None`.
        #[deprecated]
        #[unsafe(method(initEvent:::))]
        #[unsafe(method_family = none)]
        pub unsafe fn initEvent(
            &self,
            event_type_arg: Option<&NSString>,
            can_bubble_arg: bool,
            cancelable_arg: bool,
        );
    );
}