objc2_ui_kit/generated/
UITextFormattingViewControllerFormattingDescriptor.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::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12/// Text formatting horizontal alignment state.
13///
14/// See also [Apple's documentation](https://developer.apple.com/documentation/uikit/uitextformattingviewcontrollertextalignment?language=objc)
15// NS_TYPED_ENUM
16pub type UITextFormattingViewControllerTextAlignment = NSString;
17
18extern "C" {
19    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitextformattingviewcontrollertextalignmentleft?language=objc)
20    pub static UITextFormattingViewControllerTextAlignmentLeft:
21        &'static UITextFormattingViewControllerTextAlignment;
22}
23
24extern "C" {
25    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitextformattingviewcontrollertextalignmentcenter?language=objc)
26    pub static UITextFormattingViewControllerTextAlignmentCenter:
27        &'static UITextFormattingViewControllerTextAlignment;
28}
29
30extern "C" {
31    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitextformattingviewcontrollertextalignmentright?language=objc)
32    pub static UITextFormattingViewControllerTextAlignmentRight:
33        &'static UITextFormattingViewControllerTextAlignment;
34}
35
36extern "C" {
37    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitextformattingviewcontrollertextalignmentjustified?language=objc)
38    pub static UITextFormattingViewControllerTextAlignmentJustified:
39        &'static UITextFormattingViewControllerTextAlignment;
40}
41
42extern "C" {
43    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitextformattingviewcontrollertextalignmentnatural?language=objc)
44    pub static UITextFormattingViewControllerTextAlignmentNatural:
45        &'static UITextFormattingViewControllerTextAlignment;
46}
47
48/// Text formatting text list state.
49///
50/// See also [Apple's documentation](https://developer.apple.com/documentation/uikit/uitextformattingviewcontrollertextlist?language=objc)
51// NS_TYPED_ENUM
52pub type UITextFormattingViewControllerTextList = NSString;
53
54extern "C" {
55    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitextformattingviewcontrollertextlistdisc?language=objc)
56    pub static UITextFormattingViewControllerTextListDisc:
57        &'static UITextFormattingViewControllerTextList;
58}
59
60extern "C" {
61    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitextformattingviewcontrollertextlisthyphen?language=objc)
62    pub static UITextFormattingViewControllerTextListHyphen:
63        &'static UITextFormattingViewControllerTextList;
64}
65
66extern "C" {
67    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitextformattingviewcontrollertextlistdecimal?language=objc)
68    pub static UITextFormattingViewControllerTextListDecimal:
69        &'static UITextFormattingViewControllerTextList;
70}
71
72extern "C" {
73    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitextformattingviewcontrollertextlistother?language=objc)
74    pub static UITextFormattingViewControllerTextListOther:
75        &'static UITextFormattingViewControllerTextList;
76}
77
78/// Text formatting highlight state.
79///
80/// See also [Apple's documentation](https://developer.apple.com/documentation/uikit/uitextformattingviewcontrollerhighlight?language=objc)
81// NS_TYPED_ENUM
82pub type UITextFormattingViewControllerHighlight = NSString;
83
84extern "C" {
85    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitextformattingviewcontrollerhighlightdefault?language=objc)
86    pub static UITextFormattingViewControllerHighlightDefault:
87        &'static UITextFormattingViewControllerHighlight;
88}
89
90extern "C" {
91    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitextformattingviewcontrollerhighlightpurple?language=objc)
92    pub static UITextFormattingViewControllerHighlightPurple:
93        &'static UITextFormattingViewControllerHighlight;
94}
95
96extern "C" {
97    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitextformattingviewcontrollerhighlightpink?language=objc)
98    pub static UITextFormattingViewControllerHighlightPink:
99        &'static UITextFormattingViewControllerHighlight;
100}
101
102extern "C" {
103    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitextformattingviewcontrollerhighlightorange?language=objc)
104    pub static UITextFormattingViewControllerHighlightOrange:
105        &'static UITextFormattingViewControllerHighlight;
106}
107
108extern "C" {
109    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitextformattingviewcontrollerhighlightmint?language=objc)
110    pub static UITextFormattingViewControllerHighlightMint:
111        &'static UITextFormattingViewControllerHighlight;
112}
113
114extern "C" {
115    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitextformattingviewcontrollerhighlightblue?language=objc)
116    pub static UITextFormattingViewControllerHighlightBlue:
117        &'static UITextFormattingViewControllerHighlight;
118}
119
120extern_class!(
121    /// Object that represents current text formatting state.
122    /// This can apply to formatting state of some selected range of text or currently applicable input formatting.
123    ///
124    /// See also [Apple's documentation](https://developer.apple.com/documentation/uikit/uitextformattingviewcontrollerformattingdescriptor?language=objc)
125    #[unsafe(super(NSObject))]
126    #[derive(Debug, PartialEq, Eq, Hash)]
127    pub struct UITextFormattingViewControllerFormattingDescriptor;
128);
129
130unsafe impl NSCoding for UITextFormattingViewControllerFormattingDescriptor {}
131
132unsafe impl NSCopying for UITextFormattingViewControllerFormattingDescriptor {}
133
134unsafe impl CopyingHelper for UITextFormattingViewControllerFormattingDescriptor {
135    type Result = Self;
136}
137
138unsafe impl NSObjectProtocol for UITextFormattingViewControllerFormattingDescriptor {}
139
140unsafe impl NSSecureCoding for UITextFormattingViewControllerFormattingDescriptor {}
141
142impl UITextFormattingViewControllerFormattingDescriptor {
143    extern_methods!(
144        /// Initializes formatting descriptor with default property values.
145        #[unsafe(method(init))]
146        #[unsafe(method_family = init)]
147        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
148
149        /// Initializes formatting descriptor with a string and selected range of string.
150        /// - Parameters:
151        /// - string: Attributed string for which we are creating formatting descriptor.
152        /// - range: Range of string that is being represented by descriptor
153        #[unsafe(method(initWithString:range:))]
154        #[unsafe(method_family = init)]
155        pub unsafe fn initWithString_range(
156            this: Allocated<Self>,
157            string: &NSAttributedString,
158            range: NSRange,
159        ) -> Retained<Self>;
160
161        /// Initializes formatting descriptor with attribute dictionary.
162        /// - Parameter attributes: Attribute dictionary that is being represented by descriptor.
163        #[unsafe(method(initWithAttributes:))]
164        #[unsafe(method_family = init)]
165        pub unsafe fn initWithAttributes(
166            this: Allocated<Self>,
167            attributes: &NSDictionary<NSAttributedStringKey, AnyObject>,
168        ) -> Retained<Self>;
169
170        #[cfg(feature = "UIFont")]
171        #[unsafe(method(fonts))]
172        #[unsafe(method_family = none)]
173        pub unsafe fn fonts(&self) -> Option<Retained<NSArray<UIFont>>>;
174
175        #[cfg(feature = "UIFont")]
176        /// Setter for [`fonts`][Self::fonts].
177        #[unsafe(method(setFonts:))]
178        #[unsafe(method_family = none)]
179        pub unsafe fn setFonts(&self, fonts: Option<&NSArray<UIFont>>);
180
181        #[cfg(feature = "UIColor")]
182        #[unsafe(method(textColors))]
183        #[unsafe(method_family = none)]
184        pub unsafe fn textColors(&self) -> Option<Retained<NSArray<UIColor>>>;
185
186        #[cfg(feature = "UIColor")]
187        /// Setter for [`textColors`][Self::textColors].
188        #[unsafe(method(setTextColors:))]
189        #[unsafe(method_family = none)]
190        pub unsafe fn setTextColors(&self, text_colors: Option<&NSArray<UIColor>>);
191
192        #[cfg(feature = "objc2-core-foundation")]
193        #[unsafe(method(lineHeight))]
194        #[unsafe(method_family = none)]
195        pub unsafe fn lineHeight(&self) -> CGFloat;
196
197        #[cfg(feature = "objc2-core-foundation")]
198        /// Setter for [`lineHeight`][Self::lineHeight].
199        #[unsafe(method(setLineHeight:))]
200        #[unsafe(method_family = none)]
201        pub unsafe fn setLineHeight(&self, line_height: CGFloat);
202
203        #[unsafe(method(underlinePresent))]
204        #[unsafe(method_family = none)]
205        pub unsafe fn underlinePresent(&self) -> bool;
206
207        /// Setter for [`underlinePresent`][Self::underlinePresent].
208        #[unsafe(method(setUnderlinePresent:))]
209        #[unsafe(method_family = none)]
210        pub unsafe fn setUnderlinePresent(&self, underline_present: bool);
211
212        #[unsafe(method(strikethroughPresent))]
213        #[unsafe(method_family = none)]
214        pub unsafe fn strikethroughPresent(&self) -> bool;
215
216        /// Setter for [`strikethroughPresent`][Self::strikethroughPresent].
217        #[unsafe(method(setStrikethroughPresent:))]
218        #[unsafe(method_family = none)]
219        pub unsafe fn setStrikethroughPresent(&self, strikethrough_present: bool);
220
221        #[unsafe(method(textAlignments))]
222        #[unsafe(method_family = none)]
223        pub unsafe fn textAlignments(
224            &self,
225        ) -> Retained<NSSet<UITextFormattingViewControllerTextAlignment>>;
226
227        /// Setter for [`textAlignments`][Self::textAlignments].
228        #[unsafe(method(setTextAlignments:))]
229        #[unsafe(method_family = none)]
230        pub unsafe fn setTextAlignments(
231            &self,
232            text_alignments: &NSSet<UITextFormattingViewControllerTextAlignment>,
233        );
234
235        #[unsafe(method(textLists))]
236        #[unsafe(method_family = none)]
237        pub unsafe fn textLists(&self) -> Retained<NSSet<UITextFormattingViewControllerTextList>>;
238
239        /// Setter for [`textLists`][Self::textLists].
240        #[unsafe(method(setTextLists:))]
241        #[unsafe(method_family = none)]
242        pub unsafe fn setTextLists(
243            &self,
244            text_lists: &NSSet<UITextFormattingViewControllerTextList>,
245        );
246
247        #[unsafe(method(highlights))]
248        #[unsafe(method_family = none)]
249        pub unsafe fn highlights(&self)
250            -> Retained<NSSet<UITextFormattingViewControllerHighlight>>;
251
252        /// Setter for [`highlights`][Self::highlights].
253        #[unsafe(method(setHighlights:))]
254        #[unsafe(method_family = none)]
255        pub unsafe fn setHighlights(
256            &self,
257            highlights: &NSSet<UITextFormattingViewControllerHighlight>,
258        );
259
260        #[unsafe(method(formattingStyleKey))]
261        #[unsafe(method_family = none)]
262        pub unsafe fn formattingStyleKey(&self) -> Option<Retained<NSString>>;
263
264        /// Setter for [`formattingStyleKey`][Self::formattingStyleKey].
265        #[unsafe(method(setFormattingStyleKey:))]
266        #[unsafe(method_family = none)]
267        pub unsafe fn setFormattingStyleKey(&self, formatting_style_key: Option<&NSString>);
268    );
269}
270
271/// Methods declared on superclass `NSObject`.
272impl UITextFormattingViewControllerFormattingDescriptor {
273    extern_methods!(
274        #[unsafe(method(new))]
275        #[unsafe(method_family = new)]
276        pub unsafe fn new() -> Retained<Self>;
277    );
278}