objc2_ui_kit/generated/
UIButtonConfiguration.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
10use crate::*;
11
12/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiconfigurationtextattributestransformer?language=objc)
13#[cfg(feature = "block2")]
14pub type UIConfigurationTextAttributesTransformer = *mut block2::Block<
15    dyn Fn(
16        NonNull<NSDictionary<NSAttributedStringKey, AnyObject>>,
17    ) -> NonNull<NSDictionary<NSAttributedStringKey, AnyObject>>,
18>;
19
20/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uibuttonconfigurationsize?language=objc)
21// NS_ENUM
22#[repr(transparent)]
23#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
24pub struct UIButtonConfigurationSize(pub NSInteger);
25impl UIButtonConfigurationSize {
26    #[doc(alias = "UIButtonConfigurationSizeMedium")]
27    pub const Medium: Self = Self(0);
28    #[doc(alias = "UIButtonConfigurationSizeSmall")]
29    pub const Small: Self = Self(1);
30    #[doc(alias = "UIButtonConfigurationSizeMini")]
31    pub const Mini: Self = Self(2);
32    #[doc(alias = "UIButtonConfigurationSizeLarge")]
33    pub const Large: Self = Self(3);
34}
35
36unsafe impl Encode for UIButtonConfigurationSize {
37    const ENCODING: Encoding = NSInteger::ENCODING;
38}
39
40unsafe impl RefEncode for UIButtonConfigurationSize {
41    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
42}
43
44/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uibuttonconfigurationtitlealignment?language=objc)
45// NS_ENUM
46#[repr(transparent)]
47#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
48pub struct UIButtonConfigurationTitleAlignment(pub NSInteger);
49impl UIButtonConfigurationTitleAlignment {
50    /// Align title
51    /// &
52    /// subtitle automatically
53    #[doc(alias = "UIButtonConfigurationTitleAlignmentAutomatic")]
54    pub const Automatic: Self = Self(0);
55    /// Align title
56    /// &
57    /// subtitle along their leading edges
58    #[doc(alias = "UIButtonConfigurationTitleAlignmentLeading")]
59    pub const Leading: Self = Self(1);
60    /// Align title
61    /// &
62    /// subtitle to be centered with respect to each other
63    #[doc(alias = "UIButtonConfigurationTitleAlignmentCenter")]
64    pub const Center: Self = Self(2);
65    /// Align title
66    /// &
67    /// subtitle along their trailing edges
68    #[doc(alias = "UIButtonConfigurationTitleAlignmentTrailing")]
69    pub const Trailing: Self = Self(3);
70}
71
72unsafe impl Encode for UIButtonConfigurationTitleAlignment {
73    const ENCODING: Encoding = NSInteger::ENCODING;
74}
75
76unsafe impl RefEncode for UIButtonConfigurationTitleAlignment {
77    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
78}
79
80/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uibuttonconfigurationcornerstyle?language=objc)
81// NS_ENUM
82#[repr(transparent)]
83#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
84pub struct UIButtonConfigurationCornerStyle(pub NSInteger);
85impl UIButtonConfigurationCornerStyle {
86    /// The corner radius provided by the background style will be used as is, without adjusting for dynamic type
87    #[doc(alias = "UIButtonConfigurationCornerStyleFixed")]
88    pub const Fixed: Self = Self(-1);
89    /// The corner radius provided by the background style is adjusted based on dynamic type
90    #[doc(alias = "UIButtonConfigurationCornerStyleDynamic")]
91    pub const Dynamic: Self = Self(0);
92    /// Ignore the corner radius provided by the background style and substitute a small system defined corner radius.
93    #[doc(alias = "UIButtonConfigurationCornerStyleSmall")]
94    pub const Small: Self = Self(1);
95    /// Ignore the corner radius provided by the background style and substitute a medium system defined corner radius.
96    #[doc(alias = "UIButtonConfigurationCornerStyleMedium")]
97    pub const Medium: Self = Self(2);
98    /// Ignore the corner radius provided by the background style and substitute a large system defined corner radius.
99    #[doc(alias = "UIButtonConfigurationCornerStyleLarge")]
100    pub const Large: Self = Self(3);
101    /// Ignore the corner radius provided by the background style and always set the corner radius to generate a capsule.
102    #[doc(alias = "UIButtonConfigurationCornerStyleCapsule")]
103    pub const Capsule: Self = Self(4);
104}
105
106unsafe impl Encode for UIButtonConfigurationCornerStyle {
107    const ENCODING: Encoding = NSInteger::ENCODING;
108}
109
110unsafe impl RefEncode for UIButtonConfigurationCornerStyle {
111    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
112}
113
114/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uibuttonconfigurationmacidiomstyle?language=objc)
115// NS_ENUM
116#[repr(transparent)]
117#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
118pub struct UIButtonConfigurationMacIdiomStyle(pub NSInteger);
119impl UIButtonConfigurationMacIdiomStyle {
120    /// Automatically select the style to use
121    #[doc(alias = "UIButtonConfigurationMacIdiomStyleAutomatic")]
122    pub const Automatic: Self = Self(0);
123    /// Always use a bordered style button
124    #[doc(alias = "UIButtonConfigurationMacIdiomStyleBordered")]
125    pub const Bordered: Self = Self(1);
126    /// Always use a borderless style button
127    #[doc(alias = "UIButtonConfigurationMacIdiomStyleBorderless")]
128    pub const Borderless: Self = Self(2);
129    /// Always use a tinted, borderless style button
130    #[doc(alias = "UIButtonConfigurationMacIdiomStyleBorderlessTinted")]
131    pub const BorderlessTinted: Self = Self(3);
132}
133
134unsafe impl Encode for UIButtonConfigurationMacIdiomStyle {
135    const ENCODING: Encoding = NSInteger::ENCODING;
136}
137
138unsafe impl RefEncode for UIButtonConfigurationMacIdiomStyle {
139    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
140}
141
142/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uibuttonconfigurationindicator?language=objc)
143// NS_ENUM
144#[repr(transparent)]
145#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
146pub struct UIButtonConfigurationIndicator(pub NSInteger);
147impl UIButtonConfigurationIndicator {
148    /// Automatically determine an indicator based on the button's properties.
149    #[doc(alias = "UIButtonConfigurationIndicatorAutomatic")]
150    pub const Automatic: Self = Self(0);
151    /// Don't show any indicator
152    #[doc(alias = "UIButtonConfigurationIndicatorNone")]
153    pub const None: Self = Self(1);
154    /// Show an indicator appropriate for a popup-style button
155    #[doc(alias = "UIButtonConfigurationIndicatorPopup")]
156    pub const Popup: Self = Self(2);
157}
158
159unsafe impl Encode for UIButtonConfigurationIndicator {
160    const ENCODING: Encoding = NSInteger::ENCODING;
161}
162
163unsafe impl RefEncode for UIButtonConfigurationIndicator {
164    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
165}
166
167extern_class!(
168    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uibuttonconfiguration?language=objc)
169    #[unsafe(super(NSObject))]
170    #[thread_kind = MainThreadOnly]
171    #[derive(Debug, PartialEq, Eq, Hash)]
172    pub struct UIButtonConfiguration;
173);
174
175unsafe impl NSCoding for UIButtonConfiguration {}
176
177unsafe impl NSCopying for UIButtonConfiguration {}
178
179unsafe impl CopyingHelper for UIButtonConfiguration {
180    type Result = Self;
181}
182
183unsafe impl NSObjectProtocol for UIButtonConfiguration {}
184
185unsafe impl NSSecureCoding for UIButtonConfiguration {}
186
187impl UIButtonConfiguration {
188    extern_methods!(
189        #[unsafe(method(plainButtonConfiguration))]
190        #[unsafe(method_family = none)]
191        pub unsafe fn plainButtonConfiguration(mtm: MainThreadMarker) -> Retained<Self>;
192
193        #[unsafe(method(tintedButtonConfiguration))]
194        #[unsafe(method_family = none)]
195        pub unsafe fn tintedButtonConfiguration(mtm: MainThreadMarker) -> Retained<Self>;
196
197        #[unsafe(method(grayButtonConfiguration))]
198        #[unsafe(method_family = none)]
199        pub unsafe fn grayButtonConfiguration(mtm: MainThreadMarker) -> Retained<Self>;
200
201        #[unsafe(method(filledButtonConfiguration))]
202        #[unsafe(method_family = none)]
203        pub unsafe fn filledButtonConfiguration(mtm: MainThreadMarker) -> Retained<Self>;
204
205        #[unsafe(method(borderlessButtonConfiguration))]
206        #[unsafe(method_family = none)]
207        pub unsafe fn borderlessButtonConfiguration(mtm: MainThreadMarker) -> Retained<Self>;
208
209        #[unsafe(method(borderedButtonConfiguration))]
210        #[unsafe(method_family = none)]
211        pub unsafe fn borderedButtonConfiguration(mtm: MainThreadMarker) -> Retained<Self>;
212
213        #[unsafe(method(borderedTintedButtonConfiguration))]
214        #[unsafe(method_family = none)]
215        pub unsafe fn borderedTintedButtonConfiguration(mtm: MainThreadMarker) -> Retained<Self>;
216
217        #[unsafe(method(borderedProminentButtonConfiguration))]
218        #[unsafe(method_family = none)]
219        pub unsafe fn borderedProminentButtonConfiguration(mtm: MainThreadMarker)
220            -> Retained<Self>;
221
222        #[unsafe(method(new))]
223        #[unsafe(method_family = new)]
224        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
225
226        #[unsafe(method(init))]
227        #[unsafe(method_family = init)]
228        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
229
230        #[cfg(all(
231            feature = "UIButton",
232            feature = "UIControl",
233            feature = "UIResponder",
234            feature = "UIView"
235        ))]
236        /// Returns a copy of the configuration updated based on the given button, by applying the configuration's default values for that button's state to any properties that have not been customized.
237        #[unsafe(method(updatedConfigurationForButton:))]
238        #[unsafe(method_family = none)]
239        pub unsafe fn updatedConfigurationForButton(&self, button: &UIButton) -> Retained<Self>;
240
241        #[cfg(feature = "UIBackgroundConfiguration")]
242        /// A UIBackgroundConfiguration describing the button's background. UIKit provides a value by default with values appropriate for a UIButton.
243        #[unsafe(method(background))]
244        #[unsafe(method_family = none)]
245        pub unsafe fn background(&self) -> Retained<UIBackgroundConfiguration>;
246
247        #[cfg(feature = "UIBackgroundConfiguration")]
248        /// Setter for [`background`][Self::background].
249        #[unsafe(method(setBackground:))]
250        #[unsafe(method_family = none)]
251        pub unsafe fn setBackground(&self, background: &UIBackgroundConfiguration);
252
253        /// The corner style controls how background.cornerRadius is interpreted by the button. Defaults to `Dynamic`.
254        #[unsafe(method(cornerStyle))]
255        #[unsafe(method_family = none)]
256        pub unsafe fn cornerStyle(&self) -> UIButtonConfigurationCornerStyle;
257
258        /// Setter for [`cornerStyle`][Self::cornerStyle].
259        #[unsafe(method(setCornerStyle:))]
260        #[unsafe(method_family = none)]
261        pub unsafe fn setCornerStyle(&self, corner_style: UIButtonConfigurationCornerStyle);
262
263        /// Determines the metrics and ideal size of the button. Clients may resize the button arbitrarily regardless of this value.
264        #[unsafe(method(buttonSize))]
265        #[unsafe(method_family = none)]
266        pub unsafe fn buttonSize(&self) -> UIButtonConfigurationSize;
267
268        /// Setter for [`buttonSize`][Self::buttonSize].
269        #[unsafe(method(setButtonSize:))]
270        #[unsafe(method_family = none)]
271        pub unsafe fn setButtonSize(&self, button_size: UIButtonConfigurationSize);
272
273        #[unsafe(method(macIdiomStyle))]
274        #[unsafe(method_family = none)]
275        pub unsafe fn macIdiomStyle(&self) -> UIButtonConfigurationMacIdiomStyle;
276
277        /// Setter for [`macIdiomStyle`][Self::macIdiomStyle].
278        #[unsafe(method(setMacIdiomStyle:))]
279        #[unsafe(method_family = none)]
280        pub unsafe fn setMacIdiomStyle(&self, mac_idiom_style: UIButtonConfigurationMacIdiomStyle);
281
282        #[cfg(feature = "UIColor")]
283        /// The base color to use for foreground elements. This color may be modified before being passed to a transformer, and finally applied to specific elements. Setting nil will cede full control to the configuration to select a color appropriate to the style.
284        #[unsafe(method(baseForegroundColor))]
285        #[unsafe(method_family = none)]
286        pub unsafe fn baseForegroundColor(&self) -> Option<Retained<UIColor>>;
287
288        #[cfg(feature = "UIColor")]
289        /// Setter for [`baseForegroundColor`][Self::baseForegroundColor].
290        #[unsafe(method(setBaseForegroundColor:))]
291        #[unsafe(method_family = none)]
292        pub unsafe fn setBaseForegroundColor(&self, base_foreground_color: Option<&UIColor>);
293
294        #[cfg(feature = "UIColor")]
295        /// The base color to use for background elements. This color may be modified before being passed to a transformer, and finally applied to specific elements. Setting nil will cede full control to the configuration to select a color appropriate to the style.
296        #[unsafe(method(baseBackgroundColor))]
297        #[unsafe(method_family = none)]
298        pub unsafe fn baseBackgroundColor(&self) -> Option<Retained<UIColor>>;
299
300        #[cfg(feature = "UIColor")]
301        /// Setter for [`baseBackgroundColor`][Self::baseBackgroundColor].
302        #[unsafe(method(setBaseBackgroundColor:))]
303        #[unsafe(method_family = none)]
304        pub unsafe fn setBaseBackgroundColor(&self, base_background_color: Option<&UIColor>);
305
306        #[cfg(feature = "UIImage")]
307        #[unsafe(method(image))]
308        #[unsafe(method_family = none)]
309        pub unsafe fn image(&self) -> Option<Retained<UIImage>>;
310
311        #[cfg(feature = "UIImage")]
312        /// Setter for [`image`][Self::image].
313        #[unsafe(method(setImage:))]
314        #[unsafe(method_family = none)]
315        pub unsafe fn setImage(&self, image: Option<&UIImage>);
316
317        #[cfg(all(
318            feature = "UIColor",
319            feature = "UIConfigurationColorTransformer",
320            feature = "block2"
321        ))]
322        #[unsafe(method(imageColorTransformer))]
323        #[unsafe(method_family = none)]
324        pub unsafe fn imageColorTransformer(&self) -> UIConfigurationColorTransformer;
325
326        #[cfg(all(
327            feature = "UIColor",
328            feature = "UIConfigurationColorTransformer",
329            feature = "block2"
330        ))]
331        /// Setter for [`imageColorTransformer`][Self::imageColorTransformer].
332        #[unsafe(method(setImageColorTransformer:))]
333        #[unsafe(method_family = none)]
334        pub unsafe fn setImageColorTransformer(
335            &self,
336            image_color_transformer: UIConfigurationColorTransformer,
337        );
338
339        #[cfg(all(
340            feature = "UIImageConfiguration",
341            feature = "UIImageSymbolConfiguration"
342        ))]
343        #[unsafe(method(preferredSymbolConfigurationForImage))]
344        #[unsafe(method_family = none)]
345        pub unsafe fn preferredSymbolConfigurationForImage(
346            &self,
347        ) -> Option<Retained<UIImageSymbolConfiguration>>;
348
349        #[cfg(all(
350            feature = "UIImageConfiguration",
351            feature = "UIImageSymbolConfiguration"
352        ))]
353        /// Setter for [`preferredSymbolConfigurationForImage`][Self::preferredSymbolConfigurationForImage].
354        #[unsafe(method(setPreferredSymbolConfigurationForImage:))]
355        #[unsafe(method_family = none)]
356        pub unsafe fn setPreferredSymbolConfigurationForImage(
357            &self,
358            preferred_symbol_configuration_for_image: Option<&UIImageSymbolConfiguration>,
359        );
360
361        /// Shows an activity indicator in place of an image. Its placement is controlled by the imagePlacement property.
362        #[unsafe(method(showsActivityIndicator))]
363        #[unsafe(method_family = none)]
364        pub unsafe fn showsActivityIndicator(&self) -> bool;
365
366        /// Setter for [`showsActivityIndicator`][Self::showsActivityIndicator].
367        #[unsafe(method(setShowsActivityIndicator:))]
368        #[unsafe(method_family = none)]
369        pub unsafe fn setShowsActivityIndicator(&self, shows_activity_indicator: bool);
370
371        #[cfg(all(
372            feature = "UIColor",
373            feature = "UIConfigurationColorTransformer",
374            feature = "block2"
375        ))]
376        #[unsafe(method(activityIndicatorColorTransformer))]
377        #[unsafe(method_family = none)]
378        pub unsafe fn activityIndicatorColorTransformer(&self) -> UIConfigurationColorTransformer;
379
380        #[cfg(all(
381            feature = "UIColor",
382            feature = "UIConfigurationColorTransformer",
383            feature = "block2"
384        ))]
385        /// Setter for [`activityIndicatorColorTransformer`][Self::activityIndicatorColorTransformer].
386        #[unsafe(method(setActivityIndicatorColorTransformer:))]
387        #[unsafe(method_family = none)]
388        pub unsafe fn setActivityIndicatorColorTransformer(
389            &self,
390            activity_indicator_color_transformer: UIConfigurationColorTransformer,
391        );
392
393        #[unsafe(method(title))]
394        #[unsafe(method_family = none)]
395        pub unsafe fn title(&self) -> Option<Retained<NSString>>;
396
397        /// Setter for [`title`][Self::title].
398        #[unsafe(method(setTitle:))]
399        #[unsafe(method_family = none)]
400        pub unsafe fn setTitle(&self, title: Option<&NSString>);
401
402        #[unsafe(method(attributedTitle))]
403        #[unsafe(method_family = none)]
404        pub unsafe fn attributedTitle(&self) -> Option<Retained<NSAttributedString>>;
405
406        /// Setter for [`attributedTitle`][Self::attributedTitle].
407        #[unsafe(method(setAttributedTitle:))]
408        #[unsafe(method_family = none)]
409        pub unsafe fn setAttributedTitle(&self, attributed_title: Option<&NSAttributedString>);
410
411        #[cfg(feature = "block2")]
412        #[unsafe(method(titleTextAttributesTransformer))]
413        #[unsafe(method_family = none)]
414        pub unsafe fn titleTextAttributesTransformer(
415            &self,
416        ) -> UIConfigurationTextAttributesTransformer;
417
418        #[cfg(feature = "block2")]
419        /// Setter for [`titleTextAttributesTransformer`][Self::titleTextAttributesTransformer].
420        #[unsafe(method(setTitleTextAttributesTransformer:))]
421        #[unsafe(method_family = none)]
422        pub unsafe fn setTitleTextAttributesTransformer(
423            &self,
424            title_text_attributes_transformer: UIConfigurationTextAttributesTransformer,
425        );
426
427        #[cfg(feature = "NSParagraphStyle")]
428        /// Default is WordWrapping. WordWrapping and CharWrapping both allow for multi-line text, other modes will restrict the title to a single line of text.
429        #[unsafe(method(titleLineBreakMode))]
430        #[unsafe(method_family = none)]
431        pub unsafe fn titleLineBreakMode(&self) -> NSLineBreakMode;
432
433        #[cfg(feature = "NSParagraphStyle")]
434        /// Setter for [`titleLineBreakMode`][Self::titleLineBreakMode].
435        #[unsafe(method(setTitleLineBreakMode:))]
436        #[unsafe(method_family = none)]
437        pub unsafe fn setTitleLineBreakMode(&self, title_line_break_mode: NSLineBreakMode);
438
439        #[unsafe(method(subtitle))]
440        #[unsafe(method_family = none)]
441        pub unsafe fn subtitle(&self) -> Option<Retained<NSString>>;
442
443        /// Setter for [`subtitle`][Self::subtitle].
444        #[unsafe(method(setSubtitle:))]
445        #[unsafe(method_family = none)]
446        pub unsafe fn setSubtitle(&self, subtitle: Option<&NSString>);
447
448        #[unsafe(method(attributedSubtitle))]
449        #[unsafe(method_family = none)]
450        pub unsafe fn attributedSubtitle(&self) -> Option<Retained<NSAttributedString>>;
451
452        /// Setter for [`attributedSubtitle`][Self::attributedSubtitle].
453        #[unsafe(method(setAttributedSubtitle:))]
454        #[unsafe(method_family = none)]
455        pub unsafe fn setAttributedSubtitle(
456            &self,
457            attributed_subtitle: Option<&NSAttributedString>,
458        );
459
460        #[cfg(feature = "block2")]
461        #[unsafe(method(subtitleTextAttributesTransformer))]
462        #[unsafe(method_family = none)]
463        pub unsafe fn subtitleTextAttributesTransformer(
464            &self,
465        ) -> UIConfigurationTextAttributesTransformer;
466
467        #[cfg(feature = "block2")]
468        /// Setter for [`subtitleTextAttributesTransformer`][Self::subtitleTextAttributesTransformer].
469        #[unsafe(method(setSubtitleTextAttributesTransformer:))]
470        #[unsafe(method_family = none)]
471        pub unsafe fn setSubtitleTextAttributesTransformer(
472            &self,
473            subtitle_text_attributes_transformer: UIConfigurationTextAttributesTransformer,
474        );
475
476        #[cfg(feature = "NSParagraphStyle")]
477        /// Default is WordWrapping. WordWrapping and CharWrapping both allow for multi-line text, other modes will restrict the subtitle to a single line of text.
478        #[unsafe(method(subtitleLineBreakMode))]
479        #[unsafe(method_family = none)]
480        pub unsafe fn subtitleLineBreakMode(&self) -> NSLineBreakMode;
481
482        #[cfg(feature = "NSParagraphStyle")]
483        /// Setter for [`subtitleLineBreakMode`][Self::subtitleLineBreakMode].
484        #[unsafe(method(setSubtitleLineBreakMode:))]
485        #[unsafe(method_family = none)]
486        pub unsafe fn setSubtitleLineBreakMode(&self, subtitle_line_break_mode: NSLineBreakMode);
487
488        /// What kind of indicator should the button show. Default value is .automatic.
489        #[unsafe(method(indicator))]
490        #[unsafe(method_family = none)]
491        pub unsafe fn indicator(&self) -> UIButtonConfigurationIndicator;
492
493        /// Setter for [`indicator`][Self::indicator].
494        #[unsafe(method(setIndicator:))]
495        #[unsafe(method_family = none)]
496        pub unsafe fn setIndicator(&self, indicator: UIButtonConfigurationIndicator);
497
498        #[cfg(all(
499            feature = "UIColor",
500            feature = "UIConfigurationColorTransformer",
501            feature = "block2"
502        ))]
503        #[unsafe(method(indicatorColorTransformer))]
504        #[unsafe(method_family = none)]
505        pub unsafe fn indicatorColorTransformer(&self) -> UIConfigurationColorTransformer;
506
507        #[cfg(all(
508            feature = "UIColor",
509            feature = "UIConfigurationColorTransformer",
510            feature = "block2"
511        ))]
512        /// Setter for [`indicatorColorTransformer`][Self::indicatorColorTransformer].
513        #[unsafe(method(setIndicatorColorTransformer:))]
514        #[unsafe(method_family = none)]
515        pub unsafe fn setIndicatorColorTransformer(
516            &self,
517            indicator_color_transformer: UIConfigurationColorTransformer,
518        );
519
520        #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
521        /// Insets from the bounds of the button to create the content region. Defaults styles provide insets based on the button size.
522        #[unsafe(method(contentInsets))]
523        #[unsafe(method_family = none)]
524        pub unsafe fn contentInsets(&self) -> NSDirectionalEdgeInsets;
525
526        #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
527        /// Setter for [`contentInsets`][Self::contentInsets].
528        #[unsafe(method(setContentInsets:))]
529        #[unsafe(method_family = none)]
530        pub unsafe fn setContentInsets(&self, content_insets: NSDirectionalEdgeInsets);
531
532        /// Restore the default content insets.
533        #[unsafe(method(setDefaultContentInsets))]
534        #[unsafe(method_family = none)]
535        pub unsafe fn setDefaultContentInsets(&self);
536
537        #[cfg(feature = "UIGeometry")]
538        /// Defaults to Leading, only single edge values (top/leading/bottom/trailing) are supported.
539        #[unsafe(method(imagePlacement))]
540        #[unsafe(method_family = none)]
541        pub unsafe fn imagePlacement(&self) -> NSDirectionalRectEdge;
542
543        #[cfg(feature = "UIGeometry")]
544        /// Setter for [`imagePlacement`][Self::imagePlacement].
545        #[unsafe(method(setImagePlacement:))]
546        #[unsafe(method_family = none)]
547        pub unsafe fn setImagePlacement(&self, image_placement: NSDirectionalRectEdge);
548
549        #[cfg(feature = "objc2-core-foundation")]
550        /// When a button has both image and text content, this value is the padding between the image and the text.
551        #[unsafe(method(imagePadding))]
552        #[unsafe(method_family = none)]
553        pub unsafe fn imagePadding(&self) -> CGFloat;
554
555        #[cfg(feature = "objc2-core-foundation")]
556        /// Setter for [`imagePadding`][Self::imagePadding].
557        #[unsafe(method(setImagePadding:))]
558        #[unsafe(method_family = none)]
559        pub unsafe fn setImagePadding(&self, image_padding: CGFloat);
560
561        #[cfg(feature = "objc2-core-foundation")]
562        /// When a button has both a title
563        /// &
564        /// subtitle, this value is the padding between those titles.
565        #[unsafe(method(titlePadding))]
566        #[unsafe(method_family = none)]
567        pub unsafe fn titlePadding(&self) -> CGFloat;
568
569        #[cfg(feature = "objc2-core-foundation")]
570        /// Setter for [`titlePadding`][Self::titlePadding].
571        #[unsafe(method(setTitlePadding:))]
572        #[unsafe(method_family = none)]
573        pub unsafe fn setTitlePadding(&self, title_padding: CGFloat);
574
575        /// The alignment to use for relative layout between title
576        /// &
577        /// subtitle.
578        #[unsafe(method(titleAlignment))]
579        #[unsafe(method_family = none)]
580        pub unsafe fn titleAlignment(&self) -> UIButtonConfigurationTitleAlignment;
581
582        /// Setter for [`titleAlignment`][Self::titleAlignment].
583        #[unsafe(method(setTitleAlignment:))]
584        #[unsafe(method_family = none)]
585        pub unsafe fn setTitleAlignment(
586            &self,
587            title_alignment: UIButtonConfigurationTitleAlignment,
588        );
589
590        /// If the style should automatically update when the button is selected. Default varies by style. Disable to customize selection behavior.
591        #[unsafe(method(automaticallyUpdateForSelection))]
592        #[unsafe(method_family = none)]
593        pub unsafe fn automaticallyUpdateForSelection(&self) -> bool;
594
595        /// Setter for [`automaticallyUpdateForSelection`][Self::automaticallyUpdateForSelection].
596        #[unsafe(method(setAutomaticallyUpdateForSelection:))]
597        #[unsafe(method_family = none)]
598        pub unsafe fn setAutomaticallyUpdateForSelection(
599            &self,
600            automatically_update_for_selection: bool,
601        );
602    );
603}