objc2_tv_ml_kit/generated/
TVPlayback.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-av-foundation")]
7use objc2_av_foundation::*;
8use objc2_foundation::*;
9#[cfg(feature = "objc2-javascript-core")]
10use objc2_javascript_core::*;
11
12use crate::*;
13
14#[deprecated = "Please use SwiftUI or UIKit"]
16pub type TVPlaybackEvent = NSString;
18
19#[deprecated = "Please use SwiftUI or UIKit"]
21pub type TVMediaItemType = NSString;
23
24#[deprecated = "Please use SwiftUI or UIKit"]
26pub type TVPlaybackEventProperty = NSString;
28
29extern "C" {
30 #[deprecated = "Please use SwiftUI or UIKit"]
32 pub static TVMediaItemTypeVideo: &'static TVMediaItemType;
33}
34
35extern "C" {
36 #[deprecated = "Please use SwiftUI or UIKit"]
38 pub static TVMediaItemTypeAudio: &'static TVMediaItemType;
39}
40
41#[deprecated = "Please use SwiftUI or UIKit"]
43pub type TVMediaItemContentRatingDomain = NSString;
45
46extern "C" {
47 #[deprecated = "Please use SwiftUI or UIKit"]
49 pub static TVMediaItemContentRatingDomainMovie: &'static TVMediaItemContentRatingDomain;
50}
51
52extern "C" {
53 #[deprecated = "Please use SwiftUI or UIKit"]
55 pub static TVMediaItemContentRatingDomainTVShow: &'static TVMediaItemContentRatingDomain;
56}
57
58extern "C" {
59 #[deprecated = "Please use SwiftUI or UIKit"]
61 pub static TVMediaItemContentRatingDomainMusic: &'static TVMediaItemContentRatingDomain;
62}
63
64#[deprecated = "Please use SwiftUI or UIKit"]
67#[repr(transparent)]
68#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
69pub struct TVPlaybackState(pub NSInteger);
70impl TVPlaybackState {
71 #[doc(alias = "TVPlaybackStateUndefined")]
72 #[deprecated = "Please use SwiftUI or UIKit"]
73 pub const Undefined: Self = Self(0);
74 #[doc(alias = "TVPlaybackStateBegin")]
75 #[deprecated = "Please use SwiftUI or UIKit"]
76 pub const Begin: Self = Self(1);
77 #[doc(alias = "TVPlaybackStateLoading")]
78 #[deprecated = "Please use SwiftUI or UIKit"]
79 pub const Loading: Self = Self(2);
80 #[doc(alias = "TVPlaybackStatePlaying")]
81 #[deprecated = "Please use SwiftUI or UIKit"]
82 pub const Playing: Self = Self(3);
83 #[doc(alias = "TVPlaybackStatePaused")]
84 #[deprecated = "Please use SwiftUI or UIKit"]
85 pub const Paused: Self = Self(4);
86 #[doc(alias = "TVPlaybackStateScanning")]
87 #[deprecated = "Please use SwiftUI or UIKit"]
88 pub const Scanning: Self = Self(5);
89 #[doc(alias = "TVPlaybackStateFastForwarding")]
90 #[deprecated = "Please use SwiftUI or UIKit"]
91 pub const FastForwarding: Self = Self(6);
92 #[doc(alias = "TVPlaybackStateRewinding")]
93 #[deprecated = "Please use SwiftUI or UIKit"]
94 pub const Rewinding: Self = Self(7);
95 #[doc(alias = "TVPlaybackStateEnd")]
96 #[deprecated = "Please use SwiftUI or UIKit"]
97 pub const End: Self = Self(8);
98}
99
100unsafe impl Encode for TVPlaybackState {
101 const ENCODING: Encoding = NSInteger::ENCODING;
102}
103
104unsafe impl RefEncode for TVPlaybackState {
105 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
106}
107
108#[deprecated = "Please use SwiftUI or UIKit"]
111#[repr(transparent)]
112#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
113pub struct TVPlaylistRepeatMode(pub NSInteger);
114impl TVPlaylistRepeatMode {
115 #[doc(alias = "TVPlaylistRepeatModeNone")]
116 #[deprecated = "Please use SwiftUI or UIKit"]
117 pub const None: Self = Self(0);
118 #[doc(alias = "TVPlaylistRepeatModeAll")]
119 #[deprecated = "Please use SwiftUI or UIKit"]
120 pub const All: Self = Self(1);
121 #[doc(alias = "TVPlaylistRepeatModeOne")]
122 #[deprecated = "Please use SwiftUI or UIKit"]
123 pub const One: Self = Self(2);
124}
125
126unsafe impl Encode for TVPlaylistRepeatMode {
127 const ENCODING: Encoding = NSInteger::ENCODING;
128}
129
130unsafe impl RefEncode for TVPlaylistRepeatMode {
131 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
132}
133
134#[deprecated = "Please use SwiftUI or UIKit"]
137#[repr(transparent)]
138#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
139pub struct TVPlaylistEndAction(pub NSInteger);
140impl TVPlaylistEndAction {
141 #[doc(alias = "TVPlaylistEndActionStop")]
142 #[deprecated = "Please use SwiftUI or UIKit"]
143 pub const Stop: Self = Self(0);
144 #[doc(alias = "TVPlaylistEndActionPause")]
145 #[deprecated = "Please use SwiftUI or UIKit"]
146 pub const Pause: Self = Self(1);
147 #[doc(alias = "TVPlaylistEndActionWaitForMoreItems")]
148 #[deprecated = "Please use SwiftUI or UIKit"]
149 pub const WaitForMoreItems: Self = Self(2);
150}
151
152unsafe impl Encode for TVPlaylistEndAction {
153 const ENCODING: Encoding = NSInteger::ENCODING;
154}
155
156unsafe impl RefEncode for TVPlaylistEndAction {
157 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
158}
159
160extern_protocol!(
161 #[deprecated = "Please use SwiftUI or UIKit"]
166 pub unsafe trait TVPlaybackEventMarshaling: NSObjectProtocol {
167 #[deprecated = "Please use SwiftUI or UIKit"]
168 #[unsafe(method(properties))]
169 #[unsafe(method_family = none)]
170 unsafe fn properties(
171 &self,
172 ) -> Option<Retained<NSDictionary<TVPlaybackEventProperty, AnyObject>>>;
173
174 #[cfg(feature = "objc2-javascript-core")]
175 #[deprecated = "Please use SwiftUI or UIKit"]
176 #[optional]
177 #[unsafe(method(processReturnJSValue:inContext:))]
178 #[unsafe(method_family = none)]
179 unsafe fn processReturnJSValue_inContext(&self, value: &JSValue, js_context: &JSContext);
180 }
181);
182
183extern_class!(
184 #[unsafe(super(NSObject))]
189 #[derive(Debug, PartialEq, Eq, Hash)]
190 #[deprecated = "Please use SwiftUI or UIKit"]
191 pub struct TVPlaybackCustomEventUserInfo;
192);
193
194extern_conformance!(
195 unsafe impl NSObjectProtocol for TVPlaybackCustomEventUserInfo {}
196);
197
198extern_conformance!(
199 unsafe impl TVPlaybackEventMarshaling for TVPlaybackCustomEventUserInfo {}
200);
201
202impl TVPlaybackCustomEventUserInfo {
203 extern_methods!(
204 #[deprecated = "Please use SwiftUI or UIKit"]
208 #[unsafe(method(initWithProperties:expectsReturnValue:))]
209 #[unsafe(method_family = init)]
210 pub unsafe fn initWithProperties_expectsReturnValue(
211 this: Allocated<Self>,
212 properties: Option<&NSDictionary<TVPlaybackEventProperty, AnyObject>>,
213 expects_return_value: bool,
214 ) -> Retained<Self>;
215
216 #[deprecated = "Please use SwiftUI or UIKit"]
217 #[unsafe(method(expectsReturnValue))]
218 #[unsafe(method_family = none)]
219 pub unsafe fn expectsReturnValue(&self) -> bool;
220
221 #[deprecated = "Please use SwiftUI or UIKit"]
223 #[unsafe(method(setExpectsReturnValue:))]
224 #[unsafe(method_family = none)]
225 pub unsafe fn setExpectsReturnValue(&self, expects_return_value: bool);
226
227 #[deprecated = "Please use SwiftUI or UIKit"]
228 #[unsafe(method(returnValue))]
229 #[unsafe(method_family = none)]
230 pub unsafe fn returnValue(&self) -> Option<Retained<AnyObject>>;
231 );
232}
233
234impl TVPlaybackCustomEventUserInfo {
236 extern_methods!(
237 #[unsafe(method(init))]
238 #[unsafe(method_family = init)]
239 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
240
241 #[unsafe(method(new))]
242 #[unsafe(method_family = new)]
243 pub unsafe fn new() -> Retained<Self>;
244 );
245}
246
247extern_class!(
248 #[unsafe(super(NSObject))]
252 #[derive(Debug, PartialEq, Eq, Hash)]
253 #[deprecated = "Please use SwiftUI or UIKit"]
254 pub struct TVPlaylist;
255);
256
257extern_conformance!(
258 unsafe impl NSObjectProtocol for TVPlaylist {}
259);
260
261impl TVPlaylist {
262 extern_methods!(
263 #[deprecated = "Please use SwiftUI or UIKit"]
264 #[unsafe(method(mediaItems))]
265 #[unsafe(method_family = none)]
266 pub unsafe fn mediaItems(&self) -> Retained<NSArray<TVMediaItem>>;
267
268 #[deprecated = "Please use SwiftUI or UIKit"]
269 #[unsafe(method(endAction))]
270 #[unsafe(method_family = none)]
271 pub unsafe fn endAction(&self) -> TVPlaylistEndAction;
272
273 #[deprecated = "Please use SwiftUI or UIKit"]
274 #[unsafe(method(repeatMode))]
275 #[unsafe(method_family = none)]
276 pub unsafe fn repeatMode(&self) -> TVPlaylistRepeatMode;
277
278 #[deprecated = "Please use SwiftUI or UIKit"]
279 #[unsafe(method(userInfo))]
280 #[unsafe(method_family = none)]
281 pub unsafe fn userInfo(&self) -> Option<Retained<NSDictionary<NSString, AnyObject>>>;
282 );
283}
284
285impl TVPlaylist {
287 extern_methods!(
288 #[unsafe(method(init))]
289 #[unsafe(method_family = init)]
290 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
291
292 #[unsafe(method(new))]
293 #[unsafe(method_family = new)]
294 pub unsafe fn new() -> Retained<Self>;
295 );
296}
297
298extern_class!(
299 #[unsafe(super(NSObject))]
303 #[derive(Debug, PartialEq, Eq, Hash)]
304 #[deprecated = "Please use SwiftUI or UIKit"]
305 pub struct TVMediaItem;
306);
307
308extern_conformance!(
309 unsafe impl NSObjectProtocol for TVMediaItem {}
310);
311
312impl TVMediaItem {
313 extern_methods!(
314 #[deprecated = "Please use SwiftUI or UIKit"]
315 #[unsafe(method(type))]
316 #[unsafe(method_family = none)]
317 pub unsafe fn r#type(&self) -> Option<Retained<TVMediaItemType>>;
318
319 #[deprecated = "Please use SwiftUI or UIKit"]
320 #[unsafe(method(url))]
321 #[unsafe(method_family = none)]
322 pub unsafe fn url(&self) -> Option<Retained<NSURL>>;
323
324 #[deprecated = "Please use SwiftUI or UIKit"]
325 #[unsafe(method(title))]
326 #[unsafe(method_family = none)]
327 pub unsafe fn title(&self) -> Option<Retained<NSString>>;
328
329 #[deprecated = "Please use SwiftUI or UIKit"]
330 #[unsafe(method(subtitle))]
331 #[unsafe(method_family = none)]
332 pub unsafe fn subtitle(&self) -> Option<Retained<NSString>>;
333
334 #[deprecated = "Please use SwiftUI or UIKit"]
335 #[unsafe(method(itemDescription))]
336 #[unsafe(method_family = none)]
337 pub unsafe fn itemDescription(&self) -> Option<Retained<NSString>>;
338
339 #[deprecated = "Please use SwiftUI or UIKit"]
340 #[unsafe(method(contentRatingDomain))]
341 #[unsafe(method_family = none)]
342 pub unsafe fn contentRatingDomain(
343 &self,
344 ) -> Option<Retained<TVMediaItemContentRatingDomain>>;
345
346 #[deprecated = "Please use SwiftUI or UIKit"]
347 #[unsafe(method(contentRatingRanking))]
348 #[unsafe(method_family = none)]
349 pub unsafe fn contentRatingRanking(&self) -> Option<Retained<NSNumber>>;
350
351 #[deprecated = "Please use SwiftUI or UIKit"]
352 #[unsafe(method(artworkImageURL))]
353 #[unsafe(method_family = none)]
354 pub unsafe fn artworkImageURL(&self) -> Option<Retained<NSURL>>;
355
356 #[deprecated = "Please use SwiftUI or UIKit"]
357 #[unsafe(method(containsExplicitContent))]
358 #[unsafe(method_family = none)]
359 pub unsafe fn containsExplicitContent(&self) -> bool;
360
361 #[deprecated = "Please use SwiftUI or UIKit"]
362 #[unsafe(method(resumeTime))]
363 #[unsafe(method_family = none)]
364 pub unsafe fn resumeTime(&self) -> NSTimeInterval;
365
366 #[deprecated = "Please use SwiftUI or UIKit"]
367 #[unsafe(method(interstitials))]
368 #[unsafe(method_family = none)]
369 pub unsafe fn interstitials(&self) -> Retained<NSArray<TVTimeRange>>;
370
371 #[deprecated = "Please use SwiftUI or UIKit"]
372 #[unsafe(method(highlightGroups))]
373 #[unsafe(method_family = none)]
374 pub unsafe fn highlightGroups(&self) -> Retained<NSArray<TVHighlightGroup>>;
375
376 #[deprecated = "Please use SwiftUI or UIKit"]
377 #[unsafe(method(userInfo))]
378 #[unsafe(method_family = none)]
379 pub unsafe fn userInfo(&self) -> Retained<NSDictionary<NSString, AnyObject>>;
380 );
381}
382
383impl TVMediaItem {
385 extern_methods!(
386 #[unsafe(method(init))]
387 #[unsafe(method_family = init)]
388 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
389
390 #[unsafe(method(new))]
391 #[unsafe(method_family = new)]
392 pub unsafe fn new() -> Retained<Self>;
393 );
394}
395
396extern_class!(
397 #[unsafe(super(NSObject))]
401 #[derive(Debug, PartialEq, Eq, Hash)]
402 #[deprecated = "Please use SwiftUI or UIKit"]
403 pub struct TVTimeRange;
404);
405
406extern_conformance!(
407 unsafe impl NSObjectProtocol for TVTimeRange {}
408);
409
410impl TVTimeRange {
411 extern_methods!(
412 #[deprecated = "Please use SwiftUI or UIKit"]
413 #[unsafe(method(startTime))]
414 #[unsafe(method_family = none)]
415 pub unsafe fn startTime(&self) -> NSTimeInterval;
416
417 #[deprecated = "Please use SwiftUI or UIKit"]
418 #[unsafe(method(endTime))]
419 #[unsafe(method_family = none)]
420 pub unsafe fn endTime(&self) -> NSTimeInterval;
421
422 #[deprecated = "Please use SwiftUI or UIKit"]
423 #[unsafe(method(duration))]
424 #[unsafe(method_family = none)]
425 pub unsafe fn duration(&self) -> NSTimeInterval;
426 );
427}
428
429impl TVTimeRange {
431 extern_methods!(
432 #[unsafe(method(init))]
433 #[unsafe(method_family = init)]
434 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
435
436 #[unsafe(method(new))]
437 #[unsafe(method_family = new)]
438 pub unsafe fn new() -> Retained<Self>;
439 );
440}
441
442extern_class!(
443 #[unsafe(super(NSObject))]
447 #[derive(Debug, PartialEq, Eq, Hash)]
448 #[deprecated = "Please use SwiftUI or UIKit"]
449 pub struct TVHighlightGroup;
450);
451
452extern_conformance!(
453 unsafe impl NSObjectProtocol for TVHighlightGroup {}
454);
455
456impl TVHighlightGroup {
457 extern_methods!(
458 #[deprecated = "Please use SwiftUI or UIKit"]
459 #[unsafe(method(localizedName))]
460 #[unsafe(method_family = none)]
461 pub unsafe fn localizedName(&self) -> Option<Retained<NSString>>;
462
463 #[deprecated = "Please use SwiftUI or UIKit"]
464 #[unsafe(method(highlights))]
465 #[unsafe(method_family = none)]
466 pub unsafe fn highlights(&self) -> Retained<NSArray<TVHighlight>>;
467 );
468}
469
470impl TVHighlightGroup {
472 extern_methods!(
473 #[unsafe(method(init))]
474 #[unsafe(method_family = init)]
475 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
476
477 #[unsafe(method(new))]
478 #[unsafe(method_family = new)]
479 pub unsafe fn new() -> Retained<Self>;
480 );
481}
482
483extern_class!(
484 #[unsafe(super(NSObject))]
488 #[derive(Debug, PartialEq, Eq, Hash)]
489 #[deprecated = "Please use SwiftUI or UIKit"]
490 pub struct TVHighlight;
491);
492
493extern_conformance!(
494 unsafe impl NSObjectProtocol for TVHighlight {}
495);
496
497impl TVHighlight {
498 extern_methods!(
499 #[deprecated = "Please use SwiftUI or UIKit"]
500 #[unsafe(method(localizedName))]
501 #[unsafe(method_family = none)]
502 pub unsafe fn localizedName(&self) -> Option<Retained<NSString>>;
503
504 #[deprecated = "Please use SwiftUI or UIKit"]
505 #[unsafe(method(highlightDescription))]
506 #[unsafe(method_family = none)]
507 pub unsafe fn highlightDescription(&self) -> Option<Retained<NSString>>;
508
509 #[deprecated = "Please use SwiftUI or UIKit"]
510 #[unsafe(method(timeRange))]
511 #[unsafe(method_family = none)]
512 pub unsafe fn timeRange(&self) -> Retained<TVTimeRange>;
513
514 #[deprecated = "Please use SwiftUI or UIKit"]
515 #[unsafe(method(imageURL))]
516 #[unsafe(method_family = none)]
517 pub unsafe fn imageURL(&self) -> Option<Retained<NSURL>>;
518 );
519}
520
521impl TVHighlight {
523 extern_methods!(
524 #[unsafe(method(init))]
525 #[unsafe(method_family = init)]
526 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
527
528 #[unsafe(method(new))]
529 #[unsafe(method_family = new)]
530 pub unsafe fn new() -> Retained<Self>;
531 );
532}
533
534extern_class!(
535 #[unsafe(super(NSObject))]
539 #[derive(Debug, PartialEq, Eq, Hash)]
540 #[deprecated = "Please use SwiftUI or UIKit"]
541 pub struct TVPlayer;
542);
543
544extern_conformance!(
545 unsafe impl NSObjectProtocol for TVPlayer {}
546);
547
548impl TVPlayer {
549 extern_methods!(
550 #[cfg(feature = "objc2-av-foundation")]
551 #[deprecated = "Please use SwiftUI or UIKit"]
552 #[unsafe(method(initWithPlayer:))]
553 #[unsafe(method_family = init)]
554 pub unsafe fn initWithPlayer(this: Allocated<Self>, player: &AVPlayer) -> Retained<Self>;
555
556 #[cfg(feature = "objc2-av-foundation")]
557 #[deprecated = "Please use SwiftUI or UIKit"]
558 #[unsafe(method(player))]
559 #[unsafe(method_family = none)]
560 pub unsafe fn player(&self) -> Retained<AVPlayer>;
561
562 #[deprecated = "Please use SwiftUI or UIKit"]
563 #[unsafe(method(playlist))]
564 #[unsafe(method_family = none)]
565 pub unsafe fn playlist(&self) -> Option<Retained<TVPlaylist>>;
566
567 #[deprecated = "Please use SwiftUI or UIKit"]
568 #[unsafe(method(state))]
569 #[unsafe(method_family = none)]
570 pub unsafe fn state(&self) -> TVPlaybackState;
571
572 #[deprecated = "Please use SwiftUI or UIKit"]
573 #[unsafe(method(currentMediaItem))]
574 #[unsafe(method_family = none)]
575 pub unsafe fn currentMediaItem(&self) -> Option<Retained<TVMediaItem>>;
576
577 #[deprecated = "Please use SwiftUI or UIKit"]
578 #[unsafe(method(nextMediaItem))]
579 #[unsafe(method_family = none)]
580 pub unsafe fn nextMediaItem(&self) -> Option<Retained<TVMediaItem>>;
581
582 #[deprecated = "Please use SwiftUI or UIKit"]
583 #[unsafe(method(previousMediaItem))]
584 #[unsafe(method_family = none)]
585 pub unsafe fn previousMediaItem(&self) -> Option<Retained<TVMediaItem>>;
586
587 #[cfg(feature = "block2")]
588 #[deprecated = "Please use SwiftUI or UIKit"]
589 #[unsafe(method(dispatchEvent:userInfo:completion:))]
590 #[unsafe(method_family = none)]
591 pub unsafe fn dispatchEvent_userInfo_completion(
592 &self,
593 event: &TVPlaybackEvent,
594 user_info: Option<&ProtocolObject<dyn TVPlaybackEventMarshaling>>,
595 completion: Option<&block2::DynBlock<dyn Fn(Bool)>>,
596 );
597
598 #[deprecated = "Please use SwiftUI or UIKit"]
599 #[unsafe(method(pause))]
600 #[unsafe(method_family = none)]
601 pub unsafe fn pause(&self);
602
603 #[deprecated = "Please use SwiftUI or UIKit"]
604 #[unsafe(method(next))]
605 #[unsafe(method_family = none)]
606 pub unsafe fn next(&self);
607
608 #[deprecated = "Please use SwiftUI or UIKit"]
609 #[unsafe(method(previous))]
610 #[unsafe(method_family = none)]
611 pub unsafe fn previous(&self);
612
613 #[deprecated = "Please use SwiftUI or UIKit"]
614 #[unsafe(method(presentWithAnimation:))]
615 #[unsafe(method_family = none)]
616 pub unsafe fn presentWithAnimation(&self, animated: bool);
617
618 #[deprecated = "Please use SwiftUI or UIKit"]
619 #[unsafe(method(changeToMediaItemAtIndex:))]
620 #[unsafe(method_family = none)]
621 pub unsafe fn changeToMediaItemAtIndex(&self, index: NSInteger);
622 );
623}
624
625impl TVPlayer {
627 extern_methods!(
628 #[unsafe(method(init))]
629 #[unsafe(method_family = init)]
630 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
631
632 #[unsafe(method(new))]
633 #[unsafe(method_family = new)]
634 pub unsafe fn new() -> Retained<Self>;
635 );
636}