objc2_ui_kit/generated/
UITextFormattingViewControllerComponent.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9/// Predefined text formatting view controller components.
10///
11/// See also [Apple's documentation](https://developer.apple.com/documentation/uikit/uitextformattingviewcontrollercomponentkey?language=objc)
12// NS_TYPED_ENUM
13pub type UITextFormattingViewControllerComponentKey = NSString;
14
15extern "C" {
16    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitextformattingviewcontrollerformattingstylescomponentkey?language=objc)
17    pub static UITextFormattingViewControllerFormattingStylesComponentKey:
18        &'static UITextFormattingViewControllerComponentKey;
19}
20
21extern "C" {
22    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitextformattingviewcontrollerfontattributescomponentkey?language=objc)
23    pub static UITextFormattingViewControllerFontAttributesComponentKey:
24        &'static UITextFormattingViewControllerComponentKey;
25}
26
27extern "C" {
28    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitextformattingviewcontrollerfontpickercomponentkey?language=objc)
29    pub static UITextFormattingViewControllerFontPickerComponentKey:
30        &'static UITextFormattingViewControllerComponentKey;
31}
32
33extern "C" {
34    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitextformattingviewcontrollerfontsizecomponentkey?language=objc)
35    pub static UITextFormattingViewControllerFontSizeComponentKey:
36        &'static UITextFormattingViewControllerComponentKey;
37}
38
39extern "C" {
40    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitextformattingviewcontrollerfontpointsizecomponentkey?language=objc)
41    pub static UITextFormattingViewControllerFontPointSizeComponentKey:
42        &'static UITextFormattingViewControllerComponentKey;
43}
44
45extern "C" {
46    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitextformattingviewcontrollertextalignmentcomponentkey?language=objc)
47    pub static UITextFormattingViewControllerTextAlignmentComponentKey:
48        &'static UITextFormattingViewControllerComponentKey;
49}
50
51extern "C" {
52    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitextformattingviewcontrollertextalignmentandjustificationcomponentkey?language=objc)
53    pub static UITextFormattingViewControllerTextAlignmentAndJustificationComponentKey:
54        &'static UITextFormattingViewControllerComponentKey;
55}
56
57extern "C" {
58    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitextformattingviewcontrollertextindentationcomponentkey?language=objc)
59    pub static UITextFormattingViewControllerTextIndentationComponentKey:
60        &'static UITextFormattingViewControllerComponentKey;
61}
62
63extern "C" {
64    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitextformattingviewcontrollerlineheightcomponentkey?language=objc)
65    pub static UITextFormattingViewControllerLineHeightComponentKey:
66        &'static UITextFormattingViewControllerComponentKey;
67}
68
69extern "C" {
70    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitextformattingviewcontrollerliststylescomponentkey?language=objc)
71    pub static UITextFormattingViewControllerListStylesComponentKey:
72        &'static UITextFormattingViewControllerComponentKey;
73}
74
75extern "C" {
76    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitextformattingviewcontrollertextcolorcomponentkey?language=objc)
77    pub static UITextFormattingViewControllerTextColorComponentKey:
78        &'static UITextFormattingViewControllerComponentKey;
79}
80
81extern "C" {
82    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitextformattingviewcontrollerhighlightcomponentkey?language=objc)
83    pub static UITextFormattingViewControllerHighlightComponentKey:
84        &'static UITextFormattingViewControllerComponentKey;
85}
86
87extern "C" {
88    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitextformattingviewcontrollerhighlightpickercomponentkey?language=objc)
89    pub static UITextFormattingViewControllerHighlightPickerComponentKey:
90        &'static UITextFormattingViewControllerComponentKey;
91}
92
93/// Sizes of text formatting view controller components.
94///
95/// See also [Apple's documentation](https://developer.apple.com/documentation/uikit/uitextformattingviewcontrollercomponentsize?language=objc)
96// NS_ENUM
97#[repr(transparent)]
98#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
99pub struct UITextFormattingViewControllerComponentSize(pub NSInteger);
100impl UITextFormattingViewControllerComponentSize {
101    #[doc(alias = "UITextFormattingViewControllerComponentSizeAutomatic")]
102    pub const Automatic: Self = Self(0);
103    #[doc(alias = "UITextFormattingViewControllerComponentSizeMini")]
104    pub const Mini: Self = Self(1);
105    #[doc(alias = "UITextFormattingViewControllerComponentSizeSmall")]
106    pub const Small: Self = Self(2);
107    #[doc(alias = "UITextFormattingViewControllerComponentSizeRegular")]
108    pub const Regular: Self = Self(3);
109    #[doc(alias = "UITextFormattingViewControllerComponentSizeLarge")]
110    pub const Large: Self = Self(4);
111    #[doc(alias = "UITextFormattingViewControllerComponentSizeExtraLarge")]
112    pub const ExtraLarge: Self = Self(5);
113}
114
115unsafe impl Encode for UITextFormattingViewControllerComponentSize {
116    const ENCODING: Encoding = NSInteger::ENCODING;
117}
118
119unsafe impl RefEncode for UITextFormattingViewControllerComponentSize {
120    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
121}
122
123extern_class!(
124    /// Defines text formatting view component.
125    ///
126    /// See also [Apple's documentation](https://developer.apple.com/documentation/uikit/uitextformattingviewcontrollercomponent?language=objc)
127    #[unsafe(super(NSObject))]
128    #[derive(Debug, PartialEq, Eq, Hash)]
129    pub struct UITextFormattingViewControllerComponent;
130);
131
132unsafe impl NSCoding for UITextFormattingViewControllerComponent {}
133
134unsafe impl NSCopying for UITextFormattingViewControllerComponent {}
135
136unsafe impl CopyingHelper for UITextFormattingViewControllerComponent {
137    type Result = Self;
138}
139
140unsafe impl NSObjectProtocol for UITextFormattingViewControllerComponent {}
141
142unsafe impl NSSecureCoding for UITextFormattingViewControllerComponent {}
143
144impl UITextFormattingViewControllerComponent {
145    extern_methods!(
146        /// Unique key that identifies text formatting view component.
147        #[unsafe(method(componentKey))]
148        #[unsafe(method_family = none)]
149        pub unsafe fn componentKey(&self) -> Retained<UITextFormattingViewControllerComponentKey>;
150
151        /// Specifies preferred size of the component in text formatting view.
152        #[unsafe(method(preferredSize))]
153        #[unsafe(method_family = none)]
154        pub unsafe fn preferredSize(&self) -> UITextFormattingViewControllerComponentSize;
155
156        /// Creates a text formatting view component configuration with component key and preferred size.
157        ///
158        /// - Parameters:
159        /// - componentKey: Component key.
160        /// - preferredSize: Preferred size of component in text formatting view.
161        #[unsafe(method(initWithComponentKey:preferredSize:))]
162        #[unsafe(method_family = init)]
163        pub unsafe fn initWithComponentKey_preferredSize(
164            this: Allocated<Self>,
165            component_key: &UITextFormattingViewControllerComponentKey,
166            preferred_size: UITextFormattingViewControllerComponentSize,
167        ) -> Retained<Self>;
168
169        #[unsafe(method(init))]
170        #[unsafe(method_family = init)]
171        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
172
173        #[unsafe(method(new))]
174        #[unsafe(method_family = new)]
175        pub unsafe fn new() -> Retained<Self>;
176    );
177}
178
179extern_class!(
180    /// Defines grouping of text formatting components in view.
181    ///
182    /// See also [Apple's documentation](https://developer.apple.com/documentation/uikit/uitextformattingviewcontrollercomponentgroup?language=objc)
183    #[unsafe(super(NSObject))]
184    #[derive(Debug, PartialEq, Eq, Hash)]
185    pub struct UITextFormattingViewControllerComponentGroup;
186);
187
188unsafe impl NSCoding for UITextFormattingViewControllerComponentGroup {}
189
190unsafe impl NSCopying for UITextFormattingViewControllerComponentGroup {}
191
192unsafe impl CopyingHelper for UITextFormattingViewControllerComponentGroup {
193    type Result = Self;
194}
195
196unsafe impl NSObjectProtocol for UITextFormattingViewControllerComponentGroup {}
197
198unsafe impl NSSecureCoding for UITextFormattingViewControllerComponentGroup {}
199
200impl UITextFormattingViewControllerComponentGroup {
201    extern_methods!(
202        /// Components in group.
203        #[unsafe(method(components))]
204        #[unsafe(method_family = none)]
205        pub unsafe fn components(
206            &self,
207        ) -> Retained<NSArray<UITextFormattingViewControllerComponent>>;
208
209        /// Creates a group of components.
210        /// - Parameter components: Components to be included in the group.
211        #[unsafe(method(initWithComponents:))]
212        #[unsafe(method_family = init)]
213        pub unsafe fn initWithComponents(
214            this: Allocated<Self>,
215            components: &NSArray<UITextFormattingViewControllerComponent>,
216        ) -> Retained<Self>;
217
218        #[unsafe(method(init))]
219        #[unsafe(method_family = init)]
220        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
221
222        #[unsafe(method(new))]
223        #[unsafe(method_family = new)]
224        pub unsafe fn new() -> Retained<Self>;
225    );
226}