objc2_foundation/generated/
NSAppleScript.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5
6use crate::*;
7
8extern "C" {
9    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsapplescripterrormessage?language=objc)
10    #[cfg(feature = "NSString")]
11    pub static NSAppleScriptErrorMessage: &'static NSString;
12}
13
14extern "C" {
15    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsapplescripterrornumber?language=objc)
16    #[cfg(feature = "NSString")]
17    pub static NSAppleScriptErrorNumber: &'static NSString;
18}
19
20extern "C" {
21    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsapplescripterrorappname?language=objc)
22    #[cfg(feature = "NSString")]
23    pub static NSAppleScriptErrorAppName: &'static NSString;
24}
25
26extern "C" {
27    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsapplescripterrorbriefmessage?language=objc)
28    #[cfg(feature = "NSString")]
29    pub static NSAppleScriptErrorBriefMessage: &'static NSString;
30}
31
32extern "C" {
33    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsapplescripterrorrange?language=objc)
34    #[cfg(feature = "NSString")]
35    pub static NSAppleScriptErrorRange: &'static NSString;
36}
37
38extern_class!(
39    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsapplescript?language=objc)
40    #[unsafe(super(NSObject))]
41    #[derive(Debug, PartialEq, Eq, Hash)]
42    pub struct NSAppleScript;
43);
44
45#[cfg(feature = "NSObject")]
46extern_conformance!(
47    unsafe impl NSCopying for NSAppleScript {}
48);
49
50#[cfg(feature = "NSObject")]
51unsafe impl CopyingHelper for NSAppleScript {
52    type Result = Self;
53}
54
55extern_conformance!(
56    unsafe impl NSObjectProtocol for NSAppleScript {}
57);
58
59impl NSAppleScript {
60    extern_methods!(
61        #[cfg(all(feature = "NSDictionary", feature = "NSString", feature = "NSURL"))]
62        /// # Safety
63        ///
64        /// `error_info` generic should be of the correct type.
65        #[unsafe(method(initWithContentsOfURL:error:))]
66        #[unsafe(method_family = init)]
67        pub unsafe fn initWithContentsOfURL_error(
68            this: Allocated<Self>,
69            url: &NSURL,
70            error_info: Option<&mut Option<Retained<NSDictionary<NSString, AnyObject>>>>,
71        ) -> Option<Retained<Self>>;
72
73        #[cfg(feature = "NSString")]
74        #[unsafe(method(initWithSource:))]
75        #[unsafe(method_family = init)]
76        pub fn initWithSource(this: Allocated<Self>, source: &NSString) -> Option<Retained<Self>>;
77
78        #[cfg(feature = "NSString")]
79        #[unsafe(method(source))]
80        #[unsafe(method_family = none)]
81        pub fn source(&self) -> Option<Retained<NSString>>;
82
83        #[unsafe(method(isCompiled))]
84        #[unsafe(method_family = none)]
85        pub fn isCompiled(&self) -> bool;
86
87        #[cfg(all(feature = "NSDictionary", feature = "NSString"))]
88        /// # Safety
89        ///
90        /// `error_info` generic should be of the correct type.
91        #[unsafe(method(compileAndReturnError:))]
92        #[unsafe(method_family = none)]
93        pub unsafe fn compileAndReturnError(
94            &self,
95            error_info: Option<&mut Option<Retained<NSDictionary<NSString, AnyObject>>>>,
96        ) -> bool;
97
98        #[cfg(all(
99            feature = "NSAppleEventDescriptor",
100            feature = "NSDictionary",
101            feature = "NSString"
102        ))]
103        /// # Safety
104        ///
105        /// `error_info` generic should be of the correct type.
106        #[unsafe(method(executeAndReturnError:))]
107        #[unsafe(method_family = none)]
108        pub unsafe fn executeAndReturnError(
109            &self,
110            error_info: Option<&mut Option<Retained<NSDictionary<NSString, AnyObject>>>>,
111        ) -> Retained<NSAppleEventDescriptor>;
112
113        #[cfg(all(
114            feature = "NSAppleEventDescriptor",
115            feature = "NSDictionary",
116            feature = "NSString"
117        ))]
118        /// # Safety
119        ///
120        /// `error_info` generic should be of the correct type.
121        #[unsafe(method(executeAppleEvent:error:))]
122        #[unsafe(method_family = none)]
123        pub unsafe fn executeAppleEvent_error(
124            &self,
125            event: &NSAppleEventDescriptor,
126            error_info: Option<&mut Option<Retained<NSDictionary<NSString, AnyObject>>>>,
127        ) -> Retained<NSAppleEventDescriptor>;
128    );
129}
130
131/// Methods declared on superclass `NSObject`.
132impl NSAppleScript {
133    extern_methods!(
134        #[unsafe(method(init))]
135        #[unsafe(method_family = init)]
136        pub fn init(this: Allocated<Self>) -> Retained<Self>;
137
138        #[unsafe(method(new))]
139        #[unsafe(method_family = new)]
140        pub fn new() -> Retained<Self>;
141    );
142}
143
144impl DefaultRetained for NSAppleScript {
145    #[inline]
146    fn default_retained() -> Retained<Self> {
147        Self::new()
148    }
149}