objc2_foundation/generated/
NSScriptCoercionHandler.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6
7use crate::*;
8
9extern_class!(
10    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsscriptcoercionhandler?language=objc)
11    #[unsafe(super(NSObject))]
12    #[derive(Debug, PartialEq, Eq, Hash)]
13    pub struct NSScriptCoercionHandler;
14);
15
16extern_conformance!(
17    unsafe impl NSObjectProtocol for NSScriptCoercionHandler {}
18);
19
20impl NSScriptCoercionHandler {
21    extern_methods!(
22        #[unsafe(method(sharedCoercionHandler))]
23        #[unsafe(method_family = none)]
24        pub fn sharedCoercionHandler() -> Retained<NSScriptCoercionHandler>;
25
26        /// # Safety
27        ///
28        /// - `value` should be of the correct type.
29        /// - `to_class` probably has further requirements.
30        #[unsafe(method(coerceValue:toClass:))]
31        #[unsafe(method_family = none)]
32        pub unsafe fn coerceValue_toClass(
33            &self,
34            value: &AnyObject,
35            to_class: &AnyClass,
36        ) -> Option<Retained<AnyObject>>;
37
38        /// # Safety
39        ///
40        /// - `coercer` should be of the correct type.
41        /// - `selector` must be a valid selector.
42        /// - `from_class` probably has further requirements.
43        /// - `to_class` probably has further requirements.
44        #[unsafe(method(registerCoercer:selector:toConvertFromClass:toClass:))]
45        #[unsafe(method_family = none)]
46        pub unsafe fn registerCoercer_selector_toConvertFromClass_toClass(
47            &self,
48            coercer: &AnyObject,
49            selector: Sel,
50            from_class: &AnyClass,
51            to_class: &AnyClass,
52        );
53    );
54}
55
56/// Methods declared on superclass `NSObject`.
57impl NSScriptCoercionHandler {
58    extern_methods!(
59        #[unsafe(method(init))]
60        #[unsafe(method_family = init)]
61        pub fn init(this: Allocated<Self>) -> Retained<Self>;
62
63        #[unsafe(method(new))]
64        #[unsafe(method_family = new)]
65        pub fn new() -> Retained<Self>;
66    );
67}
68
69impl DefaultRetained for NSScriptCoercionHandler {
70    #[inline]
71    fn default_retained() -> Retained<Self> {
72        Self::new()
73    }
74}