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
19unsafe impl NSCoding for UITextFormattingViewControllerConfiguration {}
20
21unsafe impl NSCopying for UITextFormattingViewControllerConfiguration {}
22
23unsafe impl CopyingHelper for UITextFormattingViewControllerConfiguration {
24    type Result = Self;
25}
26
27unsafe impl NSObjectProtocol for UITextFormattingViewControllerConfiguration {}
28
29unsafe impl NSSecureCoding for UITextFormattingViewControllerConfiguration {}
30
31impl UITextFormattingViewControllerConfiguration {
32    extern_methods!(
33        #[cfg(feature = "UITextFormattingViewControllerComponent")]
34        /// Component groups displayed by text formatting view.
35        #[unsafe(method(groups))]
36        #[unsafe(method_family = none)]
37        pub unsafe fn groups(
38            &self,
39        ) -> Retained<NSArray<UITextFormattingViewControllerComponentGroup>>;
40
41        #[cfg(feature = "UITextFormattingViewControllerFormattingStyle")]
42        /// Configurations of formatting styles available in text formatting view.
43        #[unsafe(method(formattingStyles))]
44        #[unsafe(method_family = none)]
45        pub unsafe fn formattingStyles(
46            &self,
47        ) -> Option<Retained<NSArray<UITextFormattingViewControllerFormattingStyle>>>;
48
49        #[cfg(feature = "UITextFormattingViewControllerFormattingStyle")]
50        /// Setter for [`formattingStyles`][Self::formattingStyles].
51        #[unsafe(method(setFormattingStyles:))]
52        #[unsafe(method_family = none)]
53        pub unsafe fn setFormattingStyles(
54            &self,
55            formatting_styles: Option<&NSArray<UITextFormattingViewControllerFormattingStyle>>,
56        );
57
58        #[cfg(feature = "UIFontPickerViewControllerConfiguration")]
59        /// Configuration object that will be used to customize `UIFontPickerViewController` if presented by `UITextFormattingViewController`.
60        #[unsafe(method(fontPickerConfiguration))]
61        #[unsafe(method_family = none)]
62        pub unsafe fn fontPickerConfiguration(
63            &self,
64            mtm: MainThreadMarker,
65        ) -> Option<Retained<UIFontPickerViewControllerConfiguration>>;
66
67        #[cfg(feature = "UIFontPickerViewControllerConfiguration")]
68        /// Setter for [`fontPickerConfiguration`][Self::fontPickerConfiguration].
69        #[unsafe(method(setFontPickerConfiguration:))]
70        #[unsafe(method_family = none)]
71        pub unsafe fn setFontPickerConfiguration(
72            &self,
73            font_picker_configuration: Option<&UIFontPickerViewControllerConfiguration>,
74        );
75
76        /// Creates a default configuration with most common text formatting options.
77        #[unsafe(method(init))]
78        #[unsafe(method_family = init)]
79        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
80
81        #[cfg(feature = "UITextFormattingViewControllerComponent")]
82        /// Creates a configuration object with provided component groups.
83        /// - Parameter groups: Component groups displayed in text formatting view.
84        #[unsafe(method(initWithGroups:))]
85        #[unsafe(method_family = init)]
86        pub unsafe fn initWithGroups(
87            this: Allocated<Self>,
88            groups: &NSArray<UITextFormattingViewControllerComponentGroup>,
89        ) -> Retained<Self>;
90    );
91}
92
93/// Methods declared on superclass `NSObject`.
94impl UITextFormattingViewControllerConfiguration {
95    extern_methods!(
96        #[unsafe(method(new))]
97        #[unsafe(method_family = new)]
98        pub unsafe fn new() -> Retained<Self>;
99    );
100}