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:))]
158 #[unsafe(method_family = none)]
159 pub unsafe fn setDelegate(
160 &self,
161 delegate: Option<&ProtocolObject<dyn AVCaptureViewDelegate>>,
162 );
163
164 #[unsafe(method(controlsStyle))]
166 #[unsafe(method_family = none)]
167 pub unsafe fn controlsStyle(&self) -> AVCaptureViewControlsStyle;
168
169 #[unsafe(method(setControlsStyle:))]
171 #[unsafe(method_family = none)]
172 pub unsafe fn setControlsStyle(&self, controls_style: AVCaptureViewControlsStyle);
173
174 #[cfg(feature = "objc2-av-foundation")]
175 #[unsafe(method(videoGravity))]
179 #[unsafe(method_family = none)]
180 pub unsafe fn videoGravity(&self) -> Retained<AVLayerVideoGravity>;
181
182 #[cfg(feature = "objc2-av-foundation")]
183 #[unsafe(method(setVideoGravity:))]
187 #[unsafe(method_family = none)]
188 pub unsafe fn setVideoGravity(&self, video_gravity: &AVLayerVideoGravity);
189 );
190}
191
192#[cfg(feature = "objc2-app-kit")]
194#[cfg(target_os = "macos")]
195impl AVCaptureView {
196 extern_methods!(
197 #[unsafe(method(initWithFrame:))]
198 #[unsafe(method_family = init)]
199 pub unsafe fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;
200
201 #[unsafe(method(initWithCoder:))]
205 #[unsafe(method_family = init)]
206 pub unsafe fn initWithCoder(
207 this: Allocated<Self>,
208 coder: &NSCoder,
209 ) -> Option<Retained<Self>>;
210 );
211}
212
213#[cfg(feature = "objc2-app-kit")]
215#[cfg(target_os = "macos")]
216impl AVCaptureView {
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#[cfg(feature = "objc2-app-kit")]
226#[cfg(target_os = "macos")]
227impl AVCaptureView {
228 extern_methods!(
229 #[unsafe(method(new))]
230 #[unsafe(method_family = new)]
231 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
232 );
233}
234
235extern_protocol!(
236 pub unsafe trait AVCaptureViewDelegate: NSObjectProtocol {
240 #[cfg(all(feature = "objc2-app-kit", feature = "objc2-av-foundation"))]
241 #[cfg(target_os = "macos")]
242 #[unsafe(method(captureView:startRecordingToFileOutput:))]
246 #[unsafe(method_family = none)]
247 unsafe fn captureView_startRecordingToFileOutput(
248 &self,
249 capture_view: &AVCaptureView,
250 file_output: &AVCaptureFileOutput,
251 );
252 }
253);