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")]
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 #[unsafe(method(initWithContentsOfURL:error:))]
63 #[unsafe(method_family = init)]
64 pub unsafe fn initWithContentsOfURL_error(
65 this: Allocated<Self>,
66 url: &NSURL,
67 error_info: Option<&mut Option<Retained<NSDictionary<NSString, AnyObject>>>>,
68 ) -> Option<Retained<Self>>;
69
70 #[cfg(feature = "NSString")]
71 #[unsafe(method(initWithSource:))]
72 #[unsafe(method_family = init)]
73 pub unsafe fn initWithSource(
74 this: Allocated<Self>,
75 source: &NSString,
76 ) -> Option<Retained<Self>>;
77
78 #[cfg(feature = "NSString")]
79 #[unsafe(method(source))]
80 #[unsafe(method_family = none)]
81 pub unsafe fn source(&self) -> Option<Retained<NSString>>;
82
83 #[unsafe(method(isCompiled))]
84 #[unsafe(method_family = none)]
85 pub unsafe fn isCompiled(&self) -> bool;
86
87 #[cfg(all(feature = "NSDictionary", feature = "NSString"))]
88 #[unsafe(method(compileAndReturnError:))]
89 #[unsafe(method_family = none)]
90 pub unsafe fn compileAndReturnError(
91 &self,
92 error_info: Option<&mut Option<Retained<NSDictionary<NSString, AnyObject>>>>,
93 ) -> bool;
94
95 #[cfg(all(
96 feature = "NSAppleEventDescriptor",
97 feature = "NSDictionary",
98 feature = "NSString"
99 ))]
100 #[unsafe(method(executeAndReturnError:))]
101 #[unsafe(method_family = none)]
102 pub unsafe fn executeAndReturnError(
103 &self,
104 error_info: Option<&mut Option<Retained<NSDictionary<NSString, AnyObject>>>>,
105 ) -> Retained<NSAppleEventDescriptor>;
106
107 #[cfg(all(
108 feature = "NSAppleEventDescriptor",
109 feature = "NSDictionary",
110 feature = "NSString"
111 ))]
112 #[unsafe(method(executeAppleEvent:error:))]
113 #[unsafe(method_family = none)]
114 pub unsafe fn executeAppleEvent_error(
115 &self,
116 event: &NSAppleEventDescriptor,
117 error_info: Option<&mut Option<Retained<NSDictionary<NSString, AnyObject>>>>,
118 ) -> Retained<NSAppleEventDescriptor>;
119 );
120}
121
122impl NSAppleScript {
124 extern_methods!(
125 #[unsafe(method(init))]
126 #[unsafe(method_family = init)]
127 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
128
129 #[unsafe(method(new))]
130 #[unsafe(method_family = new)]
131 pub unsafe fn new() -> Retained<Self>;
132 );
133}