objc2_foundation/generated/
NSAppleEventDescriptor.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
9/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsappleeventsendoptions?language=objc)
10// NS_OPTIONS
11#[repr(transparent)]
12#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
13pub struct NSAppleEventSendOptions(pub NSUInteger);
14bitflags::bitflags! {
15    impl NSAppleEventSendOptions: NSUInteger {
16        #[doc(alias = "NSAppleEventSendNoReply")]
17        const NoReply = 1;
18        #[doc(alias = "NSAppleEventSendQueueReply")]
19        const QueueReply = 2;
20        #[doc(alias = "NSAppleEventSendWaitForReply")]
21        const WaitForReply = 3;
22        #[doc(alias = "NSAppleEventSendNeverInteract")]
23        const NeverInteract = 16;
24        #[doc(alias = "NSAppleEventSendCanInteract")]
25        const CanInteract = 32;
26        #[doc(alias = "NSAppleEventSendAlwaysInteract")]
27        const AlwaysInteract = 48;
28        #[doc(alias = "NSAppleEventSendCanSwitchLayer")]
29        const CanSwitchLayer = 64;
30        #[doc(alias = "NSAppleEventSendDontRecord")]
31        const DontRecord = 4096;
32        #[doc(alias = "NSAppleEventSendDontExecute")]
33        const DontExecute = 8192;
34        #[doc(alias = "NSAppleEventSendDontAnnotate")]
35        const DontAnnotate = 65536;
36        #[doc(alias = "NSAppleEventSendDefaultOptions")]
37        const DefaultOptions = 35;
38    }
39}
40
41unsafe impl Encode for NSAppleEventSendOptions {
42    const ENCODING: Encoding = NSUInteger::ENCODING;
43}
44
45unsafe impl RefEncode for NSAppleEventSendOptions {
46    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
47}
48
49extern_class!(
50    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsappleeventdescriptor?language=objc)
51    #[unsafe(super(NSObject))]
52    #[derive(Debug, PartialEq, Eq, Hash)]
53    pub struct NSAppleEventDescriptor;
54);
55
56#[cfg(feature = "NSObject")]
57unsafe impl NSCoding for NSAppleEventDescriptor {}
58
59#[cfg(feature = "NSObject")]
60unsafe impl NSCopying for NSAppleEventDescriptor {}
61
62#[cfg(feature = "NSObject")]
63unsafe impl CopyingHelper for NSAppleEventDescriptor {
64    type Result = Self;
65}
66
67unsafe impl NSObjectProtocol for NSAppleEventDescriptor {}
68
69#[cfg(feature = "NSObject")]
70unsafe impl NSSecureCoding for NSAppleEventDescriptor {}
71
72impl NSAppleEventDescriptor {
73    extern_methods!(
74        #[unsafe(method(nullDescriptor))]
75        #[unsafe(method_family = none)]
76        pub unsafe fn nullDescriptor() -> Retained<NSAppleEventDescriptor>;
77
78        #[unsafe(method(descriptorWithBoolean:))]
79        #[unsafe(method_family = none)]
80        pub unsafe fn descriptorWithBoolean(boolean: Boolean) -> Retained<NSAppleEventDescriptor>;
81
82        #[unsafe(method(descriptorWithEnumCode:))]
83        #[unsafe(method_family = none)]
84        pub unsafe fn descriptorWithEnumCode(
85            enumerator: OSType,
86        ) -> Retained<NSAppleEventDescriptor>;
87
88        #[unsafe(method(descriptorWithInt32:))]
89        #[unsafe(method_family = none)]
90        pub unsafe fn descriptorWithInt32(signed_int: i32) -> Retained<NSAppleEventDescriptor>;
91
92        #[unsafe(method(descriptorWithDouble:))]
93        #[unsafe(method_family = none)]
94        pub unsafe fn descriptorWithDouble(
95            double_value: c_double,
96        ) -> Retained<NSAppleEventDescriptor>;
97
98        #[unsafe(method(descriptorWithTypeCode:))]
99        #[unsafe(method_family = none)]
100        pub unsafe fn descriptorWithTypeCode(type_code: OSType)
101            -> Retained<NSAppleEventDescriptor>;
102
103        #[cfg(feature = "NSString")]
104        #[unsafe(method(descriptorWithString:))]
105        #[unsafe(method_family = none)]
106        pub unsafe fn descriptorWithString(string: &NSString) -> Retained<NSAppleEventDescriptor>;
107
108        #[cfg(feature = "NSDate")]
109        #[unsafe(method(descriptorWithDate:))]
110        #[unsafe(method_family = none)]
111        pub unsafe fn descriptorWithDate(date: &NSDate) -> Retained<NSAppleEventDescriptor>;
112
113        #[cfg(feature = "NSURL")]
114        #[unsafe(method(descriptorWithFileURL:))]
115        #[unsafe(method_family = none)]
116        pub unsafe fn descriptorWithFileURL(file_url: &NSURL) -> Retained<NSAppleEventDescriptor>;
117
118        #[unsafe(method(listDescriptor))]
119        #[unsafe(method_family = none)]
120        pub unsafe fn listDescriptor() -> Retained<NSAppleEventDescriptor>;
121
122        #[unsafe(method(recordDescriptor))]
123        #[unsafe(method_family = none)]
124        pub unsafe fn recordDescriptor() -> Retained<NSAppleEventDescriptor>;
125
126        #[unsafe(method(currentProcessDescriptor))]
127        #[unsafe(method_family = none)]
128        pub unsafe fn currentProcessDescriptor() -> Retained<NSAppleEventDescriptor>;
129
130        #[cfg(feature = "libc")]
131        #[unsafe(method(descriptorWithProcessIdentifier:))]
132        #[unsafe(method_family = none)]
133        pub unsafe fn descriptorWithProcessIdentifier(
134            process_identifier: libc::pid_t,
135        ) -> Retained<NSAppleEventDescriptor>;
136
137        #[cfg(feature = "NSString")]
138        #[unsafe(method(descriptorWithBundleIdentifier:))]
139        #[unsafe(method_family = none)]
140        pub unsafe fn descriptorWithBundleIdentifier(
141            bundle_identifier: &NSString,
142        ) -> Retained<NSAppleEventDescriptor>;
143
144        #[cfg(feature = "NSURL")]
145        #[unsafe(method(descriptorWithApplicationURL:))]
146        #[unsafe(method_family = none)]
147        pub unsafe fn descriptorWithApplicationURL(
148            application_url: &NSURL,
149        ) -> Retained<NSAppleEventDescriptor>;
150
151        #[unsafe(method(initListDescriptor))]
152        #[unsafe(method_family = init)]
153        pub unsafe fn initListDescriptor(this: Allocated<Self>) -> Retained<Self>;
154
155        #[unsafe(method(initRecordDescriptor))]
156        #[unsafe(method_family = init)]
157        pub unsafe fn initRecordDescriptor(this: Allocated<Self>) -> Retained<Self>;
158
159        #[cfg(feature = "NSData")]
160        #[unsafe(method(data))]
161        #[unsafe(method_family = none)]
162        pub unsafe fn data(&self) -> Retained<NSData>;
163
164        #[unsafe(method(booleanValue))]
165        #[unsafe(method_family = none)]
166        pub unsafe fn booleanValue(&self) -> Boolean;
167
168        #[unsafe(method(enumCodeValue))]
169        #[unsafe(method_family = none)]
170        pub unsafe fn enumCodeValue(&self) -> OSType;
171
172        #[unsafe(method(int32Value))]
173        #[unsafe(method_family = none)]
174        pub unsafe fn int32Value(&self) -> i32;
175
176        #[unsafe(method(doubleValue))]
177        #[unsafe(method_family = none)]
178        pub unsafe fn doubleValue(&self) -> c_double;
179
180        #[unsafe(method(typeCodeValue))]
181        #[unsafe(method_family = none)]
182        pub unsafe fn typeCodeValue(&self) -> OSType;
183
184        #[cfg(feature = "NSString")]
185        #[unsafe(method(stringValue))]
186        #[unsafe(method_family = none)]
187        pub unsafe fn stringValue(&self) -> Option<Retained<NSString>>;
188
189        #[cfg(feature = "NSDate")]
190        #[unsafe(method(dateValue))]
191        #[unsafe(method_family = none)]
192        pub unsafe fn dateValue(&self) -> Option<Retained<NSDate>>;
193
194        #[cfg(feature = "NSURL")]
195        #[unsafe(method(fileURLValue))]
196        #[unsafe(method_family = none)]
197        pub unsafe fn fileURLValue(&self) -> Option<Retained<NSURL>>;
198
199        #[unsafe(method(isRecordDescriptor))]
200        #[unsafe(method_family = none)]
201        pub unsafe fn isRecordDescriptor(&self) -> bool;
202
203        #[unsafe(method(numberOfItems))]
204        #[unsafe(method_family = none)]
205        pub unsafe fn numberOfItems(&self) -> NSInteger;
206
207        #[unsafe(method(insertDescriptor:atIndex:))]
208        #[unsafe(method_family = none)]
209        pub unsafe fn insertDescriptor_atIndex(
210            &self,
211            descriptor: &NSAppleEventDescriptor,
212            index: NSInteger,
213        );
214
215        #[unsafe(method(descriptorAtIndex:))]
216        #[unsafe(method_family = none)]
217        pub unsafe fn descriptorAtIndex(
218            &self,
219            index: NSInteger,
220        ) -> Option<Retained<NSAppleEventDescriptor>>;
221
222        #[unsafe(method(removeDescriptorAtIndex:))]
223        #[unsafe(method_family = none)]
224        pub unsafe fn removeDescriptorAtIndex(&self, index: NSInteger);
225    );
226}
227
228/// Methods declared on superclass `NSObject`.
229impl NSAppleEventDescriptor {
230    extern_methods!(
231        #[unsafe(method(init))]
232        #[unsafe(method_family = init)]
233        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
234
235        #[unsafe(method(new))]
236        #[unsafe(method_family = new)]
237        pub unsafe fn new() -> Retained<Self>;
238    );
239}