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
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;
use objc2_foundation::*;
use crate::*;
/// [Apple's documentation](https://developer.apple.com/documentation/tvservices/tvtopshelfcontentstyle?language=objc)
// NS_ENUM
#[deprecated = "TVTopShelfProvider has been replaced by TVTopShelfContent"]
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct TVTopShelfContentStyle(pub NSInteger);
impl TVTopShelfContentStyle {
#[doc(alias = "TVTopShelfContentStyleInset")]
#[deprecated = "TVTopShelfProvider has been replaced by TVTopShelfContent"]
pub const Inset: Self = Self(1);
#[doc(alias = "TVTopShelfContentStyleSectioned")]
#[deprecated = "TVTopShelfProvider has been replaced by TVTopShelfContent"]
pub const Sectioned: Self = Self(2);
}
unsafe impl Encode for TVTopShelfContentStyle {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for TVTopShelfContentStyle {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_protocol!(
/// A protocol implemented by applications to provided items for
/// display in the main menu's top shelf of an Apple TV.
///
/// This is a protocol which can be adopted by an app's TV Services
/// extension, on the principal class of the extension.
/// Apps which want to provide dynamic content to the top shelf,
/// rather than have the system use the static image submitted with
/// the application, implement a TV Services extension and adopt
/// this protocol. The various supported user interface styles
/// for the display of the content items are given by the
/// TVTopShelfContentStyle enumeration.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/tvservices/tvtopshelfprovider?language=objc)
#[deprecated = "TVTopShelfProvider has been replaced by TVTopShelfContentProvider"]
pub unsafe trait TVTopShelfProvider {
#[deprecated = "TVTopShelfProvider has been replaced by TVTopShelfContentProvider"]
#[unsafe(method(topShelfStyle))]
#[unsafe(method_family = none)]
unsafe fn topShelfStyle(&self) -> TVTopShelfContentStyle;
#[cfg(feature = "TVContentItem")]
#[deprecated = "TVTopShelfProvider has been replaced by TVTopShelfContentProvider"]
#[unsafe(method(topShelfItems))]
#[unsafe(method_family = none)]
unsafe fn topShelfItems(&self) -> Retained<NSArray<TVContentItem>>;
}
);
extern "C" {
/// The name of a notification the extension or containing app can
/// post to tell observers within the process, and the system, that
/// the Top Shelf data has changed.
///
/// Post the notification to the process-local NSNotificationCenter
/// ([NSNotificationCenter defaultCenter]). The system doesn't care about
/// the object or userInfo of the notification. The system will refetch
/// the data from the extension, at some point in the future (not
/// necessarily right away).
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/tvservices/tvtopshelfitemsdidchangenotification?language=objc)
#[deprecated = "TVTopShelfItemsDidChangeNotification has been replaced by [TVTopShelfContentProvider topShelfContentDidChange]"]
pub static TVTopShelfItemsDidChangeNotification: &'static NSString;
}
extern "C-unwind" {
/// Returns the ideal size of an image, the size which doesn't require
/// scaling, for the given user interface style and image shape, in the
/// current running version of the OS.
///
/// For shapes not supported in the given style, returns CGSizeZero.
#[cfg(all(feature = "TVContentItem", feature = "objc2-core-foundation"))]
#[deprecated = "TVTopShelfImageSizeForShape has been replaced by [TVTopShelfSectionedContent imageSizeForImageShape:] and [TVTopShelfInsetContent imageSize]"]
pub fn TVTopShelfImageSizeForShape(
shape: TVContentItemImageShape,
style: TVTopShelfContentStyle,
) -> CGSize;
}