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        #[unsafe(method(setTitle:))]
126        #[unsafe(method_family = none)]
127        pub unsafe fn setTitle(&self, title: Option<&NSString>);
128
129        /// The optional subtitle.
130        #[unsafe(method(subtitle))]
131        #[unsafe(method_family = none)]
132        pub unsafe fn subtitle(&self) -> Option<Retained<NSString>>;
133
134        /// Setter for [`subtitle`][Self::subtitle].
135        #[unsafe(method(setSubtitle:))]
136        #[unsafe(method_family = none)]
137        pub unsafe fn setSubtitle(&self, subtitle: Option<&NSString>);
138    );
139}
140
141/// Methods declared on superclass `UIControl`.
142#[cfg(feature = "TVLockupView")]
143impl TVPosterView {
144    extern_methods!(
145        #[cfg(feature = "objc2-core-foundation")]
146        #[unsafe(method(initWithFrame:))]
147        #[unsafe(method_family = init)]
148        pub unsafe fn initWithFrame(this: Allocated<Self>, frame: CGRect) -> Retained<Self>;
149
150        #[unsafe(method(initWithCoder:))]
151        #[unsafe(method_family = init)]
152        pub unsafe fn initWithCoder(
153            this: Allocated<Self>,
154            coder: &NSCoder,
155        ) -> Option<Retained<Self>>;
156
157        #[cfg(feature = "objc2-core-foundation")]
158        /// 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.
159        #[unsafe(method(initWithFrame:primaryAction:))]
160        #[unsafe(method_family = init)]
161        pub unsafe fn initWithFrame_primaryAction(
162            this: Allocated<Self>,
163            frame: CGRect,
164            primary_action: Option<&UIAction>,
165        ) -> Retained<Self>;
166    );
167}
168
169/// Methods declared on superclass `NSObject`.
170#[cfg(feature = "TVLockupView")]
171impl TVPosterView {
172    extern_methods!(
173        #[unsafe(method(init))]
174        #[unsafe(method_family = init)]
175        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
176
177        #[unsafe(method(new))]
178        #[unsafe(method_family = new)]
179        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
180    );
181}