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
130extern_conformance!(
131    unsafe impl NSCoding for UITextFormattingViewControllerFormattingDescriptor {}
132);
133
134extern_conformance!(
135    unsafe impl NSCopying for UITextFormattingViewControllerFormattingDescriptor {}
136);
137
138unsafe impl CopyingHelper for UITextFormattingViewControllerFormattingDescriptor {
139    type Result = Self;
140}
141
142extern_conformance!(
143    unsafe impl NSObjectProtocol for UITextFormattingViewControllerFormattingDescriptor {}
144);
145
146extern_conformance!(
147    unsafe impl NSSecureCoding for UITextFormattingViewControllerFormattingDescriptor {}
148);
149
150impl UITextFormattingViewControllerFormattingDescriptor {
151    extern_methods!(
152        /// Initializes formatting descriptor with default property values.
153        #[unsafe(method(init))]
154        #[unsafe(method_family = init)]
155        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
156
157        /// Initializes formatting descriptor with a string and selected range of string.
158        /// - Parameters:
159        /// - string: Attributed string for which we are creating formatting descriptor.
160        /// - range: Range of string that is being represented by descriptor
161        #[unsafe(method(initWithString:range:))]
162        #[unsafe(method_family = init)]
163        pub unsafe fn initWithString_range(
164            this: Allocated<Self>,
165            string: &NSAttributedString,
166            range: NSRange,
167        ) -> Retained<Self>;
168
169        /// Initializes formatting descriptor with attribute dictionary.
170        /// - Parameter attributes: Attribute dictionary that is being represented by descriptor.
171        #[unsafe(method(initWithAttributes:))]
172        #[unsafe(method_family = init)]
173        pub unsafe fn initWithAttributes(
174            this: Allocated<Self>,
175            attributes: &NSDictionary<NSAttributedStringKey, AnyObject>,
176        ) -> Retained<Self>;
177
178        #[cfg(feature = "UIFont")]
179        #[unsafe(method(fonts))]
180        #[unsafe(method_family = none)]
181        pub unsafe fn fonts(&self) -> Option<Retained<NSArray<UIFont>>>;
182
183        #[cfg(feature = "UIFont")]
184        /// Setter for [`fonts`][Self::fonts].
185        #[unsafe(method(setFonts:))]
186        #[unsafe(method_family = none)]
187        pub unsafe fn setFonts(&self, fonts: Option<&NSArray<UIFont>>);
188
189        #[cfg(feature = "UIColor")]
190        #[unsafe(method(textColors))]
191        #[unsafe(method_family = none)]
192        pub unsafe fn textColors(&self) -> Option<Retained<NSArray<UIColor>>>;
193
194        #[cfg(feature = "UIColor")]
195        /// Setter for [`textColors`][Self::textColors].
196        #[unsafe(method(setTextColors:))]
197        #[unsafe(method_family = none)]
198        pub unsafe fn setTextColors(&self, text_colors: Option<&NSArray<UIColor>>);
199
200        #[cfg(feature = "objc2-core-foundation")]
201        #[unsafe(method(lineHeight))]
202        #[unsafe(method_family = none)]
203        pub unsafe fn lineHeight(&self) -> CGFloat;
204
205        #[cfg(feature = "objc2-core-foundation")]
206        /// Setter for [`lineHeight`][Self::lineHeight].
207        #[unsafe(method(setLineHeight:))]
208        #[unsafe(method_family = none)]
209        pub unsafe fn setLineHeight(&self, line_height: CGFloat);
210
211        #[unsafe(method(underlinePresent))]
212        #[unsafe(method_family = none)]
213        pub unsafe fn underlinePresent(&self) -> bool;
214
215        /// Setter for [`underlinePresent`][Self::underlinePresent].
216        #[unsafe(method(setUnderlinePresent:))]
217        #[unsafe(method_family = none)]
218        pub unsafe fn setUnderlinePresent(&self, underline_present: bool);
219
220        #[unsafe(method(strikethroughPresent))]
221        #[unsafe(method_family = none)]
222        pub unsafe fn strikethroughPresent(&self) -> bool;
223
224        /// Setter for [`strikethroughPresent`][Self::strikethroughPresent].
225        #[unsafe(method(setStrikethroughPresent:))]
226        #[unsafe(method_family = none)]
227        pub unsafe fn setStrikethroughPresent(&self, strikethrough_present: bool);
228
229        #[unsafe(method(textAlignments))]
230        #[unsafe(method_family = none)]
231        pub unsafe fn textAlignments(
232            &self,
233        ) -> Retained<NSSet<UITextFormattingViewControllerTextAlignment>>;
234
235        /// Setter for [`textAlignments`][Self::textAlignments].
236        #[unsafe(method(setTextAlignments:))]
237        #[unsafe(method_family = none)]
238        pub unsafe fn setTextAlignments(
239            &self,
240            text_alignments: &NSSet<UITextFormattingViewControllerTextAlignment>,
241        );
242
243        #[unsafe(method(textLists))]
244        #[unsafe(method_family = none)]
245        pub unsafe fn textLists(&self) -> Retained<NSSet<UITextFormattingViewControllerTextList>>;
246
247        /// Setter for [`textLists`][Self::textLists].
248        #[unsafe(method(setTextLists:))]
249        #[unsafe(method_family = none)]
250        pub unsafe fn setTextLists(
251            &self,
252            text_lists: &NSSet<UITextFormattingViewControllerTextList>,
253        );
254
255        #[unsafe(method(highlights))]
256        #[unsafe(method_family = none)]
257        pub unsafe fn highlights(&self)
258            -> Retained<NSSet<UITextFormattingViewControllerHighlight>>;
259
260        /// Setter for [`highlights`][Self::highlights].
261        #[unsafe(method(setHighlights:))]
262        #[unsafe(method_family = none)]
263        pub unsafe fn setHighlights(
264            &self,
265            highlights: &NSSet<UITextFormattingViewControllerHighlight>,
266        );
267
268        #[unsafe(method(formattingStyleKey))]
269        #[unsafe(method_family = none)]
270        pub unsafe fn formattingStyleKey(&self) -> Option<Retained<NSString>>;
271
272        /// Setter for [`formattingStyleKey`][Self::formattingStyleKey].
273        #[unsafe(method(setFormattingStyleKey:))]
274        #[unsafe(method_family = none)]
275        pub unsafe fn setFormattingStyleKey(&self, formatting_style_key: Option<&NSString>);
276    );
277}
278
279/// Methods declared on superclass `NSObject`.
280impl UITextFormattingViewControllerFormattingDescriptor {
281    extern_methods!(
282        #[unsafe(method(new))]
283        #[unsafe(method_family = new)]
284        pub unsafe fn new() -> Retained<Self>;
285    );
286}