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 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 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        ///
172        /// # Safety
173        ///
174        /// `attributes` generic should be of the correct type.
175        #[unsafe(method(initWithAttributes:))]
176        #[unsafe(method_family = init)]
177        pub unsafe fn initWithAttributes(
178            this: Allocated<Self>,
179            attributes: &NSDictionary<NSAttributedStringKey, AnyObject>,
180        ) -> Retained<Self>;
181
182        #[cfg(feature = "UIFont")]
183        #[unsafe(method(fonts))]
184        #[unsafe(method_family = none)]
185        pub fn fonts(&self) -> Option<Retained<NSArray<UIFont>>>;
186
187        #[cfg(feature = "UIFont")]
188        /// Setter for [`fonts`][Self::fonts].
189        ///
190        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
191        #[unsafe(method(setFonts:))]
192        #[unsafe(method_family = none)]
193        pub fn setFonts(&self, fonts: Option<&NSArray<UIFont>>);
194
195        #[cfg(feature = "UIColor")]
196        #[unsafe(method(textColors))]
197        #[unsafe(method_family = none)]
198        pub fn textColors(&self) -> Option<Retained<NSArray<UIColor>>>;
199
200        #[cfg(feature = "UIColor")]
201        /// Setter for [`textColors`][Self::textColors].
202        ///
203        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
204        #[unsafe(method(setTextColors:))]
205        #[unsafe(method_family = none)]
206        pub fn setTextColors(&self, text_colors: Option<&NSArray<UIColor>>);
207
208        #[cfg(feature = "objc2-core-foundation")]
209        #[unsafe(method(lineHeight))]
210        #[unsafe(method_family = none)]
211        pub fn lineHeight(&self) -> CGFloat;
212
213        #[cfg(feature = "objc2-core-foundation")]
214        /// Setter for [`lineHeight`][Self::lineHeight].
215        #[unsafe(method(setLineHeight:))]
216        #[unsafe(method_family = none)]
217        pub fn setLineHeight(&self, line_height: CGFloat);
218
219        #[unsafe(method(underlinePresent))]
220        #[unsafe(method_family = none)]
221        pub fn underlinePresent(&self) -> bool;
222
223        /// Setter for [`underlinePresent`][Self::underlinePresent].
224        #[unsafe(method(setUnderlinePresent:))]
225        #[unsafe(method_family = none)]
226        pub fn setUnderlinePresent(&self, underline_present: bool);
227
228        #[unsafe(method(strikethroughPresent))]
229        #[unsafe(method_family = none)]
230        pub fn strikethroughPresent(&self) -> bool;
231
232        /// Setter for [`strikethroughPresent`][Self::strikethroughPresent].
233        #[unsafe(method(setStrikethroughPresent:))]
234        #[unsafe(method_family = none)]
235        pub fn setStrikethroughPresent(&self, strikethrough_present: bool);
236
237        #[unsafe(method(textAlignments))]
238        #[unsafe(method_family = none)]
239        pub fn textAlignments(
240            &self,
241        ) -> Retained<NSSet<UITextFormattingViewControllerTextAlignment>>;
242
243        /// Setter for [`textAlignments`][Self::textAlignments].
244        ///
245        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
246        #[unsafe(method(setTextAlignments:))]
247        #[unsafe(method_family = none)]
248        pub fn setTextAlignments(
249            &self,
250            text_alignments: &NSSet<UITextFormattingViewControllerTextAlignment>,
251        );
252
253        #[unsafe(method(textLists))]
254        #[unsafe(method_family = none)]
255        pub fn textLists(&self) -> Retained<NSSet<UITextFormattingViewControllerTextList>>;
256
257        /// Setter for [`textLists`][Self::textLists].
258        ///
259        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
260        #[unsafe(method(setTextLists:))]
261        #[unsafe(method_family = none)]
262        pub fn setTextLists(&self, text_lists: &NSSet<UITextFormattingViewControllerTextList>);
263
264        #[unsafe(method(highlights))]
265        #[unsafe(method_family = none)]
266        pub fn highlights(&self) -> Retained<NSSet<UITextFormattingViewControllerHighlight>>;
267
268        /// Setter for [`highlights`][Self::highlights].
269        ///
270        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
271        #[unsafe(method(setHighlights:))]
272        #[unsafe(method_family = none)]
273        pub fn setHighlights(&self, highlights: &NSSet<UITextFormattingViewControllerHighlight>);
274
275        #[unsafe(method(formattingStyleKey))]
276        #[unsafe(method_family = none)]
277        pub fn formattingStyleKey(&self) -> Option<Retained<NSString>>;
278
279        /// Setter for [`formattingStyleKey`][Self::formattingStyleKey].
280        ///
281        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
282        #[unsafe(method(setFormattingStyleKey:))]
283        #[unsafe(method_family = none)]
284        pub fn setFormattingStyleKey(&self, formatting_style_key: Option<&NSString>);
285    );
286}
287
288/// Methods declared on superclass `NSObject`.
289impl UITextFormattingViewControllerFormattingDescriptor {
290    extern_methods!(
291        #[unsafe(method(new))]
292        #[unsafe(method_family = new)]
293        pub fn new() -> Retained<Self>;
294    );
295}
296
297impl DefaultRetained for UITextFormattingViewControllerFormattingDescriptor {
298    #[inline]
299    fn default_retained() -> Retained<Self> {
300        Self::new()
301    }
302}