objc2_ui_kit/generated/
UIPrintFormatter.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
12extern_class!(
13    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiprintformatter?language=objc)
14    #[unsafe(super(NSObject))]
15    #[thread_kind = MainThreadOnly]
16    #[derive(Debug, PartialEq, Eq, Hash)]
17    pub struct UIPrintFormatter;
18);
19
20extern_conformance!(
21    unsafe impl NSCopying for UIPrintFormatter {}
22);
23
24unsafe impl CopyingHelper for UIPrintFormatter {
25    type Result = Self;
26}
27
28extern_conformance!(
29    unsafe impl NSObjectProtocol for UIPrintFormatter {}
30);
31
32impl UIPrintFormatter {
33    extern_methods!(
34        #[cfg(feature = "UIPrintPageRenderer")]
35        #[unsafe(method(printPageRenderer))]
36        #[unsafe(method_family = none)]
37        pub unsafe fn printPageRenderer(&self) -> Option<Retained<UIPrintPageRenderer>>;
38
39        #[unsafe(method(removeFromPrintPageRenderer))]
40        #[unsafe(method_family = none)]
41        pub unsafe fn removeFromPrintPageRenderer(&self);
42
43        #[cfg(feature = "objc2-core-foundation")]
44        #[unsafe(method(maximumContentHeight))]
45        #[unsafe(method_family = none)]
46        pub unsafe fn maximumContentHeight(&self) -> CGFloat;
47
48        #[cfg(feature = "objc2-core-foundation")]
49        /// Setter for [`maximumContentHeight`][Self::maximumContentHeight].
50        #[unsafe(method(setMaximumContentHeight:))]
51        #[unsafe(method_family = none)]
52        pub unsafe fn setMaximumContentHeight(&self, maximum_content_height: CGFloat);
53
54        #[cfg(feature = "objc2-core-foundation")]
55        #[unsafe(method(maximumContentWidth))]
56        #[unsafe(method_family = none)]
57        pub unsafe fn maximumContentWidth(&self) -> CGFloat;
58
59        #[cfg(feature = "objc2-core-foundation")]
60        /// Setter for [`maximumContentWidth`][Self::maximumContentWidth].
61        #[unsafe(method(setMaximumContentWidth:))]
62        #[unsafe(method_family = none)]
63        pub unsafe fn setMaximumContentWidth(&self, maximum_content_width: CGFloat);
64
65        #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
66        #[deprecated]
67        #[unsafe(method(contentInsets))]
68        #[unsafe(method_family = none)]
69        pub unsafe fn contentInsets(&self) -> UIEdgeInsets;
70
71        #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
72        /// Setter for [`contentInsets`][Self::contentInsets].
73        #[deprecated]
74        #[unsafe(method(setContentInsets:))]
75        #[unsafe(method_family = none)]
76        pub unsafe fn setContentInsets(&self, content_insets: UIEdgeInsets);
77
78        #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
79        #[unsafe(method(perPageContentInsets))]
80        #[unsafe(method_family = none)]
81        pub unsafe fn perPageContentInsets(&self) -> UIEdgeInsets;
82
83        #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
84        /// Setter for [`perPageContentInsets`][Self::perPageContentInsets].
85        #[unsafe(method(setPerPageContentInsets:))]
86        #[unsafe(method_family = none)]
87        pub unsafe fn setPerPageContentInsets(&self, per_page_content_insets: UIEdgeInsets);
88
89        #[unsafe(method(startPage))]
90        #[unsafe(method_family = none)]
91        pub unsafe fn startPage(&self) -> NSInteger;
92
93        /// Setter for [`startPage`][Self::startPage].
94        #[unsafe(method(setStartPage:))]
95        #[unsafe(method_family = none)]
96        pub unsafe fn setStartPage(&self, start_page: NSInteger);
97
98        #[unsafe(method(pageCount))]
99        #[unsafe(method_family = none)]
100        pub unsafe fn pageCount(&self) -> NSInteger;
101
102        #[unsafe(method(requiresMainThread))]
103        #[unsafe(method_family = none)]
104        pub unsafe fn requiresMainThread(&self) -> bool;
105
106        #[cfg(feature = "objc2-core-foundation")]
107        #[unsafe(method(rectForPageAtIndex:))]
108        #[unsafe(method_family = none)]
109        pub unsafe fn rectForPageAtIndex(&self, page_index: NSInteger) -> CGRect;
110
111        #[cfg(feature = "objc2-core-foundation")]
112        #[unsafe(method(drawInRect:forPageAtIndex:))]
113        #[unsafe(method_family = none)]
114        pub unsafe fn drawInRect_forPageAtIndex(&self, rect: CGRect, page_index: NSInteger);
115    );
116}
117
118/// Methods declared on superclass `NSObject`.
119impl UIPrintFormatter {
120    extern_methods!(
121        #[unsafe(method(init))]
122        #[unsafe(method_family = init)]
123        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
124
125        #[unsafe(method(new))]
126        #[unsafe(method_family = new)]
127        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
128    );
129}
130
131extern_class!(
132    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uisimpletextprintformatter?language=objc)
133    #[unsafe(super(UIPrintFormatter, NSObject))]
134    #[thread_kind = MainThreadOnly]
135    #[derive(Debug, PartialEq, Eq, Hash)]
136    pub struct UISimpleTextPrintFormatter;
137);
138
139extern_conformance!(
140    unsafe impl NSCopying for UISimpleTextPrintFormatter {}
141);
142
143unsafe impl CopyingHelper for UISimpleTextPrintFormatter {
144    type Result = Self;
145}
146
147extern_conformance!(
148    unsafe impl NSObjectProtocol for UISimpleTextPrintFormatter {}
149);
150
151impl UISimpleTextPrintFormatter {
152    extern_methods!(
153        #[unsafe(method(initWithText:))]
154        #[unsafe(method_family = init)]
155        pub unsafe fn initWithText(this: Allocated<Self>, text: &NSString) -> Retained<Self>;
156
157        #[unsafe(method(initWithAttributedText:))]
158        #[unsafe(method_family = init)]
159        pub unsafe fn initWithAttributedText(
160            this: Allocated<Self>,
161            attributed_text: &NSAttributedString,
162        ) -> Retained<Self>;
163
164        #[unsafe(method(text))]
165        #[unsafe(method_family = none)]
166        pub unsafe fn text(&self) -> Option<Retained<NSString>>;
167
168        /// Setter for [`text`][Self::text].
169        #[unsafe(method(setText:))]
170        #[unsafe(method_family = none)]
171        pub unsafe fn setText(&self, text: Option<&NSString>);
172
173        #[unsafe(method(attributedText))]
174        #[unsafe(method_family = none)]
175        pub unsafe fn attributedText(&self) -> Option<Retained<NSAttributedString>>;
176
177        /// Setter for [`attributedText`][Self::attributedText].
178        #[unsafe(method(setAttributedText:))]
179        #[unsafe(method_family = none)]
180        pub unsafe fn setAttributedText(&self, attributed_text: Option<&NSAttributedString>);
181
182        #[cfg(feature = "UIFont")]
183        #[unsafe(method(font))]
184        #[unsafe(method_family = none)]
185        pub unsafe fn font(&self) -> Option<Retained<UIFont>>;
186
187        #[cfg(feature = "UIFont")]
188        /// Setter for [`font`][Self::font].
189        #[unsafe(method(setFont:))]
190        #[unsafe(method_family = none)]
191        pub unsafe fn setFont(&self, font: Option<&UIFont>);
192
193        #[cfg(feature = "UIColor")]
194        #[unsafe(method(color))]
195        #[unsafe(method_family = none)]
196        pub unsafe fn color(&self) -> Option<Retained<UIColor>>;
197
198        #[cfg(feature = "UIColor")]
199        /// Setter for [`color`][Self::color].
200        #[unsafe(method(setColor:))]
201        #[unsafe(method_family = none)]
202        pub unsafe fn setColor(&self, color: Option<&UIColor>);
203
204        #[cfg(feature = "NSText")]
205        #[unsafe(method(textAlignment))]
206        #[unsafe(method_family = none)]
207        pub unsafe fn textAlignment(&self) -> NSTextAlignment;
208
209        #[cfg(feature = "NSText")]
210        /// Setter for [`textAlignment`][Self::textAlignment].
211        #[unsafe(method(setTextAlignment:))]
212        #[unsafe(method_family = none)]
213        pub unsafe fn setTextAlignment(&self, text_alignment: NSTextAlignment);
214    );
215}
216
217/// Methods declared on superclass `NSObject`.
218impl UISimpleTextPrintFormatter {
219    extern_methods!(
220        #[unsafe(method(init))]
221        #[unsafe(method_family = init)]
222        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
223
224        #[unsafe(method(new))]
225        #[unsafe(method_family = new)]
226        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
227    );
228}
229
230extern_class!(
231    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uimarkuptextprintformatter?language=objc)
232    #[unsafe(super(UIPrintFormatter, NSObject))]
233    #[thread_kind = MainThreadOnly]
234    #[derive(Debug, PartialEq, Eq, Hash)]
235    pub struct UIMarkupTextPrintFormatter;
236);
237
238extern_conformance!(
239    unsafe impl NSCopying for UIMarkupTextPrintFormatter {}
240);
241
242unsafe impl CopyingHelper for UIMarkupTextPrintFormatter {
243    type Result = Self;
244}
245
246extern_conformance!(
247    unsafe impl NSObjectProtocol for UIMarkupTextPrintFormatter {}
248);
249
250impl UIMarkupTextPrintFormatter {
251    extern_methods!(
252        #[unsafe(method(initWithMarkupText:))]
253        #[unsafe(method_family = init)]
254        pub unsafe fn initWithMarkupText(
255            this: Allocated<Self>,
256            markup_text: &NSString,
257        ) -> Retained<Self>;
258
259        #[unsafe(method(markupText))]
260        #[unsafe(method_family = none)]
261        pub unsafe fn markupText(&self) -> Option<Retained<NSString>>;
262
263        /// Setter for [`markupText`][Self::markupText].
264        #[unsafe(method(setMarkupText:))]
265        #[unsafe(method_family = none)]
266        pub unsafe fn setMarkupText(&self, markup_text: Option<&NSString>);
267    );
268}
269
270/// Methods declared on superclass `NSObject`.
271impl UIMarkupTextPrintFormatter {
272    extern_methods!(
273        #[unsafe(method(init))]
274        #[unsafe(method_family = init)]
275        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
276
277        #[unsafe(method(new))]
278        #[unsafe(method_family = new)]
279        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
280    );
281}
282
283extern_class!(
284    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiviewprintformatter?language=objc)
285    #[unsafe(super(UIPrintFormatter, NSObject))]
286    #[thread_kind = MainThreadOnly]
287    #[derive(Debug, PartialEq, Eq, Hash)]
288    pub struct UIViewPrintFormatter;
289);
290
291extern_conformance!(
292    unsafe impl NSCopying for UIViewPrintFormatter {}
293);
294
295unsafe impl CopyingHelper for UIViewPrintFormatter {
296    type Result = Self;
297}
298
299extern_conformance!(
300    unsafe impl NSObjectProtocol for UIViewPrintFormatter {}
301);
302
303impl UIViewPrintFormatter {
304    extern_methods!(
305        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
306        #[unsafe(method(view))]
307        #[unsafe(method_family = none)]
308        pub unsafe fn view(&self) -> Retained<UIView>;
309    );
310}
311
312/// Methods declared on superclass `NSObject`.
313impl UIViewPrintFormatter {
314    extern_methods!(
315        #[unsafe(method(init))]
316        #[unsafe(method_family = init)]
317        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
318
319        #[unsafe(method(new))]
320        #[unsafe(method_family = new)]
321        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
322    );
323}
324
325/// UIPrintFormatter.
326#[cfg(all(feature = "UIResponder", feature = "UIView"))]
327impl UIView {
328    extern_methods!(
329        #[unsafe(method(viewPrintFormatter))]
330        #[unsafe(method_family = none)]
331        pub unsafe fn viewPrintFormatter(&self) -> Retained<UIViewPrintFormatter>;
332
333        #[cfg(feature = "objc2-core-foundation")]
334        #[unsafe(method(drawRect:forViewPrintFormatter:))]
335        #[unsafe(method_family = none)]
336        pub unsafe fn drawRect_forViewPrintFormatter(
337            &self,
338            rect: CGRect,
339            formatter: &UIViewPrintFormatter,
340        );
341    );
342}