objc2_ui_kit/generated/
UITableViewHeaderFooterView.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")]
10#[cfg(not(target_os = "watchos"))]
11use objc2_quartz_core::*;
12
13use crate::*;
14
15/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitableviewheaderfooterviewconfigurationupdatehandler?language=objc)
16#[cfg(all(
17    feature = "UIResponder",
18    feature = "UIView",
19    feature = "UIViewConfigurationState",
20    feature = "block2"
21))]
22pub type UITableViewHeaderFooterViewConfigurationUpdateHandler = *mut block2::DynBlock<
23    dyn Fn(NonNull<UITableViewHeaderFooterView>, NonNull<UIViewConfigurationState>),
24>;
25
26extern_class!(
27    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitableviewheaderfooterview?language=objc)
28    #[unsafe(super(UIView, UIResponder, NSObject))]
29    #[thread_kind = MainThreadOnly]
30    #[derive(Debug, PartialEq, Eq, Hash)]
31    #[cfg(all(feature = "UIResponder", feature = "UIView"))]
32    pub struct UITableViewHeaderFooterView;
33);
34
35#[cfg(all(
36    feature = "UIResponder",
37    feature = "UIView",
38    feature = "objc2-quartz-core"
39))]
40#[cfg(not(target_os = "watchos"))]
41extern_conformance!(
42    unsafe impl CALayerDelegate for UITableViewHeaderFooterView {}
43);
44
45#[cfg(all(feature = "UIResponder", feature = "UIView"))]
46extern_conformance!(
47    unsafe impl NSCoding for UITableViewHeaderFooterView {}
48);
49
50#[cfg(all(feature = "UIResponder", feature = "UIView"))]
51extern_conformance!(
52    unsafe impl NSObjectProtocol for UITableViewHeaderFooterView {}
53);
54
55#[cfg(all(feature = "UIAppearance", feature = "UIResponder", feature = "UIView"))]
56extern_conformance!(
57    unsafe impl UIAppearance for UITableViewHeaderFooterView {}
58);
59
60#[cfg(all(feature = "UIAppearance", feature = "UIResponder", feature = "UIView"))]
61extern_conformance!(
62    unsafe impl UIAppearanceContainer for UITableViewHeaderFooterView {}
63);
64
65#[cfg(all(feature = "UIResponder", feature = "UIView"))]
66extern_conformance!(
67    unsafe impl UICoordinateSpace for UITableViewHeaderFooterView {}
68);
69
70#[cfg(all(
71    feature = "UIDynamicBehavior",
72    feature = "UIResponder",
73    feature = "UIView"
74))]
75extern_conformance!(
76    unsafe impl UIDynamicItem for UITableViewHeaderFooterView {}
77);
78
79#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
80extern_conformance!(
81    unsafe impl UIFocusEnvironment for UITableViewHeaderFooterView {}
82);
83
84#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
85extern_conformance!(
86    unsafe impl UIFocusItem for UITableViewHeaderFooterView {}
87);
88
89#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
90extern_conformance!(
91    unsafe impl UIFocusItemContainer for UITableViewHeaderFooterView {}
92);
93
94#[cfg(all(feature = "UIResponder", feature = "UIView"))]
95extern_conformance!(
96    unsafe impl UIResponderStandardEditActions for UITableViewHeaderFooterView {}
97);
98
99#[cfg(all(
100    feature = "UIResponder",
101    feature = "UITraitCollection",
102    feature = "UIView"
103))]
104extern_conformance!(
105    unsafe impl UITraitEnvironment for UITableViewHeaderFooterView {}
106);
107
108#[cfg(all(feature = "UIResponder", feature = "UIView"))]
109impl UITableViewHeaderFooterView {
110    extern_methods!(
111        #[unsafe(method(initWithReuseIdentifier:))]
112        #[unsafe(method_family = init)]
113        pub unsafe fn initWithReuseIdentifier(
114            this: Allocated<Self>,
115            reuse_identifier: Option<&NSString>,
116        ) -> Retained<Self>;
117
118        #[unsafe(method(initWithCoder:))]
119        #[unsafe(method_family = init)]
120        pub unsafe fn initWithCoder(
121            this: Allocated<Self>,
122            coder: &NSCoder,
123        ) -> Option<Retained<Self>>;
124
125        #[cfg(feature = "UIViewConfigurationState")]
126        /// Returns the current configuration state for the header/footer.
127        /// To add your own custom state(s), override the getter and call super to obtain an instance with the
128        /// system properties set, then set your own custom states as desired.
129        #[unsafe(method(configurationState))]
130        #[unsafe(method_family = none)]
131        pub unsafe fn configurationState(&self) -> Retained<UIViewConfigurationState>;
132
133        /// Requests the view update its configuration for its current state. This method is called automatically
134        /// when the view's `configurationState` may have changed, as well as in other circumstances where an
135        /// update may be required. Multiple requests may be coalesced into a single update at the appropriate time.
136        #[unsafe(method(setNeedsUpdateConfiguration))]
137        #[unsafe(method_family = none)]
138        pub unsafe fn setNeedsUpdateConfiguration(&self);
139
140        #[cfg(feature = "UIViewConfigurationState")]
141        /// Subclasses should override this method and update the view's configuration using the state provided.
142        /// This method should not be called directly, use `setNeedsUpdateConfiguration` to request an update.
143        #[unsafe(method(updateConfigurationUsingState:))]
144        #[unsafe(method_family = none)]
145        pub unsafe fn updateConfigurationUsingState(&self, state: &UIViewConfigurationState);
146
147        #[cfg(all(feature = "UIViewConfigurationState", feature = "block2"))]
148        /// Optional block-based alternative to overriding `-updateConfigurationUsingState:` in a subclass. This handler
149        /// is called after `-updateConfigurationUsingState:`. Setting a new handler triggers `setNeedsUpdateConfiguration`.
150        #[unsafe(method(configurationUpdateHandler))]
151        #[unsafe(method_family = none)]
152        pub unsafe fn configurationUpdateHandler(
153            &self,
154        ) -> UITableViewHeaderFooterViewConfigurationUpdateHandler;
155
156        #[cfg(all(feature = "UIViewConfigurationState", feature = "block2"))]
157        /// Setter for [`configurationUpdateHandler`][Self::configurationUpdateHandler].
158        #[unsafe(method(setConfigurationUpdateHandler:))]
159        #[unsafe(method_family = none)]
160        pub unsafe fn setConfigurationUpdateHandler(
161            &self,
162            configuration_update_handler: UITableViewHeaderFooterViewConfigurationUpdateHandler,
163        );
164
165        #[cfg(feature = "UIListContentConfiguration")]
166        /// Returns a default list content configuration for the header/footer view's style.
167        #[unsafe(method(defaultContentConfiguration))]
168        #[unsafe(method_family = none)]
169        pub unsafe fn defaultContentConfiguration(&self) -> Retained<UIListContentConfiguration>;
170
171        #[cfg(feature = "UIContentConfiguration")]
172        /// Setting a content configuration replaces the existing contentView of the header/footer with a new content view instance from the configuration,
173        /// or directly applies the configuration to the existing content view if the configuration is compatible with the existing content view type.
174        /// The default value is nil. After a configuration has been set, setting this property to nil will replace the current content view with a new content view.
175        #[unsafe(method(contentConfiguration))]
176        #[unsafe(method_family = none)]
177        pub unsafe fn contentConfiguration(
178            &self,
179        ) -> Option<Retained<ProtocolObject<dyn UIContentConfiguration>>>;
180
181        #[cfg(feature = "UIContentConfiguration")]
182        /// Setter for [`contentConfiguration`][Self::contentConfiguration].
183        #[unsafe(method(setContentConfiguration:))]
184        #[unsafe(method_family = none)]
185        pub unsafe fn setContentConfiguration(
186            &self,
187            content_configuration: Option<&ProtocolObject<dyn UIContentConfiguration>>,
188        );
189
190        /// When YES, the header/footer will automatically call -updatedConfigurationForState: on its `contentConfiguration` when the header/footer's
191        /// configuration state changes, and apply the updated configuration back to the header/footer. The default value is YES.
192        #[unsafe(method(automaticallyUpdatesContentConfiguration))]
193        #[unsafe(method_family = none)]
194        pub unsafe fn automaticallyUpdatesContentConfiguration(&self) -> bool;
195
196        /// Setter for [`automaticallyUpdatesContentConfiguration`][Self::automaticallyUpdatesContentConfiguration].
197        #[unsafe(method(setAutomaticallyUpdatesContentConfiguration:))]
198        #[unsafe(method_family = none)]
199        pub unsafe fn setAutomaticallyUpdatesContentConfiguration(
200            &self,
201            automatically_updates_content_configuration: bool,
202        );
203
204        #[unsafe(method(contentView))]
205        #[unsafe(method_family = none)]
206        pub unsafe fn contentView(&self) -> Retained<UIView>;
207
208        #[cfg(feature = "UILabel")]
209        #[deprecated = "Use UIListContentConfiguration instead, this property will be deprecated in a future release."]
210        #[unsafe(method(textLabel))]
211        #[unsafe(method_family = none)]
212        pub unsafe fn textLabel(&self) -> Option<Retained<UILabel>>;
213
214        #[cfg(feature = "UILabel")]
215        #[deprecated = "Use UIListContentConfiguration instead, this property will be deprecated in a future release."]
216        #[unsafe(method(detailTextLabel))]
217        #[unsafe(method_family = none)]
218        pub unsafe fn detailTextLabel(&self) -> Option<Retained<UILabel>>;
219
220        #[cfg(feature = "UIBackgroundConfiguration")]
221        /// Returns a default background configuration for the header/footer's style.
222        /// This background configuration represents the default appearance that the header/footer will use.
223        #[unsafe(method(defaultBackgroundConfiguration))]
224        #[unsafe(method_family = none)]
225        pub unsafe fn defaultBackgroundConfiguration(&self) -> Retained<UIBackgroundConfiguration>;
226
227        #[cfg(feature = "UIBackgroundConfiguration")]
228        /// Setting a background configuration supersedes the header/footer's backgroundView. The default value is nil.
229        #[unsafe(method(backgroundConfiguration))]
230        #[unsafe(method_family = none)]
231        pub unsafe fn backgroundConfiguration(&self)
232            -> Option<Retained<UIBackgroundConfiguration>>;
233
234        #[cfg(feature = "UIBackgroundConfiguration")]
235        /// Setter for [`backgroundConfiguration`][Self::backgroundConfiguration].
236        #[unsafe(method(setBackgroundConfiguration:))]
237        #[unsafe(method_family = none)]
238        pub unsafe fn setBackgroundConfiguration(
239            &self,
240            background_configuration: Option<&UIBackgroundConfiguration>,
241        );
242
243        /// When YES, the header/footer will automatically call -updatedConfigurationForState: on its `backgroundConfiguration` when the header/footer's
244        /// configuration state changes, and apply the updated configuration back to the header/footer. The default value is YES.
245        #[unsafe(method(automaticallyUpdatesBackgroundConfiguration))]
246        #[unsafe(method_family = none)]
247        pub unsafe fn automaticallyUpdatesBackgroundConfiguration(&self) -> bool;
248
249        /// Setter for [`automaticallyUpdatesBackgroundConfiguration`][Self::automaticallyUpdatesBackgroundConfiguration].
250        #[unsafe(method(setAutomaticallyUpdatesBackgroundConfiguration:))]
251        #[unsafe(method_family = none)]
252        pub unsafe fn setAutomaticallyUpdatesBackgroundConfiguration(
253            &self,
254            automatically_updates_background_configuration: bool,
255        );
256
257        #[unsafe(method(backgroundView))]
258        #[unsafe(method_family = none)]
259        pub unsafe fn backgroundView(&self) -> Option<Retained<UIView>>;
260
261        /// Setter for [`backgroundView`][Self::backgroundView].
262        #[unsafe(method(setBackgroundView:))]
263        #[unsafe(method_family = none)]
264        pub unsafe fn setBackgroundView(&self, background_view: Option<&UIView>);
265
266        #[unsafe(method(reuseIdentifier))]
267        #[unsafe(method_family = none)]
268        pub unsafe fn reuseIdentifier(&self) -> Option<Retained<NSString>>;
269
270        #[unsafe(method(prepareForReuse))]
271        #[unsafe(method_family = none)]
272        pub unsafe fn prepareForReuse(&self);
273    );
274}
275
276/// Methods declared on superclass `UIView`.
277#[cfg(all(feature = "UIResponder", feature = "UIView"))]
278impl UITableViewHeaderFooterView {
279    extern_methods!(
280        #[cfg(feature = "objc2-core-foundation")]
281        #[unsafe(method(initWithFrame:))]
282        #[unsafe(method_family = init)]
283        pub unsafe fn initWithFrame(this: Allocated<Self>, frame: CGRect) -> Retained<Self>;
284    );
285}
286
287/// Methods declared on superclass `NSObject`.
288#[cfg(all(feature = "UIResponder", feature = "UIView"))]
289impl UITableViewHeaderFooterView {
290    extern_methods!(
291        #[unsafe(method(init))]
292        #[unsafe(method_family = init)]
293        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
294
295        #[unsafe(method(new))]
296        #[unsafe(method_family = new)]
297        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
298    );
299}