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::*;
11use objc2_foundation::*;
12
13use crate::*;
14
15#[repr(transparent)]
26#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
27pub struct AVRoutePickerViewButtonState(pub NSInteger);
28impl AVRoutePickerViewButtonState {
29 #[doc(alias = "AVRoutePickerViewButtonStateNormal")]
30 pub const Normal: Self = Self(0);
31 #[doc(alias = "AVRoutePickerViewButtonStateNormalHighlighted")]
32 pub const NormalHighlighted: Self = Self(1);
33 #[doc(alias = "AVRoutePickerViewButtonStateActive")]
34 pub const Active: Self = Self(2);
35 #[doc(alias = "AVRoutePickerViewButtonStateActiveHighlighted")]
36 pub const ActiveHighlighted: Self = Self(3);
37}
38
39unsafe impl Encode for AVRoutePickerViewButtonState {
40 const ENCODING: Encoding = NSInteger::ENCODING;
41}
42
43unsafe impl RefEncode for AVRoutePickerViewButtonState {
44 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
45}
46
47#[repr(transparent)]
56#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
57pub struct AVRoutePickerViewButtonStyle(pub NSInteger);
58impl AVRoutePickerViewButtonStyle {
59 #[doc(alias = "AVRoutePickerViewButtonStyleSystem")]
60 pub const System: Self = Self(0);
61 #[doc(alias = "AVRoutePickerViewButtonStylePlain")]
62 pub const Plain: Self = Self(1);
63 #[doc(alias = "AVRoutePickerViewButtonStyleCustom")]
64 pub const Custom: Self = Self(2);
65}
66
67unsafe impl Encode for AVRoutePickerViewButtonStyle {
68 const ENCODING: Encoding = NSInteger::ENCODING;
69}
70
71unsafe impl RefEncode for AVRoutePickerViewButtonStyle {
72 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
73}
74
75extern_class!(
76 #[unsafe(super(NSView, NSResponder, NSObject))]
78 #[derive(Debug, PartialEq, Eq, Hash)]
79 #[cfg(feature = "objc2-app-kit")]
80 #[cfg(target_os = "macos")]
81 pub struct AVRoutePickerView;
82);
83
84#[cfg(feature = "objc2-app-kit")]
85#[cfg(target_os = "macos")]
86extern_conformance!(
87 unsafe impl NSAccessibility for AVRoutePickerView {}
88);
89
90#[cfg(feature = "objc2-app-kit")]
91#[cfg(target_os = "macos")]
92extern_conformance!(
93 unsafe impl NSAccessibilityElementProtocol for AVRoutePickerView {}
94);
95
96#[cfg(feature = "objc2-app-kit")]
97#[cfg(target_os = "macos")]
98extern_conformance!(
99 unsafe impl NSAnimatablePropertyContainer for AVRoutePickerView {}
100);
101
102#[cfg(feature = "objc2-app-kit")]
103#[cfg(target_os = "macos")]
104extern_conformance!(
105 unsafe impl NSAppearanceCustomization for AVRoutePickerView {}
106);
107
108#[cfg(feature = "objc2-app-kit")]
109#[cfg(target_os = "macos")]
110extern_conformance!(
111 unsafe impl NSCoding for AVRoutePickerView {}
112);
113
114#[cfg(feature = "objc2-app-kit")]
115#[cfg(target_os = "macos")]
116extern_conformance!(
117 unsafe impl NSDraggingDestination for AVRoutePickerView {}
118);
119
120#[cfg(feature = "objc2-app-kit")]
121#[cfg(target_os = "macos")]
122extern_conformance!(
123 unsafe impl NSObjectProtocol for AVRoutePickerView {}
124);
125
126#[cfg(feature = "objc2-app-kit")]
127#[cfg(target_os = "macos")]
128extern_conformance!(
129 unsafe impl NSUserInterfaceItemIdentification for AVRoutePickerView {}
130);
131
132#[cfg(feature = "objc2-app-kit")]
133#[cfg(target_os = "macos")]
134impl AVRoutePickerView {
135 extern_methods!(
136 #[unsafe(method(delegate))]
138 #[unsafe(method_family = none)]
139 pub unsafe fn delegate(
140 &self,
141 ) -> Option<Retained<ProtocolObject<dyn AVRoutePickerViewDelegate>>>;
142
143 #[unsafe(method(setDelegate:))]
146 #[unsafe(method_family = none)]
147 pub unsafe fn setDelegate(
148 &self,
149 delegate: Option<&ProtocolObject<dyn AVRoutePickerViewDelegate>>,
150 );
151
152 #[cfg(feature = "objc2-av-foundation")]
153 #[unsafe(method(player))]
155 #[unsafe(method_family = none)]
156 pub unsafe fn player(&self) -> Option<Retained<AVPlayer>>;
157
158 #[cfg(feature = "objc2-av-foundation")]
159 #[unsafe(method(setPlayer:))]
161 #[unsafe(method_family = none)]
162 pub unsafe fn setPlayer(&self, player: Option<&AVPlayer>);
163
164 #[unsafe(method(routePickerButtonColorForState:))]
168 #[unsafe(method_family = none)]
169 pub unsafe fn routePickerButtonColorForState(
170 &self,
171 state: AVRoutePickerViewButtonState,
172 ) -> Retained<NSColor>;
173
174 #[unsafe(method(setRoutePickerButtonColor:forState:))]
182 #[unsafe(method_family = none)]
183 pub unsafe fn setRoutePickerButtonColor_forState(
184 &self,
185 color: Option<&NSColor>,
186 state: AVRoutePickerViewButtonState,
187 );
188
189 #[unsafe(method(isRoutePickerButtonBordered))]
191 #[unsafe(method_family = none)]
192 pub unsafe fn isRoutePickerButtonBordered(&self) -> bool;
193
194 #[unsafe(method(setRoutePickerButtonBordered:))]
196 #[unsafe(method_family = none)]
197 pub unsafe fn setRoutePickerButtonBordered(&self, route_picker_button_bordered: bool);
198
199 #[unsafe(method(activeTintColor))]
201 #[unsafe(method_family = none)]
202 pub unsafe fn activeTintColor(&self) -> Option<Retained<NSColor>>;
203
204 #[unsafe(method(setActiveTintColor:))]
206 #[unsafe(method_family = none)]
207 pub unsafe fn setActiveTintColor(&self, active_tint_color: Option<&NSColor>);
208
209 #[unsafe(method(routePickerButtonStyle))]
211 #[unsafe(method_family = none)]
212 pub unsafe fn routePickerButtonStyle(&self) -> AVRoutePickerViewButtonStyle;
213
214 #[unsafe(method(setRoutePickerButtonStyle:))]
216 #[unsafe(method_family = none)]
217 pub unsafe fn setRoutePickerButtonStyle(
218 &self,
219 route_picker_button_style: AVRoutePickerViewButtonStyle,
220 );
221
222 #[unsafe(method(prioritizesVideoDevices))]
224 #[unsafe(method_family = none)]
225 pub unsafe fn prioritizesVideoDevices(&self) -> bool;
226
227 #[unsafe(method(setPrioritizesVideoDevices:))]
229 #[unsafe(method_family = none)]
230 pub unsafe fn setPrioritizesVideoDevices(&self, prioritizes_video_devices: bool);
231 );
232}
233
234#[cfg(feature = "objc2-app-kit")]
236#[cfg(target_os = "macos")]
237impl AVRoutePickerView {
238 extern_methods!(
239 #[unsafe(method(initWithFrame:))]
240 #[unsafe(method_family = init)]
241 pub unsafe fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;
242
243 #[unsafe(method(initWithCoder:))]
244 #[unsafe(method_family = init)]
245 pub unsafe fn initWithCoder(
246 this: Allocated<Self>,
247 coder: &NSCoder,
248 ) -> Option<Retained<Self>>;
249 );
250}
251
252#[cfg(feature = "objc2-app-kit")]
254#[cfg(target_os = "macos")]
255impl AVRoutePickerView {
256 extern_methods!(
257 #[unsafe(method(init))]
258 #[unsafe(method_family = init)]
259 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
260 );
261}
262
263#[cfg(feature = "objc2-app-kit")]
265#[cfg(target_os = "macos")]
266impl AVRoutePickerView {
267 extern_methods!(
268 #[unsafe(method(new))]
269 #[unsafe(method_family = new)]
270 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
271 );
272}
273
274extern_protocol!(
275 pub unsafe trait AVRoutePickerViewDelegate: NSObjectProtocol {
279 #[cfg(feature = "objc2-app-kit")]
280 #[cfg(target_os = "macos")]
281 #[optional]
283 #[unsafe(method(routePickerViewWillBeginPresentingRoutes:))]
284 #[unsafe(method_family = none)]
285 unsafe fn routePickerViewWillBeginPresentingRoutes(
286 &self,
287 route_picker_view: &AVRoutePickerView,
288 );
289
290 #[cfg(feature = "objc2-app-kit")]
291 #[cfg(target_os = "macos")]
292 #[optional]
294 #[unsafe(method(routePickerViewDidEndPresentingRoutes:))]
295 #[unsafe(method_family = none)]
296 unsafe fn routePickerViewDidEndPresentingRoutes(
297 &self,
298 route_picker_view: &AVRoutePickerView,
299 );
300 }
301);