objc2_tv_ui_kit/generated/
TVLockupView.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_protocol!(
16    /// Component views inside the lockup view may conform to this protocol in order to participate in the state changes of the containing lockup view by altering their appearances.
17    ///
18    /// See also [Apple's documentation](https://developer.apple.com/documentation/tvuikit/tvlockupviewcomponent?language=objc)
19    pub unsafe trait TVLockupViewComponent: NSObjectProtocol {
20        /// This is called when a lockup view's state changes.
21        ///
22        ///
23        /// If implemented, allows the lockup view's components to update their appearance when the lockup view's state changes. This will also be called on the components' subviews that conform to the protocol and implement the method.
24        ///
25        /// Parameter `state`: The state of the lockup view. Relevant values are .normal, .highlighted (for pressed state), .enabled, and .focused.
26        #[optional]
27        #[unsafe(method(updateAppearanceForLockupViewState:))]
28        #[unsafe(method_family = none)]
29        unsafe fn updateAppearanceForLockupViewState(&self, state: UIControlState);
30    }
31);
32
33extern_class!(
34    /// TVLockupView is a composed view specializing in presenting a main content, and optional header or footer.
35    ///
36    /// See also [Apple's documentation](https://developer.apple.com/documentation/tvuikit/tvlockupview?language=objc)
37    #[unsafe(super(UIControl, UIView, UIResponder, NSObject))]
38    #[derive(Debug, PartialEq, Eq, Hash)]
39    pub struct TVLockupView;
40);
41
42#[cfg(feature = "objc2-quartz-core")]
43extern_conformance!(
44    unsafe impl CALayerDelegate for TVLockupView {}
45);
46
47extern_conformance!(
48    unsafe impl NSCoding for TVLockupView {}
49);
50
51extern_conformance!(
52    unsafe impl NSObjectProtocol for TVLockupView {}
53);
54
55extern_conformance!(
56    unsafe impl UIAppearance for TVLockupView {}
57);
58
59extern_conformance!(
60    unsafe impl UIAppearanceContainer for TVLockupView {}
61);
62
63extern_conformance!(
64    unsafe impl UICoordinateSpace for TVLockupView {}
65);
66
67extern_conformance!(
68    unsafe impl UIDynamicItem for TVLockupView {}
69);
70
71extern_conformance!(
72    unsafe impl UIFocusEnvironment for TVLockupView {}
73);
74
75extern_conformance!(
76    unsafe impl UIFocusItem for TVLockupView {}
77);
78
79extern_conformance!(
80    unsafe impl UIFocusItemContainer for TVLockupView {}
81);
82
83extern_conformance!(
84    unsafe impl UIResponderStandardEditActions for TVLockupView {}
85);
86
87extern_conformance!(
88    unsafe impl UITraitEnvironment for TVLockupView {}
89);
90
91impl TVLockupView {
92    extern_methods!(
93        /// The container view where subviews are added.
94        ///
95        /// Clients should add their subviews to the contentView. Views added directly to the lockup view have undefined behaviors.
96        #[unsafe(method(contentView))]
97        #[unsafe(method_family = none)]
98        pub unsafe fn contentView(&self) -> Retained<UIView>;
99
100        #[cfg(feature = "objc2-core-foundation")]
101        /// The size of the content
102        ///
103        /// Clients can use this to explicitly set the size of the content. Default results in system default contentSize.
104        #[unsafe(method(contentSize))]
105        #[unsafe(method_family = none)]
106        pub unsafe fn contentSize(&self) -> CGSize;
107
108        #[cfg(feature = "objc2-core-foundation")]
109        /// Setter for [`contentSize`][Self::contentSize].
110        #[unsafe(method(setContentSize:))]
111        #[unsafe(method_family = none)]
112        pub unsafe fn setContentSize(&self, content_size: CGSize);
113
114        #[cfg(feature = "TVLockupHeaderFooterView")]
115        /// The optional header and footer views.
116        ///
117        /// Subclass TVLockupHeaderFooterView for additional customization.
118        #[unsafe(method(headerView))]
119        #[unsafe(method_family = none)]
120        pub unsafe fn headerView(&self) -> Option<Retained<TVLockupHeaderFooterView>>;
121
122        #[cfg(feature = "TVLockupHeaderFooterView")]
123        /// Setter for [`headerView`][Self::headerView].
124        #[unsafe(method(setHeaderView:))]
125        #[unsafe(method_family = none)]
126        pub unsafe fn setHeaderView(&self, header_view: Option<&TVLockupHeaderFooterView>);
127
128        #[cfg(feature = "TVLockupHeaderFooterView")]
129        #[unsafe(method(footerView))]
130        #[unsafe(method_family = none)]
131        pub unsafe fn footerView(&self) -> Option<Retained<TVLockupHeaderFooterView>>;
132
133        #[cfg(feature = "TVLockupHeaderFooterView")]
134        /// Setter for [`footerView`][Self::footerView].
135        #[unsafe(method(setFooterView:))]
136        #[unsafe(method_family = none)]
137        pub unsafe fn setFooterView(&self, footer_view: Option<&TVLockupHeaderFooterView>);
138
139        /// The spacing between the content view and its sibling and parent views
140        ///
141        /// .top and .bottom are spaces between the contentView and headerView and footerView, respectively. .leading and .trailing are between contentView and the lockup view itself. Use negative values for positive spacing.
142        #[unsafe(method(contentViewInsets))]
143        #[unsafe(method_family = none)]
144        pub unsafe fn contentViewInsets(&self) -> NSDirectionalEdgeInsets;
145
146        /// Setter for [`contentViewInsets`][Self::contentViewInsets].
147        #[unsafe(method(setContentViewInsets:))]
148        #[unsafe(method_family = none)]
149        pub unsafe fn setContentViewInsets(&self, content_view_insets: NSDirectionalEdgeInsets);
150
151        /// The size increase when the lockup view or its subview is in focus
152        ///
153        /// The amount by which headerView and footerView will move when the lockup view or its subview is in focus. Use negative values for positive increase.
154        #[unsafe(method(focusSizeIncrease))]
155        #[unsafe(method_family = none)]
156        pub unsafe fn focusSizeIncrease(&self) -> NSDirectionalEdgeInsets;
157
158        /// Setter for [`focusSizeIncrease`][Self::focusSizeIncrease].
159        #[unsafe(method(setFocusSizeIncrease:))]
160        #[unsafe(method_family = none)]
161        pub unsafe fn setFocusSizeIncrease(&self, focus_size_increase: NSDirectionalEdgeInsets);
162    );
163}
164
165/// Methods declared on superclass `UIControl`.
166impl TVLockupView {
167    extern_methods!(
168        #[cfg(feature = "objc2-core-foundation")]
169        #[unsafe(method(initWithFrame:))]
170        #[unsafe(method_family = init)]
171        pub unsafe fn initWithFrame(this: Allocated<Self>, frame: CGRect) -> Retained<Self>;
172
173        /// # Safety
174        ///
175        /// `coder` possibly has further requirements.
176        #[unsafe(method(initWithCoder:))]
177        #[unsafe(method_family = init)]
178        pub unsafe fn initWithCoder(
179            this: Allocated<Self>,
180            coder: &NSCoder,
181        ) -> Option<Retained<Self>>;
182
183        #[cfg(feature = "objc2-core-foundation")]
184        /// 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.
185        #[unsafe(method(initWithFrame:primaryAction:))]
186        #[unsafe(method_family = init)]
187        pub unsafe fn initWithFrame_primaryAction(
188            this: Allocated<Self>,
189            frame: CGRect,
190            primary_action: Option<&UIAction>,
191        ) -> Retained<Self>;
192    );
193}
194
195/// Methods declared on superclass `UIView`.
196impl TVLockupView {
197    extern_methods!(
198        #[unsafe(method(init))]
199        #[unsafe(method_family = init)]
200        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
201    );
202}
203
204/// Methods declared on superclass `NSObject`.
205impl TVLockupView {
206    extern_methods!(
207        #[unsafe(method(new))]
208        #[unsafe(method_family = new)]
209        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
210    );
211}