11// Copyright 2015 Xamarin Inc.
2+ // Copyright 2019 Microsoft Corporation
23
34using System ;
5+ using CoreGraphics ;
46using Foundation ;
57using ObjCRuntime ;
68
79namespace TVServices {
810
911[ TV ( 9 , 0 ) ]
12+ [ Deprecated ( PlatformName . TvOS , 13 , 0 , message : "Use 'TVTopShelfContentProvider' instead." ) ]
1013[ BaseType ( typeof ( NSObject ) ) ]
1114[ DisableDefaultCtor ]
1215interface TVContentIdentifier : NSCopying , NSSecureCoding {
@@ -23,6 +26,7 @@ interface TVContentIdentifier : NSCopying, NSSecureCoding {
2326
2427[ TV ( 9 , 0 ) ]
2528[ BaseType ( typeof ( NSObject ) ) ]
29+ [ Deprecated ( PlatformName . TvOS , 13 , 0 , message : "Use 'TVTopShelfItem' instead." ) ]
2630[ DisableDefaultCtor ]
2731interface TVContentItem : NSCopying , NSSecureCoding {
2832[ Export ( "contentIdentifier" , ArgumentSemantic . Copy ) ]
@@ -101,4 +105,274 @@ interface TVTopShelfItems {
101105[ Field ( "TVTopShelfItemsDidChangeNotification" ) ]
102106NSString DidChangeNotification { get ; }
103107}
108+
109+ [ TV ( 13 , 0 ) ]
110+ [ BaseType ( typeof ( NSObject ) ) ]
111+ [ DisableDefaultCtor ] // Name property can't be null
112+ interface TVAppProfileDescriptor : NSCopying , NSSecureCoding {
113+
114+ [ Export ( "initWithName:" ) ]
115+ IntPtr Constructor ( string name ) ;
116+
117+ [ Export ( "name" ) ]
118+ string Name { get ; set ; }
119+ }
120+
121+ [ TV ( 13 , 0 ) ]
122+ [ BaseType ( typeof ( NSObject ) ) ]
123+ [ DisableDefaultCtor ]
124+ interface TVTopShelfAction {
125+ [ Export ( "URL" , ArgumentSemantic . Copy ) ]
126+ NSUrl Url { get ; }
127+
128+ [ Export ( "initWithURL:" ) ]
129+ [ DesignatedInitializer ]
130+ IntPtr Constructor ( NSUrl url ) ;
131+ }
132+
133+ [ TV ( 13 , 0 ) ]
134+ [ Native ]
135+ enum TVTopShelfCarouselContentStyle : long {
136+ Actions ,
137+ Details ,
138+ }
139+
140+ interface ITVTopShelfContent { }
141+
142+ [ TV ( 13 , 0 ) ]
143+ [ Protocol ]
144+ interface TVTopShelfContent { }
145+
146+ [ TV ( 13 , 0 ) ]
147+ [ BaseType ( typeof ( NSObject ) ) ]
148+ [ DisableDefaultCtor ]
149+ interface TVTopShelfCarouselContent : TVTopShelfContent {
150+ [ Export ( "style" ) ]
151+ TVTopShelfCarouselContentStyle Style { get ; }
152+
153+ [ Export ( "items" , ArgumentSemantic . Copy ) ]
154+ TVTopShelfCarouselItem [ ] Items { get ; }
155+
156+ [ Export ( "initWithStyle:items:" ) ]
157+ [ DesignatedInitializer ]
158+ IntPtr Constructor ( TVTopShelfCarouselContentStyle style , TVTopShelfCarouselItem [ ] items ) ;
159+ }
160+
161+ [ TV ( 13 , 0 ) ]
162+ [ Flags ]
163+ [ Native ]
164+ public enum TVTopShelfCarouselItemMediaOptions : ulong {
165+ VideoResolutionHD = 1uL << 0 ,
166+ VideoResolution4K = 2uL << 0 ,
167+ VideoColorSpaceHdr = 1uL << 6 ,
168+ VideoColorSpaceDolbyVision = 2uL << 6 ,
169+ AudioDolbyAtmos = 1uL << 12 ,
170+ AudioTranscriptionClosedCaptioning = 1uL << 13 ,
171+ AudioTranscriptionSdh = 1uL << 14 ,
172+ AudioDescription = 1uL << 15 ,
173+ }
174+
175+ [ TV ( 13 , 0 ) ]
176+ [ BaseType ( typeof ( TVTopShelfItem ) ) ]
177+ [ DisableDefaultCtor ] // -[TVTopShelfCarouselItem init]: unrecognized selector sent to instance 0x600000eb18c0
178+ interface TVTopShelfCarouselItem {
179+
180+ // inlined from base class
181+ [ Export ( "initWithIdentifier:" ) ]
182+ [ DesignatedInitializer ]
183+ IntPtr Constructor ( string identifier ) ;
184+
185+ [ NullAllowed , Export ( "contextTitle" ) ]
186+ string ContextTitle { get ; set ; }
187+
188+ [ NullAllowed , Export ( "summary" ) ]
189+ string Summary { get ; set ; }
190+
191+ [ NullAllowed , Export ( "genre" ) ]
192+ string Genre { get ; set ; }
193+
194+ [ Export ( "duration" ) ]
195+ double /* NSTimeInterval */ Duration { get ; set ; }
196+
197+ [ NullAllowed , Export ( "creationDate" , ArgumentSemantic . Copy ) ]
198+ NSDate CreationDate { get ; set ; }
199+
200+ [ Export ( "mediaOptions" , ArgumentSemantic . Assign ) ]
201+ TVTopShelfCarouselItemMediaOptions MediaOptions { get ; set ; }
202+
203+ [ NullAllowed , Export ( "previewVideoURL" , ArgumentSemantic . Copy ) ]
204+ NSUrl PreviewVideoUrl { get ; set ; }
205+
206+ [ NullAllowed , Export ( "cinemagraphURL" , ArgumentSemantic . Copy ) ]
207+ NSUrl CinemagraphUrl { get ; set ; }
208+
209+ [ Export ( "namedAttributes" , ArgumentSemantic . Copy ) ]
210+ TVTopShelfNamedAttribute [ ] NamedAttributes { get ; set ; }
211+ }
212+
213+ [ TV ( 13 , 0 ) ]
214+ [ BaseType ( typeof ( NSObject ) ) ]
215+ interface TVTopShelfContentProvider {
216+ [ Async ]
217+ [ Export ( "loadTopShelfContentWithCompletionHandler:" ) ]
218+ void LoadTopShelfContent ( Action < ITVTopShelfContent > completionHandler ) ;
219+
220+ [ Static ]
221+ [ Export ( "topShelfContentDidChange" ) ]
222+ void DidChange ( ) ;
223+ }
224+
225+ [ TV ( 13 , 0 ) ]
226+ [ BaseType ( typeof ( NSObject ) ) ]
227+ [ DisableDefaultCtor ]
228+ interface TVTopShelfInsetContent : TVTopShelfContent {
229+ [ Export ( "items" , ArgumentSemantic . Copy ) ]
230+ TVTopShelfItem [ ] Items { get ; }
231+
232+ [ Static ]
233+ [ Export ( "imageSize" ) ]
234+ CGSize ImageSize { get ; }
235+
236+ [ Export ( "initWithItems:" ) ]
237+ IntPtr Constructor ( TVTopShelfItem [ ] items ) ;
238+ }
239+
240+ [ TV ( 13 , 0 ) ]
241+ [ BaseType ( typeof ( TVTopShelfObject ) ) ]
242+ [ DisableDefaultCtor ] // identifier can't be null and we have a designated initializer
243+ interface TVTopShelfItem {
244+
245+ [ Export ( "identifier" ) ]
246+ string Identifier { get ; }
247+
248+ [ NullAllowed , Export ( "playAction" , ArgumentSemantic . Strong ) ]
249+ TVTopShelfAction PlayAction { get ; set ; }
250+
251+ [ NullAllowed , Export ( "displayAction" , ArgumentSemantic . Strong ) ]
252+ TVTopShelfAction DisplayAction { get ; set ; }
253+
254+ [ NullAllowed , Export ( "expirationDate" , ArgumentSemantic . Copy ) ]
255+ NSDate ExpirationDate { get ; set ; }
256+
257+ [ Export ( "setImageURL:forTraits:" ) ]
258+ void SetImageUrl ( [ NullAllowed ] NSUrl imageUrl , TVTopShelfItemImageTraits traits ) ;
259+
260+ [ Export ( "imageURLForTraits:" ) ]
261+ [ return : NullAllowed ]
262+ NSUrl GetImageUrl ( TVTopShelfItemImageTraits traits ) ;
263+
264+ [ Export ( "initWithIdentifier:" ) ]
265+ [ DesignatedInitializer ]
266+ IntPtr Constructor ( string identifier ) ;
267+ }
268+
269+ [ TV ( 13 , 0 ) ]
270+ [ BaseType ( typeof ( NSObject ) ) ]
271+ [ DisableDefaultCtor ]
272+ interface TVTopShelfNamedAttribute {
273+
274+ [ Export ( "name" ) ]
275+ string Name { get ; }
276+
277+ [ Export ( "values" , ArgumentSemantic . Copy ) ]
278+ string [ ] Values { get ; }
279+
280+ [ Export ( "initWithName:values:" ) ]
281+ [ DesignatedInitializer ]
282+ IntPtr Constructor ( string name , string [ ] values ) ;
283+ }
284+
285+ [ TV ( 13 , 0 ) ]
286+ [ BaseType ( typeof ( NSObject ) ) ]
287+ [ Abstract ]
288+ [ DisableDefaultCtor ]
289+ interface TVTopShelfObject {
290+ [ NullAllowed , Export ( "title" ) ]
291+ string Title { get ; set ; }
292+ }
293+
294+ [ TV ( 13 , 0 ) ]
295+ [ Flags ]
296+ [ Native ]
297+ enum TVTopShelfItemImageTraits : ulong {
298+ Scale1x = 1 ,
299+ Scale2x = 2 ,
300+ }
301+
302+ [ TV ( 13 , 0 ) ]
303+ [ BaseType ( typeof ( NSObject ) ) ]
304+ interface TVUserManager {
305+
306+ [ NullAllowed , Export ( "currentUserIdentifier" ) ]
307+ string CurrentUserIdentifier { get ; }
308+
309+ [ Export ( "userIdentifiersForCurrentProfile" , ArgumentSemantic . Copy ) ]
310+ string [ ] UserIdentifiersForCurrentProfile { get ; set ; }
311+
312+ [ Async ]
313+ [ Export ( "presentProfilePreferencePanelWithCurrentSettings:availableProfiles:completion:" ) ]
314+ void PresentProfilePreferencePanel ( NSDictionary < NSString , TVAppProfileDescriptor > currentSettings , TVAppProfileDescriptor [ ] availableProfiles , Action < NSDictionary < NSString , TVAppProfileDescriptor > > completion ) ;
315+
316+ [ Async ]
317+ [ Export ( "shouldStorePreferenceForCurrentUserToProfile:completion:" ) ]
318+ void ShouldStorePreferenceForCurrentUser ( TVAppProfileDescriptor profile , Action < bool > completion ) ;
319+
320+ [ Notification ]
321+ [ Field ( "TVUserManagerCurrentUserIdentifierDidChangeNotification" ) ]
322+ NSString CurrentUserIdentifierDidChangeNotification { get ; }
323+ }
324+
325+ [ TV ( 13 , 0 ) ]
326+ [ BaseType ( typeof ( TVTopShelfObject ) ) ]
327+ [ DisableDefaultCtor ] // null is not allowed for items
328+ interface TVTopShelfItemCollection {
329+
330+ [ Export ( "items" , ArgumentSemantic . Copy ) ]
331+ TVTopShelfItem [ ] Items { get ; }
332+
333+ [ Export ( "initWithItems:" ) ]
334+ IntPtr Constructor ( TVTopShelfItem [ ] items ) ;
335+ }
336+
337+ [ TV ( 13 , 0 ) ]
338+ [ BaseType ( typeof ( NSObject ) ) ]
339+ [ DisableDefaultCtor ]
340+ interface TVTopShelfSectionedContent : TVTopShelfContent {
341+
342+ [ Export ( "sections" , ArgumentSemantic . Copy ) ]
343+ TVTopShelfItemCollection [ ] Sections { get ; }
344+
345+ [ Export ( "initWithSections:" ) ]
346+ [ DesignatedInitializer ]
347+ IntPtr Constructor ( TVTopShelfItemCollection [ ] sections ) ;
348+
349+ [ Static ]
350+ [ Export ( "imageSizeForImageShape:" ) ]
351+ CGSize GetImageSize ( TVTopShelfSectionedItemImageShape shape ) ;
352+ }
353+
354+ [ TV ( 13 , 0 ) ]
355+ [ Native ]
356+ public enum TVTopShelfSectionedItemImageShape : long {
357+ Square ,
358+ Poster ,
359+ Hdtv ,
360+ }
361+
362+ [ TV ( 13 , 0 ) ]
363+ [ BaseType ( typeof ( TVTopShelfItem ) ) ]
364+ [ DisableDefaultCtor ] // -[TVTopShelfSectionedItem init]: unrecognized selector sent to instance 0x600001f251a0
365+ interface TVTopShelfSectionedItem {
366+
367+ // inlined from base type
368+ [ Export ( "initWithIdentifier:" ) ]
369+ [ DesignatedInitializer ]
370+ IntPtr Constructor ( string identifier ) ;
371+
372+ [ Export ( "imageShape" , ArgumentSemantic . Assign ) ]
373+ TVTopShelfSectionedItemImageShape ImageShape { get ; set ; }
374+
375+ [ Export ( "playbackProgress" ) ]
376+ double PlaybackProgress { get ; set ; }
377+ }
104378}