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 fn initWithReuseIdentifier(
114            this: Allocated<Self>,
115            reuse_identifier: Option<&NSString>,
116        ) -> Retained<Self>;
117
118        /// # Safety
119        ///
120        /// `coder` possibly has further requirements.
121        #[unsafe(method(initWithCoder:))]
122        #[unsafe(method_family = init)]
123        pub unsafe fn initWithCoder(
124            this: Allocated<Self>,
125            coder: &NSCoder,
126        ) -> Option<Retained<Self>>;
127
128        #[cfg(feature = "UIViewConfigurationState")]
129        /// Returns the current configuration state for the header/footer.
130        /// To add your own custom state(s), override the getter and call super to obtain an instance with the
131        /// system properties set, then set your own custom states as desired.
132        #[unsafe(method(configurationState))]
133        #[unsafe(method_family = none)]
134        pub fn configurationState(&self) -> Retained<UIViewConfigurationState>;
135
136        /// Requests the view update its configuration for its current state. This method is called automatically
137        /// when the view's `configurationState` may have changed, as well as in other circumstances where an
138        /// update may be required. Multiple requests may be coalesced into a single update at the appropriate time.
139        #[unsafe(method(setNeedsUpdateConfiguration))]
140        #[unsafe(method_family = none)]
141        pub fn setNeedsUpdateConfiguration(&self);
142
143        #[cfg(feature = "UIViewConfigurationState")]
144        /// Subclasses should override this method and update the view's configuration using the state provided.
145        /// This method should not be called directly, use `setNeedsUpdateConfiguration` to request an update.
146        #[unsafe(method(updateConfigurationUsingState:))]
147        #[unsafe(method_family = none)]
148        pub fn updateConfigurationUsingState(&self, state: &UIViewConfigurationState);
149
150        #[cfg(all(feature = "UIViewConfigurationState", feature = "block2"))]
151        /// Optional block-based alternative to overriding `-updateConfigurationUsingState:` in a subclass. This handler
152        /// is called after `-updateConfigurationUsingState:`. Setting a new handler triggers `setNeedsUpdateConfiguration`.
153        ///
154        /// # Safety
155        ///
156        /// - The returned block's argument 1 must be a valid pointer.
157        /// - The returned block's argument 2 must be a valid pointer.
158        #[unsafe(method(configurationUpdateHandler))]
159        #[unsafe(method_family = none)]
160        pub unsafe fn configurationUpdateHandler(
161            &self,
162        ) -> UITableViewHeaderFooterViewConfigurationUpdateHandler;
163
164        #[cfg(all(feature = "UIViewConfigurationState", feature = "block2"))]
165        /// Setter for [`configurationUpdateHandler`][Self::configurationUpdateHandler].
166        ///
167        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
168        ///
169        /// # Safety
170        ///
171        /// `configuration_update_handler` must be a valid pointer or null.
172        #[unsafe(method(setConfigurationUpdateHandler:))]
173        #[unsafe(method_family = none)]
174        pub unsafe fn setConfigurationUpdateHandler(
175            &self,
176            configuration_update_handler: UITableViewHeaderFooterViewConfigurationUpdateHandler,
177        );
178
179        #[cfg(feature = "UIListContentConfiguration")]
180        /// Returns a default list content configuration for the header/footer view's style.
181        #[unsafe(method(defaultContentConfiguration))]
182        #[unsafe(method_family = none)]
183        pub fn defaultContentConfiguration(&self) -> Retained<UIListContentConfiguration>;
184
185        #[cfg(feature = "UIContentConfiguration")]
186        /// Setting a content configuration replaces the existing contentView of the header/footer with a new content view instance from the configuration,
187        /// or directly applies the configuration to the existing content view if the configuration is compatible with the existing content view type.
188        /// 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.
189        #[unsafe(method(contentConfiguration))]
190        #[unsafe(method_family = none)]
191        pub fn contentConfiguration(
192            &self,
193        ) -> Option<Retained<ProtocolObject<dyn UIContentConfiguration>>>;
194
195        #[cfg(feature = "UIContentConfiguration")]
196        /// Setter for [`contentConfiguration`][Self::contentConfiguration].
197        ///
198        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
199        #[unsafe(method(setContentConfiguration:))]
200        #[unsafe(method_family = none)]
201        pub fn setContentConfiguration(
202            &self,
203            content_configuration: Option<&ProtocolObject<dyn UIContentConfiguration>>,
204        );
205
206        /// When YES, the header/footer will automatically call -updatedConfigurationForState: on its `contentConfiguration` when the header/footer's
207        /// configuration state changes, and apply the updated configuration back to the header/footer. The default value is YES.
208        #[unsafe(method(automaticallyUpdatesContentConfiguration))]
209        #[unsafe(method_family = none)]
210        pub fn automaticallyUpdatesContentConfiguration(&self) -> bool;
211
212        /// Setter for [`automaticallyUpdatesContentConfiguration`][Self::automaticallyUpdatesContentConfiguration].
213        #[unsafe(method(setAutomaticallyUpdatesContentConfiguration:))]
214        #[unsafe(method_family = none)]
215        pub fn setAutomaticallyUpdatesContentConfiguration(
216            &self,
217            automatically_updates_content_configuration: bool,
218        );
219
220        #[unsafe(method(contentView))]
221        #[unsafe(method_family = none)]
222        pub fn contentView(&self) -> Retained<UIView>;
223
224        #[cfg(feature = "UILabel")]
225        #[deprecated = "Use UIListContentConfiguration instead, this property will be deprecated in a future release."]
226        #[unsafe(method(textLabel))]
227        #[unsafe(method_family = none)]
228        pub fn textLabel(&self) -> Option<Retained<UILabel>>;
229
230        #[cfg(feature = "UILabel")]
231        #[deprecated = "Use UIListContentConfiguration instead, this property will be deprecated in a future release."]
232        #[unsafe(method(detailTextLabel))]
233        #[unsafe(method_family = none)]
234        pub fn detailTextLabel(&self) -> Option<Retained<UILabel>>;
235
236        #[cfg(feature = "UIBackgroundConfiguration")]
237        /// Returns a default background configuration for the header/footer's style.
238        /// This background configuration represents the default appearance that the header/footer will use.
239        #[unsafe(method(defaultBackgroundConfiguration))]
240        #[unsafe(method_family = none)]
241        pub fn defaultBackgroundConfiguration(&self) -> Retained<UIBackgroundConfiguration>;
242
243        #[cfg(feature = "UIBackgroundConfiguration")]
244        /// Setting a background configuration supersedes the header/footer's backgroundView. The default value is nil.
245        #[unsafe(method(backgroundConfiguration))]
246        #[unsafe(method_family = none)]
247        pub fn backgroundConfiguration(&self) -> Option<Retained<UIBackgroundConfiguration>>;
248
249        #[cfg(feature = "UIBackgroundConfiguration")]
250        /// Setter for [`backgroundConfiguration`][Self::backgroundConfiguration].
251        ///
252        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
253        #[unsafe(method(setBackgroundConfiguration:))]
254        #[unsafe(method_family = none)]
255        pub fn setBackgroundConfiguration(
256            &self,
257            background_configuration: Option<&UIBackgroundConfiguration>,
258        );
259
260        /// When YES, the header/footer will automatically call -updatedConfigurationForState: on its `backgroundConfiguration` when the header/footer's
261        /// configuration state changes, and apply the updated configuration back to the header/footer. The default value is YES.
262        #[unsafe(method(automaticallyUpdatesBackgroundConfiguration))]
263        #[unsafe(method_family = none)]
264        pub fn automaticallyUpdatesBackgroundConfiguration(&self) -> bool;
265
266        /// Setter for [`automaticallyUpdatesBackgroundConfiguration`][Self::automaticallyUpdatesBackgroundConfiguration].
267        #[unsafe(method(setAutomaticallyUpdatesBackgroundConfiguration:))]
268        #[unsafe(method_family = none)]
269        pub fn setAutomaticallyUpdatesBackgroundConfiguration(
270            &self,
271            automatically_updates_background_configuration: bool,
272        );
273
274        #[unsafe(method(backgroundView))]
275        #[unsafe(method_family = none)]
276        pub fn backgroundView(&self) -> Option<Retained<UIView>>;
277
278        /// Setter for [`backgroundView`][Self::backgroundView].
279        #[unsafe(method(setBackgroundView:))]
280        #[unsafe(method_family = none)]
281        pub fn setBackgroundView(&self, background_view: Option<&UIView>);
282
283        #[unsafe(method(reuseIdentifier))]
284        #[unsafe(method_family = none)]
285        pub fn reuseIdentifier(&self) -> Option<Retained<NSString>>;
286
287        #[unsafe(method(prepareForReuse))]
288        #[unsafe(method_family = none)]
289        pub fn prepareForReuse(&self);
290    );
291}
292
293/// Methods declared on superclass `UIView`.
294#[cfg(all(feature = "UIResponder", feature = "UIView"))]
295impl UITableViewHeaderFooterView {
296    extern_methods!(
297        #[cfg(feature = "objc2-core-foundation")]
298        #[unsafe(method(initWithFrame:))]
299        #[unsafe(method_family = init)]
300        pub fn initWithFrame(this: Allocated<Self>, frame: CGRect) -> Retained<Self>;
301
302        #[unsafe(method(init))]
303        #[unsafe(method_family = init)]
304        pub fn init(this: Allocated<Self>) -> Retained<Self>;
305    );
306}
307
308/// Methods declared on superclass `NSObject`.
309#[cfg(all(feature = "UIResponder", feature = "UIView"))]
310impl UITableViewHeaderFooterView {
311    extern_methods!(
312        #[unsafe(method(new))]
313        #[unsafe(method_family = new)]
314        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
315    );
316}