objc2_av_kit/generated/
AVCaptureView.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::*;
9#[cfg(feature = "objc2-av-foundation")]
10use objc2_av_foundation::*;
11use objc2_foundation::*;
12
13use crate::*;
14
15#[repr(transparent)]
26#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
27pub struct AVCaptureViewControlsStyle(pub NSInteger);
28impl AVCaptureViewControlsStyle {
29 #[doc(alias = "AVCaptureViewControlsStyleInline")]
30 pub const Inline: Self = Self(0);
31 #[doc(alias = "AVCaptureViewControlsStyleFloating")]
32 pub const Floating: Self = Self(1);
33 #[doc(alias = "AVCaptureViewControlsStyleInlineDeviceSelection")]
34 pub const InlineDeviceSelection: Self = Self(2);
35 #[doc(alias = "AVCaptureViewControlsStyleDefault")]
36 pub const Default: Self = Self(AVCaptureViewControlsStyle::Inline.0);
37}
38
39unsafe impl Encode for AVCaptureViewControlsStyle {
40 const ENCODING: Encoding = NSInteger::ENCODING;
41}
42
43unsafe impl RefEncode for AVCaptureViewControlsStyle {
44 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
45}
46
47extern_class!(
48 #[unsafe(super(NSView, NSResponder, NSObject))]
52 #[derive(Debug, PartialEq, Eq, Hash)]
53 #[cfg(feature = "objc2-app-kit")]
54 #[cfg(target_os = "macos")]
55 pub struct AVCaptureView;
56);
57
58#[cfg(feature = "objc2-app-kit")]
59#[cfg(target_os = "macos")]
60extern_conformance!(
61 unsafe impl NSAccessibility for AVCaptureView {}
62);
63
64#[cfg(feature = "objc2-app-kit")]
65#[cfg(target_os = "macos")]
66extern_conformance!(
67 unsafe impl NSAccessibilityElementProtocol for AVCaptureView {}
68);
69
70#[cfg(feature = "objc2-app-kit")]
71#[cfg(target_os = "macos")]
72extern_conformance!(
73 unsafe impl NSAnimatablePropertyContainer for AVCaptureView {}
74);
75
76#[cfg(feature = "objc2-app-kit")]
77#[cfg(target_os = "macos")]
78extern_conformance!(
79 unsafe impl NSAppearanceCustomization for AVCaptureView {}
80);
81
82#[cfg(feature = "objc2-app-kit")]
83#[cfg(target_os = "macos")]
84extern_conformance!(
85 unsafe impl NSCoding for AVCaptureView {}
86);
87
88#[cfg(feature = "objc2-app-kit")]
89#[cfg(target_os = "macos")]
90extern_conformance!(
91 unsafe impl NSDraggingDestination for AVCaptureView {}
92);
93
94#[cfg(feature = "objc2-app-kit")]
95#[cfg(target_os = "macos")]
96extern_conformance!(
97 unsafe impl NSObjectProtocol for AVCaptureView {}
98);
99
100#[cfg(feature = "objc2-app-kit")]
101#[cfg(target_os = "macos")]
102extern_conformance!(
103 unsafe impl NSUserInterfaceItemIdentification for AVCaptureView {}
104);
105
106#[cfg(feature = "objc2-app-kit")]
107#[cfg(target_os = "macos")]
108impl AVCaptureView {
109 extern_methods!(
110 #[cfg(feature = "objc2-av-foundation")]
111 #[unsafe(method(session))]
115 #[unsafe(method_family = none)]
116 pub unsafe fn session(&self) -> Option<Retained<AVCaptureSession>>;
117
118 #[cfg(feature = "objc2-av-foundation")]
119 #[unsafe(method(setSession:showVideoPreview:showAudioPreview:))]
129 #[unsafe(method_family = none)]
130 pub unsafe fn setSession_showVideoPreview_showAudioPreview(
131 &self,
132 session: Option<&AVCaptureSession>,
133 show_video_preview: bool,
134 show_audio_preview: bool,
135 );
136
137 #[cfg(feature = "objc2-av-foundation")]
138 #[unsafe(method(fileOutput))]
142 #[unsafe(method_family = none)]
143 pub unsafe fn fileOutput(&self) -> Option<Retained<AVCaptureFileOutput>>;
144
145 #[unsafe(method(delegate))]
149 #[unsafe(method_family = none)]
150 pub unsafe fn delegate(
151 &self,
152 ) -> Option<Retained<ProtocolObject<dyn AVCaptureViewDelegate>>>;
153
154 #[unsafe(method(setDelegate:))]
157 #[unsafe(method_family = none)]
158 pub unsafe fn setDelegate(
159 &self,
160 delegate: Option<&ProtocolObject<dyn AVCaptureViewDelegate>>,
161 );
162
163 #[unsafe(method(controlsStyle))]
165 #[unsafe(method_family = none)]
166 pub unsafe fn controlsStyle(&self) -> AVCaptureViewControlsStyle;
167
168 #[unsafe(method(setControlsStyle:))]
170 #[unsafe(method_family = none)]
171 pub unsafe fn setControlsStyle(&self, controls_style: AVCaptureViewControlsStyle);
172
173 #[cfg(feature = "objc2-av-foundation")]
174 #[unsafe(method(videoGravity))]
178 #[unsafe(method_family = none)]
179 pub unsafe fn videoGravity(&self) -> Retained<AVLayerVideoGravity>;
180
181 #[cfg(feature = "objc2-av-foundation")]
182 #[unsafe(method(setVideoGravity:))]
184 #[unsafe(method_family = none)]
185 pub unsafe fn setVideoGravity(&self, video_gravity: &AVLayerVideoGravity);
186 );
187}
188
189#[cfg(feature = "objc2-app-kit")]
191#[cfg(target_os = "macos")]
192impl AVCaptureView {
193 extern_methods!(
194 #[unsafe(method(initWithFrame:))]
195 #[unsafe(method_family = init)]
196 pub unsafe fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;
197
198 #[unsafe(method(initWithCoder:))]
199 #[unsafe(method_family = init)]
200 pub unsafe fn initWithCoder(
201 this: Allocated<Self>,
202 coder: &NSCoder,
203 ) -> Option<Retained<Self>>;
204 );
205}
206
207#[cfg(feature = "objc2-app-kit")]
209#[cfg(target_os = "macos")]
210impl AVCaptureView {
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#[cfg(feature = "objc2-app-kit")]
220#[cfg(target_os = "macos")]
221impl AVCaptureView {
222 extern_methods!(
223 #[unsafe(method(new))]
224 #[unsafe(method_family = new)]
225 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
226 );
227}
228
229extern_protocol!(
230 pub unsafe trait AVCaptureViewDelegate: NSObjectProtocol {
234 #[cfg(all(feature = "objc2-app-kit", feature = "objc2-av-foundation"))]
235 #[cfg(target_os = "macos")]
236 #[unsafe(method(captureView:startRecordingToFileOutput:))]
240 #[unsafe(method_family = none)]
241 unsafe fn captureView_startRecordingToFileOutput(
242 &self,
243 capture_view: &AVCaptureView,
244 file_output: &AVCaptureFileOutput,
245 );
246 }
247);