objc2_ui_kit/generated/
UIPrintPageRenderer.rs1use 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#[repr(transparent)]
15#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
16pub struct UIPrintRenderingQuality(pub NSInteger);
17impl UIPrintRenderingQuality {
18 #[doc(alias = "UIPrintRenderingQualityBest")]
19 pub const Best: Self = Self(0);
20 #[doc(alias = "UIPrintRenderingQualityResponsive")]
21 pub const Responsive: Self = Self(1);
22}
23
24unsafe impl Encode for UIPrintRenderingQuality {
25 const ENCODING: Encoding = NSInteger::ENCODING;
26}
27
28unsafe impl RefEncode for UIPrintRenderingQuality {
29 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
30}
31
32extern_class!(
33 #[unsafe(super(NSObject))]
35 #[thread_kind = MainThreadOnly]
36 #[derive(Debug, PartialEq, Eq, Hash)]
37 pub struct UIPrintPageRenderer;
38);
39
40extern_conformance!(
41 unsafe impl NSObjectProtocol for UIPrintPageRenderer {}
42);
43
44impl UIPrintPageRenderer {
45 extern_methods!(
46 #[cfg(feature = "objc2-core-foundation")]
47 #[unsafe(method(headerHeight))]
48 #[unsafe(method_family = none)]
49 pub unsafe fn headerHeight(&self) -> CGFloat;
50
51 #[cfg(feature = "objc2-core-foundation")]
52 #[unsafe(method(setHeaderHeight:))]
54 #[unsafe(method_family = none)]
55 pub unsafe fn setHeaderHeight(&self, header_height: CGFloat);
56
57 #[cfg(feature = "objc2-core-foundation")]
58 #[unsafe(method(footerHeight))]
59 #[unsafe(method_family = none)]
60 pub unsafe fn footerHeight(&self) -> CGFloat;
61
62 #[cfg(feature = "objc2-core-foundation")]
63 #[unsafe(method(setFooterHeight:))]
65 #[unsafe(method_family = none)]
66 pub unsafe fn setFooterHeight(&self, footer_height: CGFloat);
67
68 #[cfg(feature = "objc2-core-foundation")]
69 #[unsafe(method(paperRect))]
70 #[unsafe(method_family = none)]
71 pub unsafe fn paperRect(&self) -> CGRect;
72
73 #[cfg(feature = "objc2-core-foundation")]
74 #[unsafe(method(printableRect))]
75 #[unsafe(method_family = none)]
76 pub unsafe fn printableRect(&self) -> CGRect;
77
78 #[unsafe(method(numberOfPages))]
79 #[unsafe(method_family = none)]
80 pub unsafe fn numberOfPages(&self) -> NSInteger;
81
82 #[cfg(feature = "UIPrintFormatter")]
83 #[unsafe(method(printFormatters))]
84 #[unsafe(method_family = none)]
85 pub unsafe fn printFormatters(&self) -> Option<Retained<NSArray<UIPrintFormatter>>>;
86
87 #[cfg(feature = "UIPrintFormatter")]
88 #[unsafe(method(setPrintFormatters:))]
90 #[unsafe(method_family = none)]
91 pub unsafe fn setPrintFormatters(
92 &self,
93 print_formatters: Option<&NSArray<UIPrintFormatter>>,
94 );
95
96 #[cfg(feature = "UIPrintFormatter")]
97 #[unsafe(method(printFormattersForPageAtIndex:))]
98 #[unsafe(method_family = none)]
99 pub unsafe fn printFormattersForPageAtIndex(
100 &self,
101 page_index: NSInteger,
102 ) -> Option<Retained<NSArray<UIPrintFormatter>>>;
103
104 #[cfg(feature = "UIPrintFormatter")]
105 #[unsafe(method(addPrintFormatter:startingAtPageAtIndex:))]
106 #[unsafe(method_family = none)]
107 pub unsafe fn addPrintFormatter_startingAtPageAtIndex(
108 &self,
109 formatter: &UIPrintFormatter,
110 page_index: NSInteger,
111 );
112
113 #[unsafe(method(currentRenderingQualityForRequestedRenderingQuality:))]
114 #[unsafe(method_family = none)]
115 pub unsafe fn currentRenderingQualityForRequestedRenderingQuality(
116 &self,
117 requested_rendering_quality: UIPrintRenderingQuality,
118 ) -> UIPrintRenderingQuality;
119
120 #[unsafe(method(prepareForDrawingPages:))]
121 #[unsafe(method_family = none)]
122 pub unsafe fn prepareForDrawingPages(&self, range: NSRange);
123
124 #[cfg(feature = "objc2-core-foundation")]
125 #[unsafe(method(drawPageAtIndex:inRect:))]
126 #[unsafe(method_family = none)]
127 pub unsafe fn drawPageAtIndex_inRect(&self, page_index: NSInteger, printable_rect: CGRect);
128
129 #[cfg(feature = "UIPrintFormatter")]
130 #[unsafe(method(drawPrintFormatter:forPageAtIndex:))]
131 #[unsafe(method_family = none)]
132 pub unsafe fn drawPrintFormatter_forPageAtIndex(
133 &self,
134 print_formatter: &UIPrintFormatter,
135 page_index: NSInteger,
136 );
137
138 #[cfg(feature = "objc2-core-foundation")]
139 #[unsafe(method(drawHeaderForPageAtIndex:inRect:))]
140 #[unsafe(method_family = none)]
141 pub unsafe fn drawHeaderForPageAtIndex_inRect(
142 &self,
143 page_index: NSInteger,
144 header_rect: CGRect,
145 );
146
147 #[cfg(feature = "objc2-core-foundation")]
148 #[unsafe(method(drawContentForPageAtIndex:inRect:))]
149 #[unsafe(method_family = none)]
150 pub unsafe fn drawContentForPageAtIndex_inRect(
151 &self,
152 page_index: NSInteger,
153 content_rect: CGRect,
154 );
155
156 #[cfg(feature = "objc2-core-foundation")]
157 #[unsafe(method(drawFooterForPageAtIndex:inRect:))]
158 #[unsafe(method_family = none)]
159 pub unsafe fn drawFooterForPageAtIndex_inRect(
160 &self,
161 page_index: NSInteger,
162 footer_rect: CGRect,
163 );
164 );
165}
166
167impl UIPrintPageRenderer {
169 extern_methods!(
170 #[unsafe(method(init))]
171 #[unsafe(method_family = init)]
172 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
173
174 #[unsafe(method(new))]
175 #[unsafe(method_family = new)]
176 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
177 );
178}