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