objc2_tv_services/generated/
TVTopShelfItem.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10#[repr(transparent)]
15#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
16pub struct TVTopShelfItemImageTraits(pub NSUInteger);
17bitflags::bitflags! {
18 impl TVTopShelfItemImageTraits: NSUInteger {
19#[doc(alias = "TVTopShelfItemImageTraitScreenScale1x")]
21 const ScreenScale1x = 1<<0;
22#[doc(alias = "TVTopShelfItemImageTraitScreenScale2x")]
24 const ScreenScale2x = 2<<0;
25 }
26}
27
28unsafe impl Encode for TVTopShelfItemImageTraits {
29 const ENCODING: Encoding = NSUInteger::ENCODING;
30}
31
32unsafe impl RefEncode for TVTopShelfItemImageTraits {
33 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
34}
35
36extern_class!(
37 #[unsafe(super(TVTopShelfObject, NSObject))]
41 #[derive(Debug, PartialEq, Eq, Hash)]
42 #[cfg(feature = "TVTopShelfObject")]
43 pub struct TVTopShelfItem;
44);
45
46#[cfg(feature = "TVTopShelfObject")]
47extern_conformance!(
48 unsafe impl NSObjectProtocol for TVTopShelfItem {}
49);
50
51#[cfg(feature = "TVTopShelfObject")]
52impl TVTopShelfItem {
53 extern_methods!(
54 #[unsafe(method(identifier))]
58 #[unsafe(method_family = none)]
59 pub unsafe fn identifier(&self) -> Retained<NSString>;
60
61 #[cfg(feature = "TVTopShelfAction")]
62 #[unsafe(method(playAction))]
66 #[unsafe(method_family = none)]
67 pub unsafe fn playAction(&self) -> Option<Retained<TVTopShelfAction>>;
68
69 #[cfg(feature = "TVTopShelfAction")]
70 #[unsafe(method(setPlayAction:))]
72 #[unsafe(method_family = none)]
73 pub unsafe fn setPlayAction(&self, play_action: Option<&TVTopShelfAction>);
74
75 #[cfg(feature = "TVTopShelfAction")]
76 #[unsafe(method(displayAction))]
80 #[unsafe(method_family = none)]
81 pub unsafe fn displayAction(&self) -> Option<Retained<TVTopShelfAction>>;
82
83 #[cfg(feature = "TVTopShelfAction")]
84 #[unsafe(method(setDisplayAction:))]
86 #[unsafe(method_family = none)]
87 pub unsafe fn setDisplayAction(&self, display_action: Option<&TVTopShelfAction>);
88
89 #[unsafe(method(expirationDate))]
91 #[unsafe(method_family = none)]
92 pub unsafe fn expirationDate(&self) -> Option<Retained<NSDate>>;
93
94 #[unsafe(method(setExpirationDate:))]
98 #[unsafe(method_family = none)]
99 pub unsafe fn setExpirationDate(&self, expiration_date: Option<&NSDate>);
100
101 #[unsafe(method(setImageURL:forTraits:))]
105 #[unsafe(method_family = none)]
106 pub unsafe fn setImageURL_forTraits(
107 &self,
108 image_url: Option<&NSURL>,
109 traits: TVTopShelfItemImageTraits,
110 );
111
112 #[unsafe(method(imageURLForTraits:))]
116 #[unsafe(method_family = none)]
117 pub unsafe fn imageURLForTraits(
118 &self,
119 traits: TVTopShelfItemImageTraits,
120 ) -> Option<Retained<NSURL>>;
121
122 #[unsafe(method(initWithIdentifier:))]
126 #[unsafe(method_family = init)]
127 pub unsafe fn initWithIdentifier(
128 this: Allocated<Self>,
129 identifier: &NSString,
130 ) -> Retained<Self>;
131 );
132}
133
134#[cfg(feature = "TVTopShelfObject")]
136impl TVTopShelfItem {
137 extern_methods!(
138 #[unsafe(method(init))]
139 #[unsafe(method_family = init)]
140 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
141
142 #[unsafe(method(new))]
143 #[unsafe(method_family = new)]
144 pub unsafe fn new() -> Retained<Self>;
145 );
146}