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_key_location_standard?language=objc)
#[deprecated]
pub const DOM_KEY_LOCATION_STANDARD: c_uint = 0x00;
/// [Apple's documentation](https://developer.apple.com/documentation/webkit/dom_key_location_left?language=objc)
#[deprecated]
pub const DOM_KEY_LOCATION_LEFT: c_uint = 0x01;
/// [Apple's documentation](https://developer.apple.com/documentation/webkit/dom_key_location_right?language=objc)
#[deprecated]
pub const DOM_KEY_LOCATION_RIGHT: c_uint = 0x02;
/// [Apple's documentation](https://developer.apple.com/documentation/webkit/dom_key_location_numpad?language=objc)
#[deprecated]
pub const DOM_KEY_LOCATION_NUMPAD: c_uint = 0x03;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        #[cfg(feature = "DOMAbstractView")]
        /// # Safety
        ///
        /// - `type` might not allow `None`.
        /// - `view` might not allow `None`.
        /// - `key_identifier` might not allow `None`.
        #[unsafe(method(initKeyboardEvent:canBubble:cancelable:view:keyIdentifier:location:ctrlKey:altKey:shiftKey:metaKey:altGraphKey:))]
        #[unsafe(method_family = none)]
        pub unsafe fn initKeyboardEvent_canBubble_cancelable_view_keyIdentifier_location_ctrlKey_altKey_shiftKey_metaKey_altGraphKey(
            &self,
            r#type: Option<&NSString>,
            can_bubble: bool,
            cancelable: bool,
            view: Option<&DOMAbstractView>,
            key_identifier: Option<&NSString>,
            location: c_uint,
            ctrl_key: bool,
            alt_key: bool,
            shift_key: bool,
            meta_key: bool,
            alt_graph_key: bool,
        );

        #[cfg(feature = "DOMAbstractView")]
        /// # Safety
        ///
        /// - `type` might not allow `None`.
        /// - `view` might not allow `None`.
        /// - `key_identifier` might not allow `None`.
        #[unsafe(method(initKeyboardEvent:canBubble:cancelable:view:keyIdentifier:location:ctrlKey:altKey:shiftKey:metaKey:))]
        #[unsafe(method_family = none)]
        pub unsafe fn initKeyboardEvent_canBubble_cancelable_view_keyIdentifier_location_ctrlKey_altKey_shiftKey_metaKey(
            &self,
            r#type: Option<&NSString>,
            can_bubble: bool,
            cancelable: bool,
            view: Option<&DOMAbstractView>,
            key_identifier: Option<&NSString>,
            location: c_uint,
            ctrl_key: bool,
            alt_key: bool,
            shift_key: bool,
            meta_key: bool,
        );

        #[cfg(feature = "DOMAbstractView")]
        /// # Safety
        ///
        /// - `type` might not allow `None`.
        /// - `view` might not allow `None`.
        /// - `key_identifier` might not allow `None`.
        #[deprecated]
        #[unsafe(method(initKeyboardEvent:canBubble:cancelable:view:keyIdentifier:keyLocation:ctrlKey:altKey:shiftKey:metaKey:altGraphKey:))]
        #[unsafe(method_family = none)]
        pub unsafe fn initKeyboardEvent_canBubble_cancelable_view_keyIdentifier_keyLocation_ctrlKey_altKey_shiftKey_metaKey_altGraphKey(
            &self,
            r#type: Option<&NSString>,
            can_bubble: bool,
            cancelable: bool,
            view: Option<&DOMAbstractView>,
            key_identifier: Option<&NSString>,
            key_location: c_uint,
            ctrl_key: bool,
            alt_key: bool,
            shift_key: bool,
            meta_key: bool,
            alt_graph_key: bool,
        );

        #[cfg(feature = "DOMAbstractView")]
        /// # Safety
        ///
        /// - `type` might not allow `None`.
        /// - `view` might not allow `None`.
        /// - `key_identifier` might not allow `None`.
        #[deprecated]
        #[unsafe(method(initKeyboardEvent:canBubble:cancelable:view:keyIdentifier:keyLocation:ctrlKey:altKey:shiftKey:metaKey:))]
        #[unsafe(method_family = none)]
        pub unsafe fn initKeyboardEvent_canBubble_cancelable_view_keyIdentifier_keyLocation_ctrlKey_altKey_shiftKey_metaKey(
            &self,
            r#type: Option<&NSString>,
            can_bubble: bool,
            cancelable: bool,
            view: Option<&DOMAbstractView>,
            key_identifier: Option<&NSString>,
            key_location: c_uint,
            ctrl_key: bool,
            alt_key: bool,
            shift_key: bool,
            meta_key: bool,
        );
    );
}

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