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:))]
68 #[unsafe(method_family = none)]
69 pub unsafe fn setDelegate(
70 &self,
71 delegate: Option<&ProtocolObject<dyn EXHostViewControllerDelegate>>,
72 );
73
74 #[unsafe(method(placeholderView))]
76 #[unsafe(method_family = none)]
77 pub unsafe fn placeholderView(&self) -> Retained<NSView>;
78
79 #[unsafe(method(setPlaceholderView:))]
81 #[unsafe(method_family = none)]
82 pub unsafe fn setPlaceholderView(&self, placeholder_view: &NSView);
83
84 #[unsafe(method(makeXPCConnectionWithError:_))]
88 #[unsafe(method_family = none)]
89 pub unsafe fn makeXPCConnectionWithError(
90 &self,
91 ) -> Result<Retained<NSXPCConnection>, Retained<NSError>>;
92 );
93}
94
95#[cfg(feature = "objc2-app-kit")]
97#[cfg(target_os = "macos")]
98impl EXHostViewController {
99 extern_methods!(
100 #[unsafe(method(initWithNibName:bundle:))]
101 #[unsafe(method_family = init)]
102 pub unsafe fn initWithNibName_bundle(
103 this: Allocated<Self>,
104 nib_name_or_nil: Option<&NSNibName>,
105 nib_bundle_or_nil: Option<&NSBundle>,
106 ) -> Retained<Self>;
107
108 #[unsafe(method(initWithCoder:))]
109 #[unsafe(method_family = init)]
110 pub unsafe fn initWithCoder(
111 this: Allocated<Self>,
112 coder: &NSCoder,
113 ) -> Option<Retained<Self>>;
114 );
115}
116
117#[cfg(feature = "objc2-app-kit")]
119#[cfg(target_os = "macos")]
120impl EXHostViewController {
121 extern_methods!(
122 #[unsafe(method(init))]
123 #[unsafe(method_family = init)]
124 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
125 );
126}
127
128#[cfg(feature = "objc2-app-kit")]
130#[cfg(target_os = "macos")]
131impl EXHostViewController {
132 extern_methods!(
133 #[unsafe(method(new))]
134 #[unsafe(method_family = new)]
135 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
136 );
137}
138
139extern_protocol!(
140 pub unsafe trait EXHostViewControllerDelegate:
144 NSObjectProtocol + MainThreadOnly
145 {
146 #[cfg(feature = "objc2-app-kit")]
147 #[cfg(target_os = "macos")]
148 #[optional]
158 #[unsafe(method(hostViewControllerDidActivate:))]
159 #[unsafe(method_family = none)]
160 unsafe fn hostViewControllerDidActivate(&self, view_controller: &EXHostViewController);
161
162 #[cfg(feature = "objc2-app-kit")]
163 #[cfg(target_os = "macos")]
164 #[optional]
177 #[unsafe(method(hostViewControllerWillDeactivate:error:))]
178 #[unsafe(method_family = none)]
179 unsafe fn hostViewControllerWillDeactivate_error(
180 &self,
181 view_controller: &EXHostViewController,
182 error: Option<&NSError>,
183 );
184 }
185);