objc2_extension_kit/generated/
EXHostViewController.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-app-kit")]
7#[cfg(target_os = "macos")]
8use objc2_app_kit::*;
9use objc2_foundation::*;
10
11use crate::*;
12
13extern_class!(
14 #[unsafe(super(NSViewController, NSResponder, NSObject))]
18 #[derive(Debug, PartialEq, Eq, Hash)]
19 #[cfg(feature = "objc2-app-kit")]
20 #[cfg(target_os = "macos")]
21 pub struct EXHostViewController;
22);
23
24#[cfg(feature = "objc2-app-kit")]
25#[cfg(target_os = "macos")]
26extern_conformance!(
27 unsafe impl NSCoding for EXHostViewController {}
28);
29
30#[cfg(feature = "objc2-app-kit")]
31#[cfg(target_os = "macos")]
32extern_conformance!(
33 unsafe impl NSEditor for EXHostViewController {}
34);
35
36#[cfg(feature = "objc2-app-kit")]
37#[cfg(target_os = "macos")]
38extern_conformance!(
39 unsafe impl NSObjectProtocol for EXHostViewController {}
40);
41
42#[cfg(feature = "objc2-app-kit")]
43#[cfg(target_os = "macos")]
44extern_conformance!(
45 unsafe impl NSSeguePerforming for EXHostViewController {}
46);
47
48#[cfg(feature = "objc2-app-kit")]
49#[cfg(target_os = "macos")]
50extern_conformance!(
51 unsafe impl NSUserInterfaceItemIdentification for EXHostViewController {}
52);
53
54#[cfg(feature = "objc2-app-kit")]
55#[cfg(target_os = "macos")]
56impl EXHostViewController {
57 extern_methods!(
58 #[unsafe(method(delegate))]
60 #[unsafe(method_family = none)]
61 pub unsafe fn delegate(
62 &self,
63 ) -> Option<Retained<ProtocolObject<dyn EXHostViewControllerDelegate>>>;
64
65 #[unsafe(method(setDelegate:))]
69 #[unsafe(method_family = none)]
70 pub unsafe fn setDelegate(
71 &self,
72 delegate: Option<&ProtocolObject<dyn EXHostViewControllerDelegate>>,
73 );
74
75 #[unsafe(method(placeholderView))]
77 #[unsafe(method_family = none)]
78 pub unsafe fn placeholderView(&self) -> Retained<NSView>;
79
80 #[unsafe(method(setPlaceholderView:))]
82 #[unsafe(method_family = none)]
83 pub unsafe fn setPlaceholderView(&self, placeholder_view: &NSView);
84
85 #[unsafe(method(makeXPCConnectionWithError:_))]
89 #[unsafe(method_family = none)]
90 pub unsafe fn makeXPCConnectionWithError(
91 &self,
92 ) -> Result<Retained<NSXPCConnection>, Retained<NSError>>;
93 );
94}
95
96#[cfg(feature = "objc2-app-kit")]
98#[cfg(target_os = "macos")]
99impl EXHostViewController {
100 extern_methods!(
101 #[unsafe(method(initWithNibName:bundle:))]
102 #[unsafe(method_family = init)]
103 pub unsafe fn initWithNibName_bundle(
104 this: Allocated<Self>,
105 nib_name_or_nil: Option<&NSNibName>,
106 nib_bundle_or_nil: Option<&NSBundle>,
107 ) -> Retained<Self>;
108
109 #[unsafe(method(initWithCoder:))]
113 #[unsafe(method_family = init)]
114 pub unsafe fn initWithCoder(
115 this: Allocated<Self>,
116 coder: &NSCoder,
117 ) -> Option<Retained<Self>>;
118 );
119}
120
121#[cfg(feature = "objc2-app-kit")]
123#[cfg(target_os = "macos")]
124impl EXHostViewController {
125 extern_methods!(
126 #[unsafe(method(init))]
127 #[unsafe(method_family = init)]
128 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
129 );
130}
131
132#[cfg(feature = "objc2-app-kit")]
134#[cfg(target_os = "macos")]
135impl EXHostViewController {
136 extern_methods!(
137 #[unsafe(method(new))]
138 #[unsafe(method_family = new)]
139 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
140 );
141}
142
143extern_protocol!(
144 pub unsafe trait EXHostViewControllerDelegate:
148 NSObjectProtocol + MainThreadOnly
149 {
150 #[cfg(feature = "objc2-app-kit")]
151 #[cfg(target_os = "macos")]
152 #[optional]
162 #[unsafe(method(hostViewControllerDidActivate:))]
163 #[unsafe(method_family = none)]
164 unsafe fn hostViewControllerDidActivate(&self, view_controller: &EXHostViewController);
165
166 #[cfg(feature = "objc2-app-kit")]
167 #[cfg(target_os = "macos")]
168 #[optional]
181 #[unsafe(method(hostViewControllerWillDeactivate:error:))]
182 #[unsafe(method_family = none)]
183 unsafe fn hostViewControllerWillDeactivate_error(
184 &self,
185 view_controller: &EXHostViewController,
186 error: Option<&NSError>,
187 );
188 }
189);