1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
/// Options for describing media capabilities supported by a movie or show.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/tvservices/tvtopshelfcarouselitemmediaoptions?language=objc)
// NS_OPTIONS
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct TVTopShelfCarouselItemMediaOptions(pub NSUInteger);
bitflags::bitflags! {
impl TVTopShelfCarouselItemMediaOptions: NSUInteger {
/// High-definition video resolution.
///
/// Only one resolution value should be provided.
#[doc(alias = "TVTopShelfCarouselItemVideoResolutionHD")]
const VideoResolutionHD = 1<<0;
/// Ultra-high-definition 4K video resolution.
///
/// Only one resolution value should be provided.
#[doc(alias = "TVTopShelfCarouselItemVideoResolution4K")]
const VideoResolution4K = 2<<0;
/// High-dynamic-range video.
///
/// Only one color space value should be provided.
#[doc(alias = "TVTopShelfCarouselItemVideoColorSpaceHDR")]
const VideoColorSpaceHDR = 1<<6;
/// Dolby Vision video.
///
/// Only one color space value should be provided.
#[doc(alias = "TVTopShelfCarouselItemVideoColorSpaceDolbyVision")]
const VideoColorSpaceDolbyVision = 2<<6;
/// Whether the movie or show supports Dolby Atmos audio.
#[doc(alias = "TVTopShelfCarouselItemAudioDolbyAtmos")]
const AudioDolbyAtmos = 1<<12;
/// Whether the movie or show supports closed captioning.
#[doc(alias = "TVTopShelfCarouselItemAudioTranscriptionClosedCaptioning")]
const AudioTranscriptionClosedCaptioning = 1<<13;
/// Whether the movie or show supports subtitles for the deaf and hard-of-hearing.
#[doc(alias = "TVTopShelfCarouselItemAudioTranscriptionSDH")]
const AudioTranscriptionSDH = 1<<14;
/// Whether the movie or show supports audio descriptions.
#[doc(alias = "TVTopShelfCarouselItemAudioDescription")]
const AudioDescription = 1<<15;
}
}
unsafe impl Encode for TVTopShelfCarouselItemMediaOptions {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for TVTopShelfCarouselItemMediaOptions {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
/// An object that represents a single item in the carousel content style.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/tvservices/tvtopshelfcarouselitem?language=objc)
#[unsafe(super(TVTopShelfItem, TVTopShelfObject, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(all(feature = "TVTopShelfItem", feature = "TVTopShelfObject"))]
pub struct TVTopShelfCarouselItem;
);
#[cfg(all(feature = "TVTopShelfItem", feature = "TVTopShelfObject"))]
extern_conformance!(
unsafe impl NSObjectProtocol for TVTopShelfCarouselItem {}
);
#[cfg(all(feature = "TVTopShelfItem", feature = "TVTopShelfObject"))]
impl TVTopShelfCarouselItem {
extern_methods!(
/// A localized string that describes why this item is being shown in the Top Shelf.
#[unsafe(method(contextTitle))]
#[unsafe(method_family = none)]
pub unsafe fn contextTitle(&self) -> Option<Retained<NSString>>;
/// Setter for [`contextTitle`][Self::contextTitle].
///
/// This is [copied][objc2_foundation::NSCopying::copy] when set.
#[unsafe(method(setContextTitle:))]
#[unsafe(method_family = none)]
pub unsafe fn setContextTitle(&self, context_title: Option<&NSString>);
/// A descriptive summary of the movie or show.
#[unsafe(method(summary))]
#[unsafe(method_family = none)]
pub unsafe fn summary(&self) -> Option<Retained<NSString>>;
/// Setter for [`summary`][Self::summary].
///
/// This is [copied][objc2_foundation::NSCopying::copy] when set.
#[unsafe(method(setSummary:))]
#[unsafe(method_family = none)]
pub unsafe fn setSummary(&self, summary: Option<&NSString>);
/// The genre of the movie or show.
#[unsafe(method(genre))]
#[unsafe(method_family = none)]
pub unsafe fn genre(&self) -> Option<Retained<NSString>>;
/// Setter for [`genre`][Self::genre].
///
/// This is [copied][objc2_foundation::NSCopying::copy] when set.
#[unsafe(method(setGenre:))]
#[unsafe(method_family = none)]
pub unsafe fn setGenre(&self, genre: Option<&NSString>);
/// The length of the movie or show.
#[unsafe(method(duration))]
#[unsafe(method_family = none)]
pub unsafe fn duration(&self) -> NSTimeInterval;
/// Setter for [`duration`][Self::duration].
#[unsafe(method(setDuration:))]
#[unsafe(method_family = none)]
pub unsafe fn setDuration(&self, duration: NSTimeInterval);
/// The date this item was created or released.
#[unsafe(method(creationDate))]
#[unsafe(method_family = none)]
pub unsafe fn creationDate(&self) -> Option<Retained<NSDate>>;
/// Setter for [`creationDate`][Self::creationDate].
///
/// This is [copied][objc2_foundation::NSCopying::copy] when set.
#[unsafe(method(setCreationDate:))]
#[unsafe(method_family = none)]
pub unsafe fn setCreationDate(&self, creation_date: Option<&NSDate>);
/// The media options supported by the movie or show.
///
/// Values provided here are used to show media capability badges in the Top Shelf UI.
#[unsafe(method(mediaOptions))]
#[unsafe(method_family = none)]
pub unsafe fn mediaOptions(&self) -> TVTopShelfCarouselItemMediaOptions;
/// Setter for [`mediaOptions`][Self::mediaOptions].
#[unsafe(method(setMediaOptions:))]
#[unsafe(method_family = none)]
pub unsafe fn setMediaOptions(&self, media_options: TVTopShelfCarouselItemMediaOptions);
/// The trailer for the movie or show.
///
/// If provided this video is played after the image or cinemagraph when the user rests on the item.
#[unsafe(method(previewVideoURL))]
#[unsafe(method_family = none)]
pub unsafe fn previewVideoURL(&self) -> Option<Retained<NSURL>>;
/// Setter for [`previewVideoURL`][Self::previewVideoURL].
///
/// This is [copied][objc2_foundation::NSCopying::copy] when set.
#[unsafe(method(setPreviewVideoURL:))]
#[unsafe(method_family = none)]
pub unsafe fn setPreviewVideoURL(&self, preview_video_url: Option<&NSURL>);
/// A looping video shown before the preview video instead of the image.
///
/// If provided this video takes the place of the image. It will loop without sound until the preview video is ready to play.
#[unsafe(method(cinemagraphURL))]
#[unsafe(method_family = none)]
pub unsafe fn cinemagraphURL(&self) -> Option<Retained<NSURL>>;
/// Setter for [`cinemagraphURL`][Self::cinemagraphURL].
///
/// This is [copied][objc2_foundation::NSCopying::copy] when set.
#[unsafe(method(setCinemagraphURL:))]
#[unsafe(method_family = none)]
pub unsafe fn setCinemagraphURL(&self, cinemagraph_url: Option<&NSURL>);
#[cfg(feature = "TVTopShelfNamedAttribute")]
/// A collection of up to 4 named attributes displayed by the Top Shelf UI in a stylized manner.
#[unsafe(method(namedAttributes))]
#[unsafe(method_family = none)]
pub unsafe fn namedAttributes(&self) -> Retained<NSArray<TVTopShelfNamedAttribute>>;
#[cfg(feature = "TVTopShelfNamedAttribute")]
/// Setter for [`namedAttributes`][Self::namedAttributes].
///
/// This is [copied][objc2_foundation::NSCopying::copy] when set.
#[unsafe(method(setNamedAttributes:))]
#[unsafe(method_family = none)]
pub unsafe fn setNamedAttributes(
&self,
named_attributes: &NSArray<TVTopShelfNamedAttribute>,
);
);
}
/// Methods declared on superclass `TVTopShelfItem`.
#[cfg(all(feature = "TVTopShelfItem", feature = "TVTopShelfObject"))]
impl TVTopShelfCarouselItem {
extern_methods!(
/// Create an item with a unique identifier.
///
/// This identifier must be unique in the set of items you return to the system.
#[unsafe(method(initWithIdentifier:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithIdentifier(
this: Allocated<Self>,
identifier: &NSString,
) -> Retained<Self>;
);
}
/// Methods declared on superclass `TVTopShelfObject`.
#[cfg(all(feature = "TVTopShelfItem", feature = "TVTopShelfObject"))]
impl TVTopShelfCarouselItem {
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>;
);
}