1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(all(
        feature = "NSPanel",
        feature = "NSResponder",
        feature = "NSSavePanel",
        feature = "NSWindow"
    ))]
    pub struct NSOpenPanel;

    #[cfg(all(
        feature = "NSPanel",
        feature = "NSResponder",
        feature = "NSSavePanel",
        feature = "NSWindow"
    ))]
    unsafe impl ClassType for NSOpenPanel {
        #[inherits(NSPanel, NSWindow, NSResponder, NSObject)]
        type Super = NSSavePanel;
        type Mutability = MainThreadOnly;
    }
);

#[cfg(all(
    feature = "NSAccessibilityProtocols",
    feature = "NSPanel",
    feature = "NSResponder",
    feature = "NSSavePanel",
    feature = "NSWindow"
))]
unsafe impl NSAccessibility for NSOpenPanel {}

#[cfg(all(
    feature = "NSAccessibilityProtocols",
    feature = "NSPanel",
    feature = "NSResponder",
    feature = "NSSavePanel",
    feature = "NSWindow"
))]
unsafe impl NSAccessibilityElementProtocol for NSOpenPanel {}

#[cfg(all(
    feature = "NSAnimation",
    feature = "NSPanel",
    feature = "NSResponder",
    feature = "NSSavePanel",
    feature = "NSWindow"
))]
unsafe impl NSAnimatablePropertyContainer for NSOpenPanel {}

#[cfg(all(
    feature = "NSAppearance",
    feature = "NSPanel",
    feature = "NSResponder",
    feature = "NSSavePanel",
    feature = "NSWindow"
))]
unsafe impl NSAppearanceCustomization for NSOpenPanel {}

#[cfg(all(
    feature = "NSPanel",
    feature = "NSResponder",
    feature = "NSSavePanel",
    feature = "NSWindow"
))]
unsafe impl NSCoding for NSOpenPanel {}

#[cfg(all(
    feature = "NSMenu",
    feature = "NSPanel",
    feature = "NSResponder",
    feature = "NSSavePanel",
    feature = "NSWindow"
))]
unsafe impl NSMenuItemValidation for NSOpenPanel {}

#[cfg(all(
    feature = "NSPanel",
    feature = "NSResponder",
    feature = "NSSavePanel",
    feature = "NSWindow"
))]
unsafe impl NSObjectProtocol for NSOpenPanel {}

#[cfg(all(
    feature = "NSPanel",
    feature = "NSResponder",
    feature = "NSSavePanel",
    feature = "NSUserInterfaceItemIdentification",
    feature = "NSWindow"
))]
unsafe impl NSUserInterfaceItemIdentification for NSOpenPanel {}

#[cfg(all(
    feature = "NSPanel",
    feature = "NSResponder",
    feature = "NSSavePanel",
    feature = "NSUserInterfaceValidation",
    feature = "NSWindow"
))]
unsafe impl NSUserInterfaceValidations for NSOpenPanel {}

extern_methods!(
    #[cfg(all(
        feature = "NSPanel",
        feature = "NSResponder",
        feature = "NSSavePanel",
        feature = "NSWindow"
    ))]
    unsafe impl NSOpenPanel {
        #[method_id(@__retain_semantics Other openPanel)]
        pub unsafe fn openPanel(mtm: MainThreadMarker) -> Id<NSOpenPanel>;

        #[method_id(@__retain_semantics Other URLs)]
        pub unsafe fn URLs(&self) -> Id<NSArray<NSURL>>;

        #[method(resolvesAliases)]
        pub unsafe fn resolvesAliases(&self) -> bool;

        #[method(setResolvesAliases:)]
        pub unsafe fn setResolvesAliases(&self, resolves_aliases: bool);

        #[method(canChooseDirectories)]
        pub unsafe fn canChooseDirectories(&self) -> bool;

        #[method(setCanChooseDirectories:)]
        pub unsafe fn setCanChooseDirectories(&self, can_choose_directories: bool);

        #[method(allowsMultipleSelection)]
        pub unsafe fn allowsMultipleSelection(&self) -> bool;

        #[method(setAllowsMultipleSelection:)]
        pub unsafe fn setAllowsMultipleSelection(&self, allows_multiple_selection: bool);

        #[method(canChooseFiles)]
        pub unsafe fn canChooseFiles(&self) -> bool;

        #[method(setCanChooseFiles:)]
        pub unsafe fn setCanChooseFiles(&self, can_choose_files: bool);

        #[method(canResolveUbiquitousConflicts)]
        pub unsafe fn canResolveUbiquitousConflicts(&self) -> bool;

        #[method(setCanResolveUbiquitousConflicts:)]
        pub unsafe fn setCanResolveUbiquitousConflicts(
            &self,
            can_resolve_ubiquitous_conflicts: bool,
        );

        #[method(canDownloadUbiquitousContents)]
        pub unsafe fn canDownloadUbiquitousContents(&self) -> bool;

        #[method(setCanDownloadUbiquitousContents:)]
        pub unsafe fn setCanDownloadUbiquitousContents(
            &self,
            can_download_ubiquitous_contents: bool,
        );

        #[method(isAccessoryViewDisclosed)]
        pub unsafe fn isAccessoryViewDisclosed(&self) -> bool;

        #[method(setAccessoryViewDisclosed:)]
        pub unsafe fn setAccessoryViewDisclosed(&self, accessory_view_disclosed: bool);
    }
);

extern_methods!(
    /// Methods declared on superclass `NSWindow`
    #[cfg(all(
        feature = "NSPanel",
        feature = "NSResponder",
        feature = "NSSavePanel",
        feature = "NSWindow"
    ))]
    unsafe impl NSOpenPanel {
        #[cfg(feature = "NSGraphics")]
        #[method_id(@__retain_semantics Init initWithContentRect:styleMask:backing:defer:)]
        pub unsafe fn initWithContentRect_styleMask_backing_defer(
            this: Allocated<Self>,
            content_rect: NSRect,
            style: NSWindowStyleMask,
            backing_store_type: NSBackingStoreType,
            flag: bool,
        ) -> Id<Self>;

        #[cfg(all(feature = "NSGraphics", feature = "NSScreen"))]
        #[method_id(@__retain_semantics Init initWithContentRect:styleMask:backing:defer:screen:)]
        pub unsafe fn initWithContentRect_styleMask_backing_defer_screen(
            this: Allocated<Self>,
            content_rect: NSRect,
            style: NSWindowStyleMask,
            backing_store_type: NSBackingStoreType,
            flag: bool,
            screen: Option<&NSScreen>,
        ) -> Id<Self>;

        #[method_id(@__retain_semantics Init initWithCoder:)]
        pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Id<Self>;

        #[cfg(feature = "NSViewController")]
        #[method_id(@__retain_semantics Other windowWithContentViewController:)]
        pub unsafe fn windowWithContentViewController(
            content_view_controller: &NSViewController,
        ) -> Id<Self>;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSResponder`
    #[cfg(all(
        feature = "NSPanel",
        feature = "NSResponder",
        feature = "NSSavePanel",
        feature = "NSWindow"
    ))]
    unsafe impl NSOpenPanel {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    #[cfg(all(
        feature = "NSPanel",
        feature = "NSResponder",
        feature = "NSSavePanel",
        feature = "NSWindow"
    ))]
    unsafe impl NSOpenPanel {
        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new(mtm: MainThreadMarker) -> Id<Self>;
    }
);

extern_methods!(
    /// NSDeprecated
    #[cfg(all(
        feature = "NSPanel",
        feature = "NSResponder",
        feature = "NSSavePanel",
        feature = "NSWindow"
    ))]
    unsafe impl NSOpenPanel {
        #[deprecated]
        #[method_id(@__retain_semantics Other filenames)]
        pub unsafe fn filenames(&self) -> Id<NSArray>;

        #[deprecated]
        #[method(beginSheetForDirectory:file:types:modalForWindow:modalDelegate:didEndSelector:contextInfo:)]
        pub unsafe fn beginSheetForDirectory_file_types_modalForWindow_modalDelegate_didEndSelector_contextInfo(
            &self,
            path: Option<&NSString>,
            name: Option<&NSString>,
            file_types: Option<&NSArray>,
            doc_window: Option<&NSWindow>,
            delegate: Option<&AnyObject>,
            did_end_selector: Option<Sel>,
            context_info: *mut c_void,
        );

        #[deprecated]
        #[method(beginForDirectory:file:types:modelessDelegate:didEndSelector:contextInfo:)]
        pub unsafe fn beginForDirectory_file_types_modelessDelegate_didEndSelector_contextInfo(
            &self,
            path: Option<&NSString>,
            name: Option<&NSString>,
            file_types: Option<&NSArray>,
            delegate: Option<&AnyObject>,
            did_end_selector: Option<Sel>,
            context_info: *mut c_void,
        );

        #[deprecated]
        #[method(runModalForDirectory:file:types:)]
        pub unsafe fn runModalForDirectory_file_types(
            &self,
            path: Option<&NSString>,
            name: Option<&NSString>,
            file_types: Option<&NSArray>,
        ) -> NSInteger;

        #[deprecated]
        #[method(runModalForTypes:)]
        pub unsafe fn runModalForTypes(&self, file_types: Option<&NSArray>) -> NSInteger;
    }
);