objc2_foundation/generated/
NSAppleScript.rs1use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5
6use crate::*;
7
8extern "C" {
9 #[cfg(feature = "NSString")]
11 pub static NSAppleScriptErrorMessage: &'static NSString;
12}
13
14extern "C" {
15 #[cfg(feature = "NSString")]
17 pub static NSAppleScriptErrorNumber: &'static NSString;
18}
19
20extern "C" {
21 #[cfg(feature = "NSString")]
23 pub static NSAppleScriptErrorAppName: &'static NSString;
24}
25
26extern "C" {
27 #[cfg(feature = "NSString")]
29 pub static NSAppleScriptErrorBriefMessage: &'static NSString;
30}
31
32extern "C" {
33 #[cfg(feature = "NSString")]
35 pub static NSAppleScriptErrorRange: &'static NSString;
36}
37
38extern_class!(
39 #[unsafe(super(NSObject))]
41 #[derive(Debug, PartialEq, Eq, Hash)]
42 pub struct NSAppleScript;
43);
44
45#[cfg(feature = "NSObject")]
46unsafe impl NSCopying for NSAppleScript {}
47
48#[cfg(feature = "NSObject")]
49unsafe impl CopyingHelper for NSAppleScript {
50 type Result = Self;
51}
52
53unsafe impl NSObjectProtocol for NSAppleScript {}
54
55impl NSAppleScript {
56 extern_methods!(
57 #[cfg(all(feature = "NSDictionary", feature = "NSString", feature = "NSURL"))]
58 #[unsafe(method(initWithContentsOfURL:error:))]
59 #[unsafe(method_family = init)]
60 pub unsafe fn initWithContentsOfURL_error(
61 this: Allocated<Self>,
62 url: &NSURL,
63 error_info: Option<&mut Option<Retained<NSDictionary<NSString, AnyObject>>>>,
64 ) -> Option<Retained<Self>>;
65
66 #[cfg(feature = "NSString")]
67 #[unsafe(method(initWithSource:))]
68 #[unsafe(method_family = init)]
69 pub unsafe fn initWithSource(
70 this: Allocated<Self>,
71 source: &NSString,
72 ) -> Option<Retained<Self>>;
73
74 #[cfg(feature = "NSString")]
75 #[unsafe(method(source))]
76 #[unsafe(method_family = none)]
77 pub unsafe fn source(&self) -> Option<Retained<NSString>>;
78
79 #[unsafe(method(isCompiled))]
80 #[unsafe(method_family = none)]
81 pub unsafe fn isCompiled(&self) -> bool;
82
83 #[cfg(all(feature = "NSDictionary", feature = "NSString"))]
84 #[unsafe(method(compileAndReturnError:))]
85 #[unsafe(method_family = none)]
86 pub unsafe fn compileAndReturnError(
87 &self,
88 error_info: Option<&mut Option<Retained<NSDictionary<NSString, AnyObject>>>>,
89 ) -> bool;
90
91 #[cfg(all(
92 feature = "NSAppleEventDescriptor",
93 feature = "NSDictionary",
94 feature = "NSString"
95 ))]
96 #[unsafe(method(executeAndReturnError:))]
97 #[unsafe(method_family = none)]
98 pub unsafe fn executeAndReturnError(
99 &self,
100 error_info: Option<&mut Option<Retained<NSDictionary<NSString, AnyObject>>>>,
101 ) -> Retained<NSAppleEventDescriptor>;
102
103 #[cfg(all(
104 feature = "NSAppleEventDescriptor",
105 feature = "NSDictionary",
106 feature = "NSString"
107 ))]
108 #[unsafe(method(executeAppleEvent:error:))]
109 #[unsafe(method_family = none)]
110 pub unsafe fn executeAppleEvent_error(
111 &self,
112 event: &NSAppleEventDescriptor,
113 error_info: Option<&mut Option<Retained<NSDictionary<NSString, AnyObject>>>>,
114 ) -> Retained<NSAppleEventDescriptor>;
115 );
116}
117
118impl NSAppleScript {
120 extern_methods!(
121 #[unsafe(method(init))]
122 #[unsafe(method_family = init)]
123 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
124
125 #[unsafe(method(new))]
126 #[unsafe(method_family = new)]
127 pub unsafe fn new() -> Retained<Self>;
128 );
129}