objc2-web-kit 0.2.2

Bindings to the WebKit framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern_category!(
    /// Category "WebScripting" on [`NSObject`].
    #[doc(alias = "WebScripting")]
    pub unsafe trait NSObjectWebScripting {
        #[method_id(@__retain_semantics Other webScriptNameForSelector:)]
        unsafe fn webScriptNameForSelector(selector: Option<Sel>) -> Option<Retained<NSString>>;

        #[method(isSelectorExcludedFromWebScript:)]
        unsafe fn isSelectorExcludedFromWebScript(selector: Option<Sel>) -> bool;

        #[method_id(@__retain_semantics Other webScriptNameForKey:)]
        unsafe fn webScriptNameForKey(name: *mut c_char) -> Option<Retained<NSString>>;

        #[method(isKeyExcludedFromWebScript:)]
        unsafe fn isKeyExcludedFromWebScript(name: *mut c_char) -> bool;

        #[method_id(@__retain_semantics Other invokeUndefinedMethodFromWebScript:withArguments:)]
        unsafe fn invokeUndefinedMethodFromWebScript_withArguments(
            &self,
            name: Option<&NSString>,
            arguments: Option<&NSArray>,
        ) -> Option<Retained<AnyObject>>;

        #[method_id(@__retain_semantics Other invokeDefaultMethodWithArguments:)]
        unsafe fn invokeDefaultMethodWithArguments(
            &self,
            arguments: Option<&NSArray>,
        ) -> Option<Retained<AnyObject>>;

        #[method(finalizeForWebScript)]
        unsafe fn finalizeForWebScript(&self);
    }

    unsafe impl NSObjectWebScripting for NSObject {}
);

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[deprecated]
    pub struct WebScriptObject;

    unsafe impl ClassType for WebScriptObject {
        type Super = NSObject;
        type Mutability = InteriorMutable;
    }
);

unsafe impl NSObjectProtocol for WebScriptObject {}

extern_methods!(
    unsafe impl WebScriptObject {
        #[deprecated]
        #[method(throwException:)]
        pub unsafe fn throwException(exception_message: Option<&NSString>) -> bool;

        #[deprecated]
        #[method_id(@__retain_semantics Other callWebScriptMethod:withArguments:)]
        pub unsafe fn callWebScriptMethod_withArguments(
            &self,
            name: Option<&NSString>,
            arguments: Option<&NSArray>,
        ) -> Option<Retained<AnyObject>>;

        #[deprecated]
        #[method_id(@__retain_semantics Other evaluateWebScript:)]
        pub unsafe fn evaluateWebScript(
            &self,
            script: Option<&NSString>,
        ) -> Option<Retained<AnyObject>>;

        #[deprecated]
        #[method(removeWebScriptKey:)]
        pub unsafe fn removeWebScriptKey(&self, name: Option<&NSString>);

        #[deprecated]
        #[method_id(@__retain_semantics Other stringRepresentation)]
        pub unsafe fn stringRepresentation(&self) -> Option<Retained<NSString>>;

        #[deprecated]
        #[method_id(@__retain_semantics Other webScriptValueAtIndex:)]
        pub unsafe fn webScriptValueAtIndex(&self, index: c_uint) -> Option<Retained<AnyObject>>;

        #[deprecated]
        #[method(setWebScriptValueAtIndex:value:)]
        pub unsafe fn setWebScriptValueAtIndex_value(
            &self,
            index: c_uint,
            value: Option<&AnyObject>,
        );

        #[deprecated]
        #[method(setException:)]
        pub unsafe fn setException(&self, description: Option<&NSString>);
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    unsafe impl WebScriptObject {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Retained<Self>;
    }
);

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[deprecated]
    pub struct WebUndefined;

    unsafe impl ClassType for WebUndefined {
        type Super = NSObject;
        type Mutability = InteriorMutable;
    }
);

unsafe impl NSCoding for WebUndefined {}

unsafe impl NSCopying for WebUndefined {}

unsafe impl NSObjectProtocol for WebUndefined {}

extern_methods!(
    unsafe impl WebUndefined {
        #[deprecated]
        #[method_id(@__retain_semantics Other undefined)]
        pub unsafe fn undefined() -> Option<Retained<WebUndefined>>;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    unsafe impl WebUndefined {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Retained<Self>;
    }
);