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