objc2_ui_kit/generated/
UITextFormattingViewControllerConfiguration.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::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11    /// Text formatting view controller configuration object.
12    ///
13    /// See also [Apple's documentation](https://developer.apple.com/documentation/uikit/uitextformattingviewcontrollerconfiguration?language=objc)
14    #[unsafe(super(NSObject))]
15    #[derive(Debug, PartialEq, Eq, Hash)]
16    pub struct UITextFormattingViewControllerConfiguration;
17);
18
19extern_conformance!(
20    unsafe impl NSCoding for UITextFormattingViewControllerConfiguration {}
21);
22
23extern_conformance!(
24    unsafe impl NSCopying for UITextFormattingViewControllerConfiguration {}
25);
26
27unsafe impl CopyingHelper for UITextFormattingViewControllerConfiguration {
28    type Result = Self;
29}
30
31extern_conformance!(
32    unsafe impl NSObjectProtocol for UITextFormattingViewControllerConfiguration {}
33);
34
35extern_conformance!(
36    unsafe impl NSSecureCoding for UITextFormattingViewControllerConfiguration {}
37);
38
39impl UITextFormattingViewControllerConfiguration {
40    extern_methods!(
41        #[cfg(feature = "UITextFormattingViewControllerComponent")]
42        /// Component groups displayed by text formatting view.
43        #[unsafe(method(groups))]
44        #[unsafe(method_family = none)]
45        pub unsafe fn groups(
46            &self,
47        ) -> Retained<NSArray<UITextFormattingViewControllerComponentGroup>>;
48
49        #[cfg(feature = "UITextFormattingViewControllerFormattingStyle")]
50        /// Configurations of formatting styles available in text formatting view.
51        #[unsafe(method(formattingStyles))]
52        #[unsafe(method_family = none)]
53        pub unsafe fn formattingStyles(
54            &self,
55        ) -> Option<Retained<NSArray<UITextFormattingViewControllerFormattingStyle>>>;
56
57        #[cfg(feature = "UITextFormattingViewControllerFormattingStyle")]
58        /// Setter for [`formattingStyles`][Self::formattingStyles].
59        #[unsafe(method(setFormattingStyles:))]
60        #[unsafe(method_family = none)]
61        pub unsafe fn setFormattingStyles(
62            &self,
63            formatting_styles: Option<&NSArray<UITextFormattingViewControllerFormattingStyle>>,
64        );
65
66        #[cfg(feature = "UIFontPickerViewControllerConfiguration")]
67        /// Configuration object that will be used to customize `UIFontPickerViewController` if presented by `UITextFormattingViewController`.
68        #[unsafe(method(fontPickerConfiguration))]
69        #[unsafe(method_family = none)]
70        pub unsafe fn fontPickerConfiguration(
71            &self,
72            mtm: MainThreadMarker,
73        ) -> Option<Retained<UIFontPickerViewControllerConfiguration>>;
74
75        #[cfg(feature = "UIFontPickerViewControllerConfiguration")]
76        /// Setter for [`fontPickerConfiguration`][Self::fontPickerConfiguration].
77        #[unsafe(method(setFontPickerConfiguration:))]
78        #[unsafe(method_family = none)]
79        pub unsafe fn setFontPickerConfiguration(
80            &self,
81            font_picker_configuration: Option<&UIFontPickerViewControllerConfiguration>,
82        );
83
84        /// Creates a default configuration with most common text formatting options.
85        #[unsafe(method(init))]
86        #[unsafe(method_family = init)]
87        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
88
89        #[cfg(feature = "UITextFormattingViewControllerComponent")]
90        /// Creates a configuration object with provided component groups.
91        /// - Parameter groups: Component groups displayed in text formatting view.
92        #[unsafe(method(initWithGroups:))]
93        #[unsafe(method_family = init)]
94        pub unsafe fn initWithGroups(
95            this: Allocated<Self>,
96            groups: &NSArray<UITextFormattingViewControllerComponentGroup>,
97        ) -> Retained<Self>;
98    );
99}
100
101/// Methods declared on superclass `NSObject`.
102impl UITextFormattingViewControllerConfiguration {
103    extern_methods!(
104        #[unsafe(method(new))]
105        #[unsafe(method_family = new)]
106        pub unsafe fn new() -> Retained<Self>;
107    );
108}