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")]
26unsafe impl NSCoding for EXHostViewController {}
27
28#[cfg(feature = "objc2-app-kit")]
29#[cfg(target_os = "macos")]
30unsafe impl NSEditor for EXHostViewController {}
31
32#[cfg(feature = "objc2-app-kit")]
33#[cfg(target_os = "macos")]
34unsafe impl NSObjectProtocol for EXHostViewController {}
35
36#[cfg(feature = "objc2-app-kit")]
37#[cfg(target_os = "macos")]
38unsafe impl NSSeguePerforming for EXHostViewController {}
39
40#[cfg(feature = "objc2-app-kit")]
41#[cfg(target_os = "macos")]
42unsafe impl NSUserInterfaceItemIdentification for EXHostViewController {}
43
44#[cfg(feature = "objc2-app-kit")]
45#[cfg(target_os = "macos")]
46impl EXHostViewController {
47 extern_methods!(
48 #[unsafe(method(delegate))]
50 #[unsafe(method_family = none)]
51 pub unsafe fn delegate(
52 &self,
53 ) -> Option<Retained<ProtocolObject<dyn EXHostViewControllerDelegate>>>;
54
55 #[unsafe(method(setDelegate:))]
58 #[unsafe(method_family = none)]
59 pub unsafe fn setDelegate(
60 &self,
61 delegate: Option<&ProtocolObject<dyn EXHostViewControllerDelegate>>,
62 );
63
64 #[unsafe(method(placeholderView))]
66 #[unsafe(method_family = none)]
67 pub unsafe fn placeholderView(&self) -> Retained<NSView>;
68
69 #[unsafe(method(setPlaceholderView:))]
71 #[unsafe(method_family = none)]
72 pub unsafe fn setPlaceholderView(&self, placeholder_view: &NSView);
73
74 #[unsafe(method(makeXPCConnectionWithError:_))]
78 #[unsafe(method_family = none)]
79 pub unsafe fn makeXPCConnectionWithError(
80 &self,
81 ) -> Result<Retained<NSXPCConnection>, Retained<NSError>>;
82 );
83}
84
85#[cfg(feature = "objc2-app-kit")]
87#[cfg(target_os = "macos")]
88impl EXHostViewController {
89 extern_methods!(
90 #[unsafe(method(initWithNibName:bundle:))]
91 #[unsafe(method_family = init)]
92 pub unsafe fn initWithNibName_bundle(
93 this: Allocated<Self>,
94 nib_name_or_nil: Option<&NSNibName>,
95 nib_bundle_or_nil: Option<&NSBundle>,
96 ) -> Retained<Self>;
97
98 #[unsafe(method(initWithCoder:))]
99 #[unsafe(method_family = init)]
100 pub unsafe fn initWithCoder(
101 this: Allocated<Self>,
102 coder: &NSCoder,
103 ) -> Option<Retained<Self>>;
104 );
105}
106
107#[cfg(feature = "objc2-app-kit")]
109#[cfg(target_os = "macos")]
110impl EXHostViewController {
111 extern_methods!(
112 #[unsafe(method(init))]
113 #[unsafe(method_family = init)]
114 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
115 );
116}
117
118#[cfg(feature = "objc2-app-kit")]
120#[cfg(target_os = "macos")]
121impl EXHostViewController {
122 extern_methods!(
123 #[unsafe(method(new))]
124 #[unsafe(method_family = new)]
125 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
126 );
127}
128
129extern_protocol!(
130 pub unsafe trait EXHostViewControllerDelegate:
134 NSObjectProtocol + MainThreadOnly
135 {
136 #[cfg(feature = "objc2-app-kit")]
137 #[cfg(target_os = "macos")]
138 #[optional]
148 #[unsafe(method(hostViewControllerDidActivate:))]
149 #[unsafe(method_family = none)]
150 unsafe fn hostViewControllerDidActivate(&self, view_controller: &EXHostViewController);
151
152 #[cfg(feature = "objc2-app-kit")]
153 #[cfg(target_os = "macos")]
154 #[optional]
167 #[unsafe(method(hostViewControllerWillDeactivate:error:))]
168 #[unsafe(method_family = none)]
169 unsafe fn hostViewControllerWillDeactivate_error(
170 &self,
171 view_controller: &EXHostViewController,
172 error: Option<&NSError>,
173 );
174 }
175);