objc2_tv_ui_kit/generated/
TVPosterView.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8use objc2_foundation::*;
9#[cfg(feature = "objc2-quartz-core")]
10use objc2_quartz_core::*;
11use objc2_ui_kit::*;
12
13use crate::*;
14
15extern_class!(
16    /// TVPosterView is a lockup view specializing in presenting an image and optional title and subtitle labels.
17    ///
18    /// The framework provides system default appearance and behavior, including the optimal .focusSizeIncrease, which is calculated based on the .image. Overriding .focusSizeIncrease has no visible effect.
19    ///
20    /// See also [Apple's documentation](https://developer.apple.com/documentation/tvuikit/tvposterview?language=objc)
21    #[unsafe(super(TVLockupView, UIControl, UIView, UIResponder, NSObject))]
22    #[derive(Debug, PartialEq, Eq, Hash)]
23    #[cfg(feature = "TVLockupView")]
24    pub struct TVPosterView;
25);
26
27#[cfg(all(feature = "TVLockupView", feature = "objc2-quartz-core"))]
28extern_conformance!(
29    unsafe impl CALayerDelegate for TVPosterView {}
30);
31
32#[cfg(feature = "TVLockupView")]
33extern_conformance!(
34    unsafe impl NSCoding for TVPosterView {}
35);
36
37#[cfg(feature = "TVLockupView")]
38extern_conformance!(
39    unsafe impl NSObjectProtocol for TVPosterView {}
40);
41
42#[cfg(feature = "TVLockupView")]
43extern_conformance!(
44    unsafe impl UIAppearance for TVPosterView {}
45);
46
47#[cfg(feature = "TVLockupView")]
48extern_conformance!(
49    unsafe impl UIAppearanceContainer for TVPosterView {}
50);
51
52#[cfg(feature = "TVLockupView")]
53extern_conformance!(
54    unsafe impl UICoordinateSpace for TVPosterView {}
55);
56
57#[cfg(feature = "TVLockupView")]
58extern_conformance!(
59    unsafe impl UIDynamicItem for TVPosterView {}
60);
61
62#[cfg(feature = "TVLockupView")]
63extern_conformance!(
64    unsafe impl UIFocusEnvironment for TVPosterView {}
65);
66
67#[cfg(feature = "TVLockupView")]
68extern_conformance!(
69    unsafe impl UIFocusItem for TVPosterView {}
70);
71
72#[cfg(feature = "TVLockupView")]
73extern_conformance!(
74    unsafe impl UIFocusItemContainer for TVPosterView {}
75);
76
77#[cfg(feature = "TVLockupView")]
78extern_conformance!(
79    unsafe impl UIResponderStandardEditActions for TVPosterView {}
80);
81
82#[cfg(feature = "TVLockupView")]
83extern_conformance!(
84    unsafe impl UITraitEnvironment for TVPosterView {}
85);
86
87#[cfg(feature = "TVLockupView")]
88impl TVPosterView {
89    extern_methods!(
90        /// A convenience initializer.
91        ///
92        /// Parameter `image`: The image to become the main content.
93        #[unsafe(method(initWithImage:))]
94        #[unsafe(method_family = init)]
95        pub unsafe fn initWithImage(
96            this: Allocated<Self>,
97            image: Option<&UIImage>,
98        ) -> Retained<Self>;
99
100        /// The image.
101        ///
102        /// When no frame or contentSize is explicitly set on the poster view, its size will be determined by the natural size of this image.
103        #[unsafe(method(image))]
104        #[unsafe(method_family = none)]
105        pub unsafe fn image(&self) -> Option<Retained<UIImage>>;
106
107        /// Setter for [`image`][Self::image].
108        #[unsafe(method(setImage:))]
109        #[unsafe(method_family = none)]
110        pub unsafe fn setImage(&self, image: Option<&UIImage>);
111
112        /// The image view.
113        ///
114        /// Avoid setting an image directly on the image view. Instead, always use the .image property of the poster view.
115        #[unsafe(method(imageView))]
116        #[unsafe(method_family = none)]
117        pub unsafe fn imageView(&self) -> Retained<UIImageView>;
118
119        /// The optional title.
120        #[unsafe(method(title))]
121        #[unsafe(method_family = none)]
122        pub unsafe fn title(&self) -> Option<Retained<NSString>>;
123
124        /// Setter for [`title`][Self::title].
125        ///
126        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
127        #[unsafe(method(setTitle:))]
128        #[unsafe(method_family = none)]
129        pub unsafe fn setTitle(&self, title: Option<&NSString>);
130
131        /// The optional subtitle.
132        #[unsafe(method(subtitle))]
133        #[unsafe(method_family = none)]
134        pub unsafe fn subtitle(&self) -> Option<Retained<NSString>>;
135
136        /// Setter for [`subtitle`][Self::subtitle].
137        ///
138        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
139        #[unsafe(method(setSubtitle:))]
140        #[unsafe(method_family = none)]
141        pub unsafe fn setSubtitle(&self, subtitle: Option<&NSString>);
142    );
143}
144
145/// Methods declared on superclass `UIControl`.
146#[cfg(feature = "TVLockupView")]
147impl TVPosterView {
148    extern_methods!(
149        #[cfg(feature = "objc2-core-foundation")]
150        #[unsafe(method(initWithFrame:))]
151        #[unsafe(method_family = init)]
152        pub unsafe fn initWithFrame(this: Allocated<Self>, frame: CGRect) -> Retained<Self>;
153
154        /// # Safety
155        ///
156        /// `coder` possibly has further requirements.
157        #[unsafe(method(initWithCoder:))]
158        #[unsafe(method_family = init)]
159        pub unsafe fn initWithCoder(
160            this: Allocated<Self>,
161            coder: &NSCoder,
162        ) -> Option<Retained<Self>>;
163
164        #[cfg(feature = "objc2-core-foundation")]
165        /// Initializes the control and adds primaryAction for the UIControlEventPrimaryActionTriggered control event. Subclasses of UIControl may alter or add behaviors around the usage of primaryAction, see subclass documentation of this initializer for additional information.
166        #[unsafe(method(initWithFrame:primaryAction:))]
167        #[unsafe(method_family = init)]
168        pub unsafe fn initWithFrame_primaryAction(
169            this: Allocated<Self>,
170            frame: CGRect,
171            primary_action: Option<&UIAction>,
172        ) -> Retained<Self>;
173    );
174}
175
176/// Methods declared on superclass `UIView`.
177#[cfg(feature = "TVLockupView")]
178impl TVPosterView {
179    extern_methods!(
180        #[unsafe(method(init))]
181        #[unsafe(method_family = init)]
182        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
183    );
184}
185
186/// Methods declared on superclass `NSObject`.
187#[cfg(feature = "TVLockupView")]
188impl TVPosterView {
189    extern_methods!(
190        #[unsafe(method(new))]
191        #[unsafe(method_family = new)]
192        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
193    );
194}