//! 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 crate::*;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsscriptcoercionhandler?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct NSScriptCoercionHandler;
);

unsafe impl NSObjectProtocol for NSScriptCoercionHandler {}

impl NSScriptCoercionHandler {
    extern_methods!(
        #[unsafe(method(sharedCoercionHandler))]
        #[unsafe(method_family = none)]
        pub unsafe fn sharedCoercionHandler() -> Retained<NSScriptCoercionHandler>;

        #[unsafe(method(coerceValue:toClass:))]
        #[unsafe(method_family = none)]
        pub unsafe fn coerceValue_toClass(
            &self,
            value: &AnyObject,
            to_class: &AnyClass,
        ) -> Option<Retained<AnyObject>>;

        #[unsafe(method(registerCoercer:selector:toConvertFromClass:toClass:))]
        #[unsafe(method_family = none)]
        pub unsafe fn registerCoercer_selector_toConvertFromClass_toClass(
            &self,
            coercer: &AnyObject,
            selector: Sel,
            from_class: &AnyClass,
            to_class: &AnyClass,
        );
    );
}

/// Methods declared on superclass `NSObject`.
impl NSScriptCoercionHandler {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}
