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 fn groups(&self) -> Retained<NSArray<UITextFormattingViewControllerComponentGroup>>;
46
47        #[cfg(feature = "UITextFormattingViewControllerFormattingStyle")]
48        /// Configurations of formatting styles available in text formatting view.
49        #[unsafe(method(formattingStyles))]
50        #[unsafe(method_family = none)]
51        pub fn formattingStyles(
52            &self,
53        ) -> Option<Retained<NSArray<UITextFormattingViewControllerFormattingStyle>>>;
54
55        #[cfg(feature = "UITextFormattingViewControllerFormattingStyle")]
56        /// Setter for [`formattingStyles`][Self::formattingStyles].
57        ///
58        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
59        #[unsafe(method(setFormattingStyles:))]
60        #[unsafe(method_family = none)]
61        pub 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 fn fontPickerConfiguration(
71            &self,
72            mtm: MainThreadMarker,
73        ) -> Option<Retained<UIFontPickerViewControllerConfiguration>>;
74
75        #[cfg(feature = "UIFontPickerViewControllerConfiguration")]
76        /// Setter for [`fontPickerConfiguration`][Self::fontPickerConfiguration].
77        ///
78        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
79        #[unsafe(method(setFontPickerConfiguration:))]
80        #[unsafe(method_family = none)]
81        pub fn setFontPickerConfiguration(
82            &self,
83            font_picker_configuration: Option<&UIFontPickerViewControllerConfiguration>,
84        );
85
86        /// Creates a default configuration with most common text formatting options.
87        #[unsafe(method(init))]
88        #[unsafe(method_family = init)]
89        pub fn init(this: Allocated<Self>) -> Retained<Self>;
90
91        #[cfg(feature = "UITextFormattingViewControllerComponent")]
92        /// Creates a configuration object with provided component groups.
93        /// - Parameter groups: Component groups displayed in text formatting view.
94        #[unsafe(method(initWithGroups:))]
95        #[unsafe(method_family = init)]
96        pub fn initWithGroups(
97            this: Allocated<Self>,
98            groups: &NSArray<UITextFormattingViewControllerComponentGroup>,
99        ) -> Retained<Self>;
100    );
101}
102
103/// Methods declared on superclass `NSObject`.
104impl UITextFormattingViewControllerConfiguration {
105    extern_methods!(
106        #[unsafe(method(new))]
107        #[unsafe(method_family = new)]
108        pub fn new() -> Retained<Self>;
109    );
110}
111
112impl DefaultRetained for UITextFormattingViewControllerConfiguration {
113    #[inline]
114    fn default_retained() -> Retained<Self> {
115        Self::new()
116    }
117}