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")]
86unsafe impl NSAccessibility for AVRoutePickerView {}
87
88#[cfg(feature = "objc2-app-kit")]
89#[cfg(target_os = "macos")]
90unsafe impl NSAccessibilityElementProtocol for AVRoutePickerView {}
91
92#[cfg(feature = "objc2-app-kit")]
93#[cfg(target_os = "macos")]
94unsafe impl NSAnimatablePropertyContainer for AVRoutePickerView {}
95
96#[cfg(feature = "objc2-app-kit")]
97#[cfg(target_os = "macos")]
98unsafe impl NSAppearanceCustomization for AVRoutePickerView {}
99
100#[cfg(feature = "objc2-app-kit")]
101#[cfg(target_os = "macos")]
102unsafe impl NSCoding for AVRoutePickerView {}
103
104#[cfg(feature = "objc2-app-kit")]
105#[cfg(target_os = "macos")]
106unsafe impl NSDraggingDestination for AVRoutePickerView {}
107
108#[cfg(feature = "objc2-app-kit")]
109#[cfg(target_os = "macos")]
110unsafe impl NSObjectProtocol for AVRoutePickerView {}
111
112#[cfg(feature = "objc2-app-kit")]
113#[cfg(target_os = "macos")]
114unsafe impl NSUserInterfaceItemIdentification for AVRoutePickerView {}
115
116#[cfg(feature = "objc2-app-kit")]
117#[cfg(target_os = "macos")]
118impl AVRoutePickerView {
119 extern_methods!(
120 #[unsafe(method(delegate))]
122 #[unsafe(method_family = none)]
123 pub unsafe fn delegate(
124 &self,
125 ) -> Option<Retained<ProtocolObject<dyn AVRoutePickerViewDelegate>>>;
126
127 #[unsafe(method(setDelegate:))]
130 #[unsafe(method_family = none)]
131 pub unsafe fn setDelegate(
132 &self,
133 delegate: Option<&ProtocolObject<dyn AVRoutePickerViewDelegate>>,
134 );
135
136 #[cfg(feature = "objc2-av-foundation")]
137 #[unsafe(method(player))]
139 #[unsafe(method_family = none)]
140 pub unsafe fn player(&self) -> Option<Retained<AVPlayer>>;
141
142 #[cfg(feature = "objc2-av-foundation")]
143 #[unsafe(method(setPlayer:))]
145 #[unsafe(method_family = none)]
146 pub unsafe fn setPlayer(&self, player: Option<&AVPlayer>);
147
148 #[unsafe(method(routePickerButtonColorForState:))]
152 #[unsafe(method_family = none)]
153 pub unsafe fn routePickerButtonColorForState(
154 &self,
155 state: AVRoutePickerViewButtonState,
156 ) -> Retained<NSColor>;
157
158 #[unsafe(method(setRoutePickerButtonColor:forState:))]
166 #[unsafe(method_family = none)]
167 pub unsafe fn setRoutePickerButtonColor_forState(
168 &self,
169 color: Option<&NSColor>,
170 state: AVRoutePickerViewButtonState,
171 );
172
173 #[unsafe(method(isRoutePickerButtonBordered))]
175 #[unsafe(method_family = none)]
176 pub unsafe fn isRoutePickerButtonBordered(&self) -> bool;
177
178 #[unsafe(method(setRoutePickerButtonBordered:))]
180 #[unsafe(method_family = none)]
181 pub unsafe fn setRoutePickerButtonBordered(&self, route_picker_button_bordered: bool);
182
183 #[unsafe(method(activeTintColor))]
185 #[unsafe(method_family = none)]
186 pub unsafe fn activeTintColor(&self) -> Option<Retained<NSColor>>;
187
188 #[unsafe(method(setActiveTintColor:))]
190 #[unsafe(method_family = none)]
191 pub unsafe fn setActiveTintColor(&self, active_tint_color: Option<&NSColor>);
192
193 #[unsafe(method(routePickerButtonStyle))]
195 #[unsafe(method_family = none)]
196 pub unsafe fn routePickerButtonStyle(&self) -> AVRoutePickerViewButtonStyle;
197
198 #[unsafe(method(setRoutePickerButtonStyle:))]
200 #[unsafe(method_family = none)]
201 pub unsafe fn setRoutePickerButtonStyle(
202 &self,
203 route_picker_button_style: AVRoutePickerViewButtonStyle,
204 );
205
206 #[unsafe(method(prioritizesVideoDevices))]
208 #[unsafe(method_family = none)]
209 pub unsafe fn prioritizesVideoDevices(&self) -> bool;
210
211 #[unsafe(method(setPrioritizesVideoDevices:))]
213 #[unsafe(method_family = none)]
214 pub unsafe fn setPrioritizesVideoDevices(&self, prioritizes_video_devices: bool);
215 );
216}
217
218#[cfg(feature = "objc2-app-kit")]
220#[cfg(target_os = "macos")]
221impl AVRoutePickerView {
222 extern_methods!(
223 #[unsafe(method(initWithFrame:))]
224 #[unsafe(method_family = init)]
225 pub unsafe fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;
226
227 #[unsafe(method(initWithCoder:))]
228 #[unsafe(method_family = init)]
229 pub unsafe fn initWithCoder(
230 this: Allocated<Self>,
231 coder: &NSCoder,
232 ) -> Option<Retained<Self>>;
233 );
234}
235
236#[cfg(feature = "objc2-app-kit")]
238#[cfg(target_os = "macos")]
239impl AVRoutePickerView {
240 extern_methods!(
241 #[unsafe(method(init))]
242 #[unsafe(method_family = init)]
243 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
244 );
245}
246
247#[cfg(feature = "objc2-app-kit")]
249#[cfg(target_os = "macos")]
250impl AVRoutePickerView {
251 extern_methods!(
252 #[unsafe(method(new))]
253 #[unsafe(method_family = new)]
254 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
255 );
256}
257
258extern_protocol!(
259 pub unsafe trait AVRoutePickerViewDelegate: NSObjectProtocol {
263 #[cfg(feature = "objc2-app-kit")]
264 #[cfg(target_os = "macos")]
265 #[optional]
267 #[unsafe(method(routePickerViewWillBeginPresentingRoutes:))]
268 #[unsafe(method_family = none)]
269 unsafe fn routePickerViewWillBeginPresentingRoutes(
270 &self,
271 route_picker_view: &AVRoutePickerView,
272 );
273
274 #[cfg(feature = "objc2-app-kit")]
275 #[cfg(target_os = "macos")]
276 #[optional]
278 #[unsafe(method(routePickerViewDidEndPresentingRoutes:))]
279 #[unsafe(method_family = none)]
280 unsafe fn routePickerViewDidEndPresentingRoutes(
281 &self,
282 route_picker_view: &AVRoutePickerView,
283 );
284 }
285);