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