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
40unsafe impl NSObjectProtocol for UIPrintPageRenderer {}
41
42impl UIPrintPageRenderer {
43 extern_methods!(
44 #[cfg(feature = "objc2-core-foundation")]
45 #[unsafe(method(headerHeight))]
46 #[unsafe(method_family = none)]
47 pub unsafe fn headerHeight(&self) -> CGFloat;
48
49 #[cfg(feature = "objc2-core-foundation")]
50 #[unsafe(method(setHeaderHeight:))]
52 #[unsafe(method_family = none)]
53 pub unsafe fn setHeaderHeight(&self, header_height: CGFloat);
54
55 #[cfg(feature = "objc2-core-foundation")]
56 #[unsafe(method(footerHeight))]
57 #[unsafe(method_family = none)]
58 pub unsafe fn footerHeight(&self) -> CGFloat;
59
60 #[cfg(feature = "objc2-core-foundation")]
61 #[unsafe(method(setFooterHeight:))]
63 #[unsafe(method_family = none)]
64 pub unsafe fn setFooterHeight(&self, footer_height: CGFloat);
65
66 #[cfg(feature = "objc2-core-foundation")]
67 #[unsafe(method(paperRect))]
68 #[unsafe(method_family = none)]
69 pub unsafe fn paperRect(&self) -> CGRect;
70
71 #[cfg(feature = "objc2-core-foundation")]
72 #[unsafe(method(printableRect))]
73 #[unsafe(method_family = none)]
74 pub unsafe fn printableRect(&self) -> CGRect;
75
76 #[unsafe(method(numberOfPages))]
77 #[unsafe(method_family = none)]
78 pub unsafe fn numberOfPages(&self) -> NSInteger;
79
80 #[cfg(feature = "UIPrintFormatter")]
81 #[unsafe(method(printFormatters))]
82 #[unsafe(method_family = none)]
83 pub unsafe fn printFormatters(&self) -> Option<Retained<NSArray<UIPrintFormatter>>>;
84
85 #[cfg(feature = "UIPrintFormatter")]
86 #[unsafe(method(setPrintFormatters:))]
88 #[unsafe(method_family = none)]
89 pub unsafe fn setPrintFormatters(
90 &self,
91 print_formatters: Option<&NSArray<UIPrintFormatter>>,
92 );
93
94 #[cfg(feature = "UIPrintFormatter")]
95 #[unsafe(method(printFormattersForPageAtIndex:))]
96 #[unsafe(method_family = none)]
97 pub unsafe fn printFormattersForPageAtIndex(
98 &self,
99 page_index: NSInteger,
100 ) -> Option<Retained<NSArray<UIPrintFormatter>>>;
101
102 #[cfg(feature = "UIPrintFormatter")]
103 #[unsafe(method(addPrintFormatter:startingAtPageAtIndex:))]
104 #[unsafe(method_family = none)]
105 pub unsafe fn addPrintFormatter_startingAtPageAtIndex(
106 &self,
107 formatter: &UIPrintFormatter,
108 page_index: NSInteger,
109 );
110
111 #[unsafe(method(currentRenderingQualityForRequestedRenderingQuality:))]
112 #[unsafe(method_family = none)]
113 pub unsafe fn currentRenderingQualityForRequestedRenderingQuality(
114 &self,
115 requested_rendering_quality: UIPrintRenderingQuality,
116 ) -> UIPrintRenderingQuality;
117
118 #[unsafe(method(prepareForDrawingPages:))]
119 #[unsafe(method_family = none)]
120 pub unsafe fn prepareForDrawingPages(&self, range: NSRange);
121
122 #[cfg(feature = "objc2-core-foundation")]
123 #[unsafe(method(drawPageAtIndex:inRect:))]
124 #[unsafe(method_family = none)]
125 pub unsafe fn drawPageAtIndex_inRect(&self, page_index: NSInteger, printable_rect: CGRect);
126
127 #[cfg(feature = "UIPrintFormatter")]
128 #[unsafe(method(drawPrintFormatter:forPageAtIndex:))]
129 #[unsafe(method_family = none)]
130 pub unsafe fn drawPrintFormatter_forPageAtIndex(
131 &self,
132 print_formatter: &UIPrintFormatter,
133 page_index: NSInteger,
134 );
135
136 #[cfg(feature = "objc2-core-foundation")]
137 #[unsafe(method(drawHeaderForPageAtIndex:inRect:))]
138 #[unsafe(method_family = none)]
139 pub unsafe fn drawHeaderForPageAtIndex_inRect(
140 &self,
141 page_index: NSInteger,
142 header_rect: CGRect,
143 );
144
145 #[cfg(feature = "objc2-core-foundation")]
146 #[unsafe(method(drawContentForPageAtIndex:inRect:))]
147 #[unsafe(method_family = none)]
148 pub unsafe fn drawContentForPageAtIndex_inRect(
149 &self,
150 page_index: NSInteger,
151 content_rect: CGRect,
152 );
153
154 #[cfg(feature = "objc2-core-foundation")]
155 #[unsafe(method(drawFooterForPageAtIndex:inRect:))]
156 #[unsafe(method_family = none)]
157 pub unsafe fn drawFooterForPageAtIndex_inRect(
158 &self,
159 page_index: NSInteger,
160 footer_rect: CGRect,
161 );
162 );
163}
164
165impl UIPrintPageRenderer {
167 extern_methods!(
168 #[unsafe(method(init))]
169 #[unsafe(method_family = init)]
170 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
171
172 #[unsafe(method(new))]
173 #[unsafe(method_family = new)]
174 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
175 );
176}