use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-av-foundation")]
use objc2_av_foundation::*;
use objc2_foundation::*;
#[cfg(feature = "objc2-javascript-core")]
use objc2_javascript_core::*;
use crate::*;
#[deprecated = "Please use SwiftUI or UIKit"]
pub type TVPlaybackEvent = NSString;
#[deprecated = "Please use SwiftUI or UIKit"]
pub type TVMediaItemType = NSString;
#[deprecated = "Please use SwiftUI or UIKit"]
pub type TVPlaybackEventProperty = NSString;
extern "C" {
#[deprecated = "Please use SwiftUI or UIKit"]
pub static TVMediaItemTypeVideo: &'static TVMediaItemType;
}
extern "C" {
#[deprecated = "Please use SwiftUI or UIKit"]
pub static TVMediaItemTypeAudio: &'static TVMediaItemType;
}
#[deprecated = "Please use SwiftUI or UIKit"]
pub type TVMediaItemContentRatingDomain = NSString;
extern "C" {
#[deprecated = "Please use SwiftUI or UIKit"]
pub static TVMediaItemContentRatingDomainMovie: &'static TVMediaItemContentRatingDomain;
}
extern "C" {
#[deprecated = "Please use SwiftUI or UIKit"]
pub static TVMediaItemContentRatingDomainTVShow: &'static TVMediaItemContentRatingDomain;
}
extern "C" {
#[deprecated = "Please use SwiftUI or UIKit"]
pub static TVMediaItemContentRatingDomainMusic: &'static TVMediaItemContentRatingDomain;
}
#[deprecated = "Please use SwiftUI or UIKit"]
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct TVPlaybackState(pub NSInteger);
impl TVPlaybackState {
#[doc(alias = "TVPlaybackStateUndefined")]
#[deprecated = "Please use SwiftUI or UIKit"]
pub const Undefined: Self = Self(0);
#[doc(alias = "TVPlaybackStateBegin")]
#[deprecated = "Please use SwiftUI or UIKit"]
pub const Begin: Self = Self(1);
#[doc(alias = "TVPlaybackStateLoading")]
#[deprecated = "Please use SwiftUI or UIKit"]
pub const Loading: Self = Self(2);
#[doc(alias = "TVPlaybackStatePlaying")]
#[deprecated = "Please use SwiftUI or UIKit"]
pub const Playing: Self = Self(3);
#[doc(alias = "TVPlaybackStatePaused")]
#[deprecated = "Please use SwiftUI or UIKit"]
pub const Paused: Self = Self(4);
#[doc(alias = "TVPlaybackStateScanning")]
#[deprecated = "Please use SwiftUI or UIKit"]
pub const Scanning: Self = Self(5);
#[doc(alias = "TVPlaybackStateFastForwarding")]
#[deprecated = "Please use SwiftUI or UIKit"]
pub const FastForwarding: Self = Self(6);
#[doc(alias = "TVPlaybackStateRewinding")]
#[deprecated = "Please use SwiftUI or UIKit"]
pub const Rewinding: Self = Self(7);
#[doc(alias = "TVPlaybackStateEnd")]
#[deprecated = "Please use SwiftUI or UIKit"]
pub const End: Self = Self(8);
}
unsafe impl Encode for TVPlaybackState {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for TVPlaybackState {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[deprecated = "Please use SwiftUI or UIKit"]
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct TVPlaylistRepeatMode(pub NSInteger);
impl TVPlaylistRepeatMode {
#[doc(alias = "TVPlaylistRepeatModeNone")]
#[deprecated = "Please use SwiftUI or UIKit"]
pub const None: Self = Self(0);
#[doc(alias = "TVPlaylistRepeatModeAll")]
#[deprecated = "Please use SwiftUI or UIKit"]
pub const All: Self = Self(1);
#[doc(alias = "TVPlaylistRepeatModeOne")]
#[deprecated = "Please use SwiftUI or UIKit"]
pub const One: Self = Self(2);
}
unsafe impl Encode for TVPlaylistRepeatMode {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for TVPlaylistRepeatMode {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[deprecated = "Please use SwiftUI or UIKit"]
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct TVPlaylistEndAction(pub NSInteger);
impl TVPlaylistEndAction {
#[doc(alias = "TVPlaylistEndActionStop")]
#[deprecated = "Please use SwiftUI or UIKit"]
pub const Stop: Self = Self(0);
#[doc(alias = "TVPlaylistEndActionPause")]
#[deprecated = "Please use SwiftUI or UIKit"]
pub const Pause: Self = Self(1);
#[doc(alias = "TVPlaylistEndActionWaitForMoreItems")]
#[deprecated = "Please use SwiftUI or UIKit"]
pub const WaitForMoreItems: Self = Self(2);
}
unsafe impl Encode for TVPlaylistEndAction {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for TVPlaylistEndAction {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_protocol!(
#[deprecated = "Please use SwiftUI or UIKit"]
pub unsafe trait TVPlaybackEventMarshaling: NSObjectProtocol {
#[deprecated = "Please use SwiftUI or UIKit"]
#[unsafe(method(properties))]
#[unsafe(method_family = none)]
unsafe fn properties(
&self,
) -> Option<Retained<NSDictionary<TVPlaybackEventProperty, AnyObject>>>;
#[cfg(feature = "objc2-javascript-core")]
#[deprecated = "Please use SwiftUI or UIKit"]
#[optional]
#[unsafe(method(processReturnJSValue:inContext:))]
#[unsafe(method_family = none)]
unsafe fn processReturnJSValue_inContext(&self, value: &JSValue, js_context: &JSContext);
}
);
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[deprecated = "Please use SwiftUI or UIKit"]
pub struct TVPlaybackCustomEventUserInfo;
);
extern_conformance!(
unsafe impl NSObjectProtocol for TVPlaybackCustomEventUserInfo {}
);
extern_conformance!(
unsafe impl TVPlaybackEventMarshaling for TVPlaybackCustomEventUserInfo {}
);
impl TVPlaybackCustomEventUserInfo {
extern_methods!(
#[deprecated = "Please use SwiftUI or UIKit"]
#[unsafe(method(initWithProperties:expectsReturnValue:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithProperties_expectsReturnValue(
this: Allocated<Self>,
properties: Option<&NSDictionary<TVPlaybackEventProperty, AnyObject>>,
expects_return_value: bool,
) -> Retained<Self>;
#[deprecated = "Please use SwiftUI or UIKit"]
#[unsafe(method(expectsReturnValue))]
#[unsafe(method_family = none)]
pub unsafe fn expectsReturnValue(&self) -> bool;
#[deprecated = "Please use SwiftUI or UIKit"]
#[unsafe(method(setExpectsReturnValue:))]
#[unsafe(method_family = none)]
pub unsafe fn setExpectsReturnValue(&self, expects_return_value: bool);
#[deprecated = "Please use SwiftUI or UIKit"]
#[unsafe(method(returnValue))]
#[unsafe(method_family = none)]
pub unsafe fn returnValue(&self) -> Option<Retained<AnyObject>>;
);
}
impl TVPlaybackCustomEventUserInfo {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[deprecated = "Please use SwiftUI or UIKit"]
pub struct TVPlaylist;
);
extern_conformance!(
unsafe impl NSObjectProtocol for TVPlaylist {}
);
impl TVPlaylist {
extern_methods!(
#[deprecated = "Please use SwiftUI or UIKit"]
#[unsafe(method(mediaItems))]
#[unsafe(method_family = none)]
pub unsafe fn mediaItems(&self) -> Retained<NSArray<TVMediaItem>>;
#[deprecated = "Please use SwiftUI or UIKit"]
#[unsafe(method(endAction))]
#[unsafe(method_family = none)]
pub unsafe fn endAction(&self) -> TVPlaylistEndAction;
#[deprecated = "Please use SwiftUI or UIKit"]
#[unsafe(method(repeatMode))]
#[unsafe(method_family = none)]
pub unsafe fn repeatMode(&self) -> TVPlaylistRepeatMode;
#[deprecated = "Please use SwiftUI or UIKit"]
#[unsafe(method(userInfo))]
#[unsafe(method_family = none)]
pub unsafe fn userInfo(&self) -> Option<Retained<NSDictionary<NSString, AnyObject>>>;
);
}
impl TVPlaylist {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[deprecated = "Please use SwiftUI or UIKit"]
pub struct TVMediaItem;
);
extern_conformance!(
unsafe impl NSObjectProtocol for TVMediaItem {}
);
impl TVMediaItem {
extern_methods!(
#[deprecated = "Please use SwiftUI or UIKit"]
#[unsafe(method(type))]
#[unsafe(method_family = none)]
pub unsafe fn r#type(&self) -> Option<Retained<TVMediaItemType>>;
#[deprecated = "Please use SwiftUI or UIKit"]
#[unsafe(method(url))]
#[unsafe(method_family = none)]
pub unsafe fn url(&self) -> Option<Retained<NSURL>>;
#[deprecated = "Please use SwiftUI or UIKit"]
#[unsafe(method(title))]
#[unsafe(method_family = none)]
pub unsafe fn title(&self) -> Option<Retained<NSString>>;
#[deprecated = "Please use SwiftUI or UIKit"]
#[unsafe(method(subtitle))]
#[unsafe(method_family = none)]
pub unsafe fn subtitle(&self) -> Option<Retained<NSString>>;
#[deprecated = "Please use SwiftUI or UIKit"]
#[unsafe(method(itemDescription))]
#[unsafe(method_family = none)]
pub unsafe fn itemDescription(&self) -> Option<Retained<NSString>>;
#[deprecated = "Please use SwiftUI or UIKit"]
#[unsafe(method(contentRatingDomain))]
#[unsafe(method_family = none)]
pub unsafe fn contentRatingDomain(
&self,
) -> Option<Retained<TVMediaItemContentRatingDomain>>;
#[deprecated = "Please use SwiftUI or UIKit"]
#[unsafe(method(contentRatingRanking))]
#[unsafe(method_family = none)]
pub unsafe fn contentRatingRanking(&self) -> Option<Retained<NSNumber>>;
#[deprecated = "Please use SwiftUI or UIKit"]
#[unsafe(method(artworkImageURL))]
#[unsafe(method_family = none)]
pub unsafe fn artworkImageURL(&self) -> Option<Retained<NSURL>>;
#[deprecated = "Please use SwiftUI or UIKit"]
#[unsafe(method(containsExplicitContent))]
#[unsafe(method_family = none)]
pub unsafe fn containsExplicitContent(&self) -> bool;
#[deprecated = "Please use SwiftUI or UIKit"]
#[unsafe(method(resumeTime))]
#[unsafe(method_family = none)]
pub unsafe fn resumeTime(&self) -> NSTimeInterval;
#[deprecated = "Please use SwiftUI or UIKit"]
#[unsafe(method(interstitials))]
#[unsafe(method_family = none)]
pub unsafe fn interstitials(&self) -> Retained<NSArray<TVTimeRange>>;
#[deprecated = "Please use SwiftUI or UIKit"]
#[unsafe(method(highlightGroups))]
#[unsafe(method_family = none)]
pub unsafe fn highlightGroups(&self) -> Retained<NSArray<TVHighlightGroup>>;
#[deprecated = "Please use SwiftUI or UIKit"]
#[unsafe(method(userInfo))]
#[unsafe(method_family = none)]
pub unsafe fn userInfo(&self) -> Retained<NSDictionary<NSString, AnyObject>>;
);
}
impl TVMediaItem {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[deprecated = "Please use SwiftUI or UIKit"]
pub struct TVTimeRange;
);
extern_conformance!(
unsafe impl NSObjectProtocol for TVTimeRange {}
);
impl TVTimeRange {
extern_methods!(
#[deprecated = "Please use SwiftUI or UIKit"]
#[unsafe(method(startTime))]
#[unsafe(method_family = none)]
pub unsafe fn startTime(&self) -> NSTimeInterval;
#[deprecated = "Please use SwiftUI or UIKit"]
#[unsafe(method(endTime))]
#[unsafe(method_family = none)]
pub unsafe fn endTime(&self) -> NSTimeInterval;
#[deprecated = "Please use SwiftUI or UIKit"]
#[unsafe(method(duration))]
#[unsafe(method_family = none)]
pub unsafe fn duration(&self) -> NSTimeInterval;
);
}
impl TVTimeRange {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[deprecated = "Please use SwiftUI or UIKit"]
pub struct TVHighlightGroup;
);
extern_conformance!(
unsafe impl NSObjectProtocol for TVHighlightGroup {}
);
impl TVHighlightGroup {
extern_methods!(
#[deprecated = "Please use SwiftUI or UIKit"]
#[unsafe(method(localizedName))]
#[unsafe(method_family = none)]
pub unsafe fn localizedName(&self) -> Option<Retained<NSString>>;
#[deprecated = "Please use SwiftUI or UIKit"]
#[unsafe(method(highlights))]
#[unsafe(method_family = none)]
pub unsafe fn highlights(&self) -> Retained<NSArray<TVHighlight>>;
);
}
impl TVHighlightGroup {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[deprecated = "Please use SwiftUI or UIKit"]
pub struct TVHighlight;
);
extern_conformance!(
unsafe impl NSObjectProtocol for TVHighlight {}
);
impl TVHighlight {
extern_methods!(
#[deprecated = "Please use SwiftUI or UIKit"]
#[unsafe(method(localizedName))]
#[unsafe(method_family = none)]
pub unsafe fn localizedName(&self) -> Option<Retained<NSString>>;
#[deprecated = "Please use SwiftUI or UIKit"]
#[unsafe(method(highlightDescription))]
#[unsafe(method_family = none)]
pub unsafe fn highlightDescription(&self) -> Option<Retained<NSString>>;
#[deprecated = "Please use SwiftUI or UIKit"]
#[unsafe(method(timeRange))]
#[unsafe(method_family = none)]
pub unsafe fn timeRange(&self) -> Retained<TVTimeRange>;
#[deprecated = "Please use SwiftUI or UIKit"]
#[unsafe(method(imageURL))]
#[unsafe(method_family = none)]
pub unsafe fn imageURL(&self) -> Option<Retained<NSURL>>;
);
}
impl TVHighlight {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[deprecated = "Please use SwiftUI or UIKit"]
pub struct TVPlayer;
);
extern_conformance!(
unsafe impl NSObjectProtocol for TVPlayer {}
);
impl TVPlayer {
extern_methods!(
#[cfg(feature = "objc2-av-foundation")]
#[deprecated = "Please use SwiftUI or UIKit"]
#[unsafe(method(initWithPlayer:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithPlayer(this: Allocated<Self>, player: &AVPlayer) -> Retained<Self>;
#[cfg(feature = "objc2-av-foundation")]
#[deprecated = "Please use SwiftUI or UIKit"]
#[unsafe(method(player))]
#[unsafe(method_family = none)]
pub unsafe fn player(&self) -> Retained<AVPlayer>;
#[deprecated = "Please use SwiftUI or UIKit"]
#[unsafe(method(playlist))]
#[unsafe(method_family = none)]
pub unsafe fn playlist(&self) -> Option<Retained<TVPlaylist>>;
#[deprecated = "Please use SwiftUI or UIKit"]
#[unsafe(method(state))]
#[unsafe(method_family = none)]
pub unsafe fn state(&self) -> TVPlaybackState;
#[deprecated = "Please use SwiftUI or UIKit"]
#[unsafe(method(currentMediaItem))]
#[unsafe(method_family = none)]
pub unsafe fn currentMediaItem(&self) -> Option<Retained<TVMediaItem>>;
#[deprecated = "Please use SwiftUI or UIKit"]
#[unsafe(method(nextMediaItem))]
#[unsafe(method_family = none)]
pub unsafe fn nextMediaItem(&self) -> Option<Retained<TVMediaItem>>;
#[deprecated = "Please use SwiftUI or UIKit"]
#[unsafe(method(previousMediaItem))]
#[unsafe(method_family = none)]
pub unsafe fn previousMediaItem(&self) -> Option<Retained<TVMediaItem>>;
#[cfg(feature = "block2")]
#[deprecated = "Please use SwiftUI or UIKit"]
#[unsafe(method(dispatchEvent:userInfo:completion:))]
#[unsafe(method_family = none)]
pub unsafe fn dispatchEvent_userInfo_completion(
&self,
event: &TVPlaybackEvent,
user_info: Option<&ProtocolObject<dyn TVPlaybackEventMarshaling>>,
completion: Option<&block2::DynBlock<dyn Fn(Bool)>>,
);
#[deprecated = "Please use SwiftUI or UIKit"]
#[unsafe(method(pause))]
#[unsafe(method_family = none)]
pub unsafe fn pause(&self);
#[deprecated = "Please use SwiftUI or UIKit"]
#[unsafe(method(next))]
#[unsafe(method_family = none)]
pub unsafe fn next(&self);
#[deprecated = "Please use SwiftUI or UIKit"]
#[unsafe(method(previous))]
#[unsafe(method_family = none)]
pub unsafe fn previous(&self);
#[deprecated = "Please use SwiftUI or UIKit"]
#[unsafe(method(presentWithAnimation:))]
#[unsafe(method_family = none)]
pub unsafe fn presentWithAnimation(&self, animated: bool);
#[deprecated = "Please use SwiftUI or UIKit"]
#[unsafe(method(changeToMediaItemAtIndex:))]
#[unsafe(method_family = none)]
pub unsafe fn changeToMediaItemAtIndex(&self, index: NSInteger);
);
}
impl TVPlayer {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}