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
132extern_conformance!(
133    unsafe impl NSCoding for UITextFormattingViewControllerComponent {}
134);
135
136extern_conformance!(
137    unsafe impl NSCopying for UITextFormattingViewControllerComponent {}
138);
139
140unsafe impl CopyingHelper for UITextFormattingViewControllerComponent {
141    type Result = Self;
142}
143
144extern_conformance!(
145    unsafe impl NSObjectProtocol for UITextFormattingViewControllerComponent {}
146);
147
148extern_conformance!(
149    unsafe impl NSSecureCoding for UITextFormattingViewControllerComponent {}
150);
151
152impl UITextFormattingViewControllerComponent {
153    extern_methods!(
154        /// Unique key that identifies text formatting view component.
155        #[unsafe(method(componentKey))]
156        #[unsafe(method_family = none)]
157        pub unsafe fn componentKey(&self) -> Retained<UITextFormattingViewControllerComponentKey>;
158
159        /// Specifies preferred size of the component in text formatting view.
160        #[unsafe(method(preferredSize))]
161        #[unsafe(method_family = none)]
162        pub unsafe fn preferredSize(&self) -> UITextFormattingViewControllerComponentSize;
163
164        /// Creates a text formatting view component configuration with component key and preferred size.
165        ///
166        /// - Parameters:
167        /// - componentKey: Component key.
168        /// - preferredSize: Preferred size of component in text formatting view.
169        #[unsafe(method(initWithComponentKey:preferredSize:))]
170        #[unsafe(method_family = init)]
171        pub unsafe fn initWithComponentKey_preferredSize(
172            this: Allocated<Self>,
173            component_key: &UITextFormattingViewControllerComponentKey,
174            preferred_size: UITextFormattingViewControllerComponentSize,
175        ) -> Retained<Self>;
176
177        #[unsafe(method(init))]
178        #[unsafe(method_family = init)]
179        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
180
181        #[unsafe(method(new))]
182        #[unsafe(method_family = new)]
183        pub unsafe fn new() -> Retained<Self>;
184    );
185}
186
187extern_class!(
188    /// Defines grouping of text formatting components in view.
189    ///
190    /// See also [Apple's documentation](https://developer.apple.com/documentation/uikit/uitextformattingviewcontrollercomponentgroup?language=objc)
191    #[unsafe(super(NSObject))]
192    #[derive(Debug, PartialEq, Eq, Hash)]
193    pub struct UITextFormattingViewControllerComponentGroup;
194);
195
196extern_conformance!(
197    unsafe impl NSCoding for UITextFormattingViewControllerComponentGroup {}
198);
199
200extern_conformance!(
201    unsafe impl NSCopying for UITextFormattingViewControllerComponentGroup {}
202);
203
204unsafe impl CopyingHelper for UITextFormattingViewControllerComponentGroup {
205    type Result = Self;
206}
207
208extern_conformance!(
209    unsafe impl NSObjectProtocol for UITextFormattingViewControllerComponentGroup {}
210);
211
212extern_conformance!(
213    unsafe impl NSSecureCoding for UITextFormattingViewControllerComponentGroup {}
214);
215
216impl UITextFormattingViewControllerComponentGroup {
217    extern_methods!(
218        /// Components in group.
219        #[unsafe(method(components))]
220        #[unsafe(method_family = none)]
221        pub unsafe fn components(
222            &self,
223        ) -> Retained<NSArray<UITextFormattingViewControllerComponent>>;
224
225        /// Creates a group of components.
226        /// - Parameter components: Components to be included in the group.
227        #[unsafe(method(initWithComponents:))]
228        #[unsafe(method_family = init)]
229        pub unsafe fn initWithComponents(
230            this: Allocated<Self>,
231            components: &NSArray<UITextFormattingViewControllerComponent>,
232        ) -> Retained<Self>;
233
234        #[unsafe(method(init))]
235        #[unsafe(method_family = init)]
236        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
237
238        #[unsafe(method(new))]
239        #[unsafe(method_family = new)]
240        pub unsafe fn new() -> Retained<Self>;
241    );
242}