objc2_app_kit/generated/
NSWindowController.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::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswindowcontroller?language=objc)
12    #[unsafe(super(NSResponder, NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    #[cfg(feature = "NSResponder")]
15    pub struct NSWindowController;
16);
17
18#[cfg(feature = "NSResponder")]
19unsafe impl NSCoding for NSWindowController {}
20
21#[cfg(feature = "NSResponder")]
22unsafe impl NSObjectProtocol for NSWindowController {}
23
24#[cfg(all(feature = "NSResponder", feature = "NSStoryboardSegue"))]
25unsafe impl NSSeguePerforming for NSWindowController {}
26
27#[cfg(feature = "NSResponder")]
28impl NSWindowController {
29    extern_methods!(
30        #[cfg(feature = "NSWindow")]
31        #[unsafe(method(initWithWindow:))]
32        #[unsafe(method_family = init)]
33        pub unsafe fn initWithWindow(
34            this: Allocated<Self>,
35            window: Option<&NSWindow>,
36        ) -> Retained<Self>;
37
38        #[unsafe(method(initWithCoder:))]
39        #[unsafe(method_family = init)]
40        pub unsafe fn initWithCoder(
41            this: Allocated<Self>,
42            coder: &NSCoder,
43        ) -> Option<Retained<Self>>;
44
45        #[cfg(feature = "NSNib")]
46        #[unsafe(method(initWithWindowNibName:))]
47        #[unsafe(method_family = init)]
48        pub unsafe fn initWithWindowNibName(
49            this: Allocated<Self>,
50            window_nib_name: &NSNibName,
51        ) -> Retained<Self>;
52
53        #[cfg(feature = "NSNib")]
54        #[unsafe(method(initWithWindowNibName:owner:))]
55        #[unsafe(method_family = init)]
56        pub unsafe fn initWithWindowNibName_owner(
57            this: Allocated<Self>,
58            window_nib_name: &NSNibName,
59            owner: &AnyObject,
60        ) -> Retained<Self>;
61
62        #[unsafe(method(initWithWindowNibPath:owner:))]
63        #[unsafe(method_family = init)]
64        pub unsafe fn initWithWindowNibPath_owner(
65            this: Allocated<Self>,
66            window_nib_path: &NSString,
67            owner: &AnyObject,
68        ) -> Retained<Self>;
69
70        #[cfg(feature = "NSNib")]
71        #[unsafe(method(windowNibName))]
72        #[unsafe(method_family = none)]
73        pub unsafe fn windowNibName(&self) -> Option<Retained<NSNibName>>;
74
75        #[unsafe(method(windowNibPath))]
76        #[unsafe(method_family = none)]
77        pub unsafe fn windowNibPath(&self) -> Option<Retained<NSString>>;
78
79        #[unsafe(method(owner))]
80        #[unsafe(method_family = none)]
81        pub unsafe fn owner(&self) -> Option<Retained<AnyObject>>;
82
83        #[cfg(feature = "NSWindow")]
84        #[unsafe(method(windowFrameAutosaveName))]
85        #[unsafe(method_family = none)]
86        pub unsafe fn windowFrameAutosaveName(&self) -> Retained<NSWindowFrameAutosaveName>;
87
88        #[cfg(feature = "NSWindow")]
89        /// Setter for [`windowFrameAutosaveName`][Self::windowFrameAutosaveName].
90        #[unsafe(method(setWindowFrameAutosaveName:))]
91        #[unsafe(method_family = none)]
92        pub unsafe fn setWindowFrameAutosaveName(
93            &self,
94            window_frame_autosave_name: &NSWindowFrameAutosaveName,
95        );
96
97        #[unsafe(method(shouldCascadeWindows))]
98        #[unsafe(method_family = none)]
99        pub unsafe fn shouldCascadeWindows(&self) -> bool;
100
101        /// Setter for [`shouldCascadeWindows`][Self::shouldCascadeWindows].
102        #[unsafe(method(setShouldCascadeWindows:))]
103        #[unsafe(method_family = none)]
104        pub unsafe fn setShouldCascadeWindows(&self, should_cascade_windows: bool);
105
106        #[cfg(feature = "NSPreviewRepresentingActivityItem")]
107        #[unsafe(method(previewRepresentableActivityItems))]
108        #[unsafe(method_family = none)]
109        pub unsafe fn previewRepresentableActivityItems(
110            &self,
111        ) -> Option<Retained<NSArray<ProtocolObject<dyn NSPreviewRepresentableActivityItem>>>>;
112
113        #[cfg(feature = "NSPreviewRepresentingActivityItem")]
114        /// Setter for [`previewRepresentableActivityItems`][Self::previewRepresentableActivityItems].
115        #[unsafe(method(setPreviewRepresentableActivityItems:))]
116        #[unsafe(method_family = none)]
117        pub unsafe fn setPreviewRepresentableActivityItems(
118            &self,
119            preview_representable_activity_items: Option<
120                &NSArray<ProtocolObject<dyn NSPreviewRepresentableActivityItem>>,
121            >,
122        );
123
124        #[unsafe(method(document))]
125        #[unsafe(method_family = none)]
126        pub unsafe fn document(&self) -> Option<Retained<AnyObject>>;
127
128        /// Setter for [`document`][Self::document].
129        #[unsafe(method(setDocument:))]
130        #[unsafe(method_family = none)]
131        pub unsafe fn setDocument(&self, document: Option<&AnyObject>);
132
133        #[unsafe(method(setDocumentEdited:))]
134        #[unsafe(method_family = none)]
135        pub unsafe fn setDocumentEdited(&self, dirty_flag: bool);
136
137        #[unsafe(method(shouldCloseDocument))]
138        #[unsafe(method_family = none)]
139        pub unsafe fn shouldCloseDocument(&self) -> bool;
140
141        /// Setter for [`shouldCloseDocument`][Self::shouldCloseDocument].
142        #[unsafe(method(setShouldCloseDocument:))]
143        #[unsafe(method_family = none)]
144        pub unsafe fn setShouldCloseDocument(&self, should_close_document: bool);
145
146        #[unsafe(method(synchronizeWindowTitleWithDocumentName))]
147        #[unsafe(method_family = none)]
148        pub unsafe fn synchronizeWindowTitleWithDocumentName(&self);
149
150        #[unsafe(method(windowTitleForDocumentDisplayName:))]
151        #[unsafe(method_family = none)]
152        pub unsafe fn windowTitleForDocumentDisplayName(
153            &self,
154            display_name: &NSString,
155        ) -> Retained<NSString>;
156
157        #[cfg(feature = "NSViewController")]
158        #[unsafe(method(contentViewController))]
159        #[unsafe(method_family = none)]
160        pub unsafe fn contentViewController(&self) -> Option<Retained<NSViewController>>;
161
162        #[cfg(feature = "NSViewController")]
163        /// Setter for [`contentViewController`][Self::contentViewController].
164        #[unsafe(method(setContentViewController:))]
165        #[unsafe(method_family = none)]
166        pub unsafe fn setContentViewController(
167            &self,
168            content_view_controller: Option<&NSViewController>,
169        );
170
171        #[cfg(feature = "NSWindow")]
172        #[unsafe(method(window))]
173        #[unsafe(method_family = none)]
174        pub unsafe fn window(&self) -> Option<Retained<NSWindow>>;
175
176        #[cfg(feature = "NSWindow")]
177        /// Setter for [`window`][Self::window].
178        #[unsafe(method(setWindow:))]
179        #[unsafe(method_family = none)]
180        pub unsafe fn setWindow(&self, window: Option<&NSWindow>);
181
182        #[unsafe(method(isWindowLoaded))]
183        #[unsafe(method_family = none)]
184        pub unsafe fn isWindowLoaded(&self) -> bool;
185
186        #[unsafe(method(windowWillLoad))]
187        #[unsafe(method_family = none)]
188        pub unsafe fn windowWillLoad(&self);
189
190        #[unsafe(method(windowDidLoad))]
191        #[unsafe(method_family = none)]
192        pub unsafe fn windowDidLoad(&self);
193
194        #[unsafe(method(loadWindow))]
195        #[unsafe(method_family = none)]
196        pub unsafe fn loadWindow(&self);
197
198        #[unsafe(method(close))]
199        #[unsafe(method_family = none)]
200        pub unsafe fn close(&self);
201
202        #[unsafe(method(showWindow:))]
203        #[unsafe(method_family = none)]
204        pub unsafe fn showWindow(&self, sender: Option<&AnyObject>);
205    );
206}
207
208/// Methods declared on superclass `NSResponder`.
209#[cfg(feature = "NSResponder")]
210impl NSWindowController {
211    extern_methods!(
212        #[unsafe(method(init))]
213        #[unsafe(method_family = init)]
214        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
215    );
216}
217
218/// Methods declared on superclass `NSObject`.
219#[cfg(feature = "NSResponder")]
220impl NSWindowController {
221    extern_methods!(
222        #[unsafe(method(new))]
223        #[unsafe(method_family = new)]
224        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
225    );
226}
227
228/// NSWindowControllerStoryboardingMethods.
229/// These methods are used to support using Storyboards with your app.
230#[cfg(feature = "NSResponder")]
231impl NSWindowController {
232    extern_methods!(
233        #[cfg(feature = "NSStoryboard")]
234        #[unsafe(method(storyboard))]
235        #[unsafe(method_family = none)]
236        pub unsafe fn storyboard(&self) -> Option<Retained<NSStoryboard>>;
237    );
238}
239
240/// NSWindowControllerDismissing.
241#[cfg(feature = "NSResponder")]
242impl NSWindowController {
243    extern_methods!(
244        #[unsafe(method(dismissController:))]
245        #[unsafe(method_family = none)]
246        pub unsafe fn dismissController(&self, sender: Option<&AnyObject>);
247    );
248}