objc2_av_kit/generated/
AVRoutePickerView.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::*;
11#[cfg(feature = "objc2-av-routing")]
12#[cfg(not(any(target_os = "tvos", target_os = "watchos")))]
13use objc2_av_routing::*;
14use objc2_foundation::*;
15
16use crate::*;
17
18#[repr(transparent)]
29#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
30pub struct AVRoutePickerViewButtonState(pub NSInteger);
31impl AVRoutePickerViewButtonState {
32 #[doc(alias = "AVRoutePickerViewButtonStateNormal")]
33 pub const Normal: Self = Self(0);
34 #[doc(alias = "AVRoutePickerViewButtonStateNormalHighlighted")]
35 pub const NormalHighlighted: Self = Self(1);
36 #[doc(alias = "AVRoutePickerViewButtonStateActive")]
37 pub const Active: Self = Self(2);
38 #[doc(alias = "AVRoutePickerViewButtonStateActiveHighlighted")]
39 pub const ActiveHighlighted: Self = Self(3);
40}
41
42unsafe impl Encode for AVRoutePickerViewButtonState {
43 const ENCODING: Encoding = NSInteger::ENCODING;
44}
45
46unsafe impl RefEncode for AVRoutePickerViewButtonState {
47 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
48}
49
50#[repr(transparent)]
59#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
60pub struct AVRoutePickerViewButtonStyle(pub NSInteger);
61impl AVRoutePickerViewButtonStyle {
62 #[doc(alias = "AVRoutePickerViewButtonStyleSystem")]
63 pub const System: Self = Self(0);
64 #[doc(alias = "AVRoutePickerViewButtonStylePlain")]
65 pub const Plain: Self = Self(1);
66 #[doc(alias = "AVRoutePickerViewButtonStyleCustom")]
67 pub const Custom: Self = Self(2);
68}
69
70unsafe impl Encode for AVRoutePickerViewButtonStyle {
71 const ENCODING: Encoding = NSInteger::ENCODING;
72}
73
74unsafe impl RefEncode for AVRoutePickerViewButtonStyle {
75 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
76}
77
78extern_class!(
79 #[unsafe(super(NSView, NSResponder, NSObject))]
81 #[derive(Debug, PartialEq, Eq, Hash)]
82 #[cfg(feature = "objc2-app-kit")]
83 #[cfg(target_os = "macos")]
84 pub struct AVRoutePickerView;
85);
86
87#[cfg(feature = "objc2-app-kit")]
88#[cfg(target_os = "macos")]
89extern_conformance!(
90 unsafe impl NSAccessibility for AVRoutePickerView {}
91);
92
93#[cfg(feature = "objc2-app-kit")]
94#[cfg(target_os = "macos")]
95extern_conformance!(
96 unsafe impl NSAccessibilityElementProtocol for AVRoutePickerView {}
97);
98
99#[cfg(feature = "objc2-app-kit")]
100#[cfg(target_os = "macos")]
101extern_conformance!(
102 unsafe impl NSAnimatablePropertyContainer for AVRoutePickerView {}
103);
104
105#[cfg(feature = "objc2-app-kit")]
106#[cfg(target_os = "macos")]
107extern_conformance!(
108 unsafe impl NSAppearanceCustomization for AVRoutePickerView {}
109);
110
111#[cfg(feature = "objc2-app-kit")]
112#[cfg(target_os = "macos")]
113extern_conformance!(
114 unsafe impl NSCoding for AVRoutePickerView {}
115);
116
117#[cfg(feature = "objc2-app-kit")]
118#[cfg(target_os = "macos")]
119extern_conformance!(
120 unsafe impl NSDraggingDestination for AVRoutePickerView {}
121);
122
123#[cfg(feature = "objc2-app-kit")]
124#[cfg(target_os = "macos")]
125extern_conformance!(
126 unsafe impl NSObjectProtocol for AVRoutePickerView {}
127);
128
129#[cfg(feature = "objc2-app-kit")]
130#[cfg(target_os = "macos")]
131extern_conformance!(
132 unsafe impl NSUserInterfaceItemIdentification for AVRoutePickerView {}
133);
134
135#[cfg(feature = "objc2-app-kit")]
136#[cfg(target_os = "macos")]
137impl AVRoutePickerView {
138 extern_methods!(
139 #[unsafe(method(delegate))]
141 #[unsafe(method_family = none)]
142 pub unsafe fn delegate(
143 &self,
144 ) -> Option<Retained<ProtocolObject<dyn AVRoutePickerViewDelegate>>>;
145
146 #[unsafe(method(setDelegate:))]
150 #[unsafe(method_family = none)]
151 pub unsafe fn setDelegate(
152 &self,
153 delegate: Option<&ProtocolObject<dyn AVRoutePickerViewDelegate>>,
154 );
155
156 #[cfg(feature = "objc2-av-foundation")]
157 #[unsafe(method(player))]
159 #[unsafe(method_family = none)]
160 pub unsafe fn player(&self) -> Option<Retained<AVPlayer>>;
161
162 #[cfg(feature = "objc2-av-foundation")]
163 #[unsafe(method(setPlayer:))]
165 #[unsafe(method_family = none)]
166 pub unsafe fn setPlayer(&self, player: Option<&AVPlayer>);
167
168 #[unsafe(method(routePickerButtonColorForState:))]
172 #[unsafe(method_family = none)]
173 pub unsafe fn routePickerButtonColorForState(
174 &self,
175 state: AVRoutePickerViewButtonState,
176 ) -> Retained<NSColor>;
177
178 #[unsafe(method(setRoutePickerButtonColor:forState:))]
186 #[unsafe(method_family = none)]
187 pub unsafe fn setRoutePickerButtonColor_forState(
188 &self,
189 color: Option<&NSColor>,
190 state: AVRoutePickerViewButtonState,
191 );
192
193 #[unsafe(method(isRoutePickerButtonBordered))]
195 #[unsafe(method_family = none)]
196 pub unsafe fn isRoutePickerButtonBordered(&self) -> bool;
197
198 #[unsafe(method(setRoutePickerButtonBordered:))]
200 #[unsafe(method_family = none)]
201 pub unsafe fn setRoutePickerButtonBordered(&self, route_picker_button_bordered: bool);
202
203 #[unsafe(method(activeTintColor))]
205 #[unsafe(method_family = none)]
206 pub unsafe fn activeTintColor(&self) -> Option<Retained<NSColor>>;
207
208 #[unsafe(method(setActiveTintColor:))]
214 #[unsafe(method_family = none)]
215 pub unsafe fn setActiveTintColor(&self, active_tint_color: Option<&NSColor>);
216
217 #[unsafe(method(routePickerButtonStyle))]
219 #[unsafe(method_family = none)]
220 pub unsafe fn routePickerButtonStyle(&self) -> AVRoutePickerViewButtonStyle;
221
222 #[unsafe(method(setRoutePickerButtonStyle:))]
224 #[unsafe(method_family = none)]
225 pub unsafe fn setRoutePickerButtonStyle(
226 &self,
227 route_picker_button_style: AVRoutePickerViewButtonStyle,
228 );
229
230 #[unsafe(method(prioritizesVideoDevices))]
232 #[unsafe(method_family = none)]
233 pub unsafe fn prioritizesVideoDevices(&self) -> bool;
234
235 #[unsafe(method(setPrioritizesVideoDevices:))]
237 #[unsafe(method_family = none)]
238 pub unsafe fn setPrioritizesVideoDevices(&self, prioritizes_video_devices: bool);
239
240 #[cfg(feature = "objc2-av-routing")]
241 #[unsafe(method(customRoutingController))]
243 #[unsafe(method_family = none)]
244 pub unsafe fn customRoutingController(&self)
245 -> Option<Retained<AVCustomRoutingController>>;
246
247 #[cfg(feature = "objc2-av-routing")]
248 #[unsafe(method(setCustomRoutingController:))]
250 #[unsafe(method_family = none)]
251 pub unsafe fn setCustomRoutingController(
252 &self,
253 custom_routing_controller: Option<&AVCustomRoutingController>,
254 );
255 );
256}
257
258#[cfg(feature = "objc2-app-kit")]
260#[cfg(target_os = "macos")]
261impl AVRoutePickerView {
262 extern_methods!(
263 #[unsafe(method(initWithFrame:))]
264 #[unsafe(method_family = init)]
265 pub unsafe fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;
266
267 #[unsafe(method(initWithCoder:))]
271 #[unsafe(method_family = init)]
272 pub unsafe fn initWithCoder(
273 this: Allocated<Self>,
274 coder: &NSCoder,
275 ) -> Option<Retained<Self>>;
276 );
277}
278
279#[cfg(feature = "objc2-app-kit")]
281#[cfg(target_os = "macos")]
282impl AVRoutePickerView {
283 extern_methods!(
284 #[unsafe(method(init))]
285 #[unsafe(method_family = init)]
286 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
287 );
288}
289
290#[cfg(feature = "objc2-app-kit")]
292#[cfg(target_os = "macos")]
293impl AVRoutePickerView {
294 extern_methods!(
295 #[unsafe(method(new))]
296 #[unsafe(method_family = new)]
297 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
298 );
299}
300
301extern_protocol!(
302 pub unsafe trait AVRoutePickerViewDelegate: NSObjectProtocol {
306 #[cfg(feature = "objc2-app-kit")]
307 #[cfg(target_os = "macos")]
308 #[optional]
310 #[unsafe(method(routePickerViewWillBeginPresentingRoutes:))]
311 #[unsafe(method_family = none)]
312 unsafe fn routePickerViewWillBeginPresentingRoutes(
313 &self,
314 route_picker_view: &AVRoutePickerView,
315 );
316
317 #[cfg(feature = "objc2-app-kit")]
318 #[cfg(target_os = "macos")]
319 #[optional]
321 #[unsafe(method(routePickerViewDidEndPresentingRoutes:))]
322 #[unsafe(method_family = none)]
323 unsafe fn routePickerViewDidEndPresentingRoutes(
324 &self,
325 route_picker_view: &AVRoutePickerView,
326 );
327 }
328);