use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
use objc2_app_kit::*;
#[cfg(feature = "objc2-av-foundation")]
use objc2_av_foundation::*;
#[cfg(feature = "objc2-av-routing")]
#[cfg(not(any(target_os = "tvos", target_os = "watchos")))]
use objc2_av_routing::*;
use objc2_foundation::*;
use crate::*;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct AVRoutePickerViewButtonState(pub NSInteger);
impl AVRoutePickerViewButtonState {
#[doc(alias = "AVRoutePickerViewButtonStateNormal")]
pub const Normal: Self = Self(0);
#[doc(alias = "AVRoutePickerViewButtonStateNormalHighlighted")]
pub const NormalHighlighted: Self = Self(1);
#[doc(alias = "AVRoutePickerViewButtonStateActive")]
pub const Active: Self = Self(2);
#[doc(alias = "AVRoutePickerViewButtonStateActiveHighlighted")]
pub const ActiveHighlighted: Self = Self(3);
}
unsafe impl Encode for AVRoutePickerViewButtonState {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for AVRoutePickerViewButtonState {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct AVRoutePickerViewButtonStyle(pub NSInteger);
impl AVRoutePickerViewButtonStyle {
#[doc(alias = "AVRoutePickerViewButtonStyleSystem")]
pub const System: Self = Self(0);
#[doc(alias = "AVRoutePickerViewButtonStylePlain")]
pub const Plain: Self = Self(1);
#[doc(alias = "AVRoutePickerViewButtonStyleCustom")]
pub const Custom: Self = Self(2);
}
unsafe impl Encode for AVRoutePickerViewButtonStyle {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for AVRoutePickerViewButtonStyle {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(NSView, NSResponder, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
pub struct AVRoutePickerView;
);
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl NSAccessibility for AVRoutePickerView {}
);
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl NSAccessibilityElementProtocol for AVRoutePickerView {}
);
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl NSAnimatablePropertyContainer for AVRoutePickerView {}
);
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl NSAppearanceCustomization for AVRoutePickerView {}
);
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl NSCoding for AVRoutePickerView {}
);
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl NSDraggingDestination for AVRoutePickerView {}
);
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl NSObjectProtocol for AVRoutePickerView {}
);
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl NSUserInterfaceItemIdentification for AVRoutePickerView {}
);
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
impl AVRoutePickerView {
extern_methods!(
#[unsafe(method(delegate))]
#[unsafe(method_family = none)]
pub unsafe fn delegate(
&self,
) -> Option<Retained<ProtocolObject<dyn AVRoutePickerViewDelegate>>>;
#[unsafe(method(setDelegate:))]
#[unsafe(method_family = none)]
pub unsafe fn setDelegate(
&self,
delegate: Option<&ProtocolObject<dyn AVRoutePickerViewDelegate>>,
);
#[cfg(feature = "objc2-av-foundation")]
#[unsafe(method(player))]
#[unsafe(method_family = none)]
pub unsafe fn player(&self) -> Option<Retained<AVPlayer>>;
#[cfg(feature = "objc2-av-foundation")]
#[unsafe(method(setPlayer:))]
#[unsafe(method_family = none)]
pub unsafe fn setPlayer(&self, player: Option<&AVPlayer>);
#[unsafe(method(routePickerButtonColorForState:))]
#[unsafe(method_family = none)]
pub unsafe fn routePickerButtonColorForState(
&self,
state: AVRoutePickerViewButtonState,
) -> Retained<NSColor>;
#[unsafe(method(setRoutePickerButtonColor:forState:))]
#[unsafe(method_family = none)]
pub unsafe fn setRoutePickerButtonColor_forState(
&self,
color: Option<&NSColor>,
state: AVRoutePickerViewButtonState,
);
#[unsafe(method(isRoutePickerButtonBordered))]
#[unsafe(method_family = none)]
pub unsafe fn isRoutePickerButtonBordered(&self) -> bool;
#[unsafe(method(setRoutePickerButtonBordered:))]
#[unsafe(method_family = none)]
pub unsafe fn setRoutePickerButtonBordered(&self, route_picker_button_bordered: bool);
#[unsafe(method(activeTintColor))]
#[unsafe(method_family = none)]
pub unsafe fn activeTintColor(&self) -> Option<Retained<NSColor>>;
#[unsafe(method(setActiveTintColor:))]
#[unsafe(method_family = none)]
pub unsafe fn setActiveTintColor(&self, active_tint_color: Option<&NSColor>);
#[unsafe(method(routePickerButtonStyle))]
#[unsafe(method_family = none)]
pub unsafe fn routePickerButtonStyle(&self) -> AVRoutePickerViewButtonStyle;
#[unsafe(method(setRoutePickerButtonStyle:))]
#[unsafe(method_family = none)]
pub unsafe fn setRoutePickerButtonStyle(
&self,
route_picker_button_style: AVRoutePickerViewButtonStyle,
);
#[unsafe(method(prioritizesVideoDevices))]
#[unsafe(method_family = none)]
pub unsafe fn prioritizesVideoDevices(&self) -> bool;
#[unsafe(method(setPrioritizesVideoDevices:))]
#[unsafe(method_family = none)]
pub unsafe fn setPrioritizesVideoDevices(&self, prioritizes_video_devices: bool);
#[cfg(feature = "objc2-av-routing")]
#[unsafe(method(customRoutingController))]
#[unsafe(method_family = none)]
pub unsafe fn customRoutingController(&self)
-> Option<Retained<AVCustomRoutingController>>;
#[cfg(feature = "objc2-av-routing")]
#[unsafe(method(setCustomRoutingController:))]
#[unsafe(method_family = none)]
pub unsafe fn setCustomRoutingController(
&self,
custom_routing_controller: Option<&AVCustomRoutingController>,
);
);
}
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
impl AVRoutePickerView {
extern_methods!(
#[unsafe(method(initWithFrame:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;
#[unsafe(method(initWithCoder:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
coder: &NSCoder,
) -> Option<Retained<Self>>;
);
}
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
impl AVRoutePickerView {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
);
}
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
impl AVRoutePickerView {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
);
}
extern_protocol!(
pub unsafe trait AVRoutePickerViewDelegate: NSObjectProtocol {
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
#[optional]
#[unsafe(method(routePickerViewWillBeginPresentingRoutes:))]
#[unsafe(method_family = none)]
unsafe fn routePickerViewWillBeginPresentingRoutes(
&self,
route_picker_view: &AVRoutePickerView,
);
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
#[optional]
#[unsafe(method(routePickerViewDidEndPresentingRoutes:))]
#[unsafe(method_family = none)]
unsafe fn routePickerViewDidEndPresentingRoutes(
&self,
route_picker_view: &AVRoutePickerView,
);
}
);