objc2_foundation/generated/
NSScriptExecutionContext.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/nsscriptexecutioncontext?language=objc)
11    #[unsafe(super(NSObject))]
12    #[derive(Debug, PartialEq, Eq, Hash)]
13    pub struct NSScriptExecutionContext;
14);
15
16extern_conformance!(
17    unsafe impl NSObjectProtocol for NSScriptExecutionContext {}
18);
19
20impl NSScriptExecutionContext {
21    extern_methods!(
22        #[unsafe(method(sharedScriptExecutionContext))]
23        #[unsafe(method_family = none)]
24        pub fn sharedScriptExecutionContext() -> Retained<NSScriptExecutionContext>;
25
26        #[unsafe(method(topLevelObject))]
27        #[unsafe(method_family = none)]
28        pub fn topLevelObject(&self) -> Option<Retained<AnyObject>>;
29
30        /// Setter for [`topLevelObject`][Self::topLevelObject].
31        ///
32        /// # Safety
33        ///
34        /// `top_level_object` should be of the correct type.
35        #[unsafe(method(setTopLevelObject:))]
36        #[unsafe(method_family = none)]
37        pub unsafe fn setTopLevelObject(&self, top_level_object: Option<&AnyObject>);
38
39        #[unsafe(method(objectBeingTested))]
40        #[unsafe(method_family = none)]
41        pub fn objectBeingTested(&self) -> Option<Retained<AnyObject>>;
42
43        /// Setter for [`objectBeingTested`][Self::objectBeingTested].
44        ///
45        /// # Safety
46        ///
47        /// `object_being_tested` should be of the correct type.
48        #[unsafe(method(setObjectBeingTested:))]
49        #[unsafe(method_family = none)]
50        pub unsafe fn setObjectBeingTested(&self, object_being_tested: Option<&AnyObject>);
51
52        #[unsafe(method(rangeContainerObject))]
53        #[unsafe(method_family = none)]
54        pub fn rangeContainerObject(&self) -> Option<Retained<AnyObject>>;
55
56        /// Setter for [`rangeContainerObject`][Self::rangeContainerObject].
57        ///
58        /// # Safety
59        ///
60        /// `range_container_object` should be of the correct type.
61        #[unsafe(method(setRangeContainerObject:))]
62        #[unsafe(method_family = none)]
63        pub unsafe fn setRangeContainerObject(&self, range_container_object: Option<&AnyObject>);
64    );
65}
66
67/// Methods declared on superclass `NSObject`.
68impl NSScriptExecutionContext {
69    extern_methods!(
70        #[unsafe(method(init))]
71        #[unsafe(method_family = init)]
72        pub fn init(this: Allocated<Self>) -> Retained<Self>;
73
74        #[unsafe(method(new))]
75        #[unsafe(method_family = new)]
76        pub fn new() -> Retained<Self>;
77    );
78}
79
80impl DefaultRetained for NSScriptExecutionContext {
81    #[inline]
82    fn default_retained() -> Retained<Self> {
83        Self::new()
84    }
85}