objc2_ui_kit/generated/
UIGraphicsPDFRenderer.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#[cfg(all(feature = "UIGraphicsRenderer", feature = "block2"))]
14pub type UIGraphicsPDFDrawingActions =
15 *mut block2::DynBlock<dyn Fn(NonNull<UIGraphicsPDFRendererContext>)>;
16
17extern_class!(
18 #[unsafe(super(UIGraphicsRendererFormat, NSObject))]
20 #[derive(Debug, PartialEq, Eq, Hash)]
21 #[cfg(feature = "UIGraphicsRenderer")]
22 pub struct UIGraphicsPDFRendererFormat;
23);
24
25#[cfg(feature = "UIGraphicsRenderer")]
26extern_conformance!(
27 unsafe impl NSCopying for UIGraphicsPDFRendererFormat {}
28);
29
30#[cfg(feature = "UIGraphicsRenderer")]
31unsafe impl CopyingHelper for UIGraphicsPDFRendererFormat {
32 type Result = Self;
33}
34
35#[cfg(feature = "UIGraphicsRenderer")]
36extern_conformance!(
37 unsafe impl NSObjectProtocol for UIGraphicsPDFRendererFormat {}
38);
39
40#[cfg(feature = "UIGraphicsRenderer")]
41impl UIGraphicsPDFRendererFormat {
42 extern_methods!(
43 #[unsafe(method(documentInfo))]
44 #[unsafe(method_family = none)]
45 pub unsafe fn documentInfo(&self) -> Retained<NSDictionary<NSString, AnyObject>>;
46
47 #[unsafe(method(setDocumentInfo:))]
49 #[unsafe(method_family = none)]
50 pub unsafe fn setDocumentInfo(&self, document_info: &NSDictionary<NSString, AnyObject>);
51 );
52}
53
54#[cfg(feature = "UIGraphicsRenderer")]
56impl UIGraphicsPDFRendererFormat {
57 extern_methods!(
58 #[deprecated]
59 #[unsafe(method(defaultFormat))]
60 #[unsafe(method_family = none)]
61 pub unsafe fn defaultFormat() -> Retained<Self>;
62
63 #[unsafe(method(preferredFormat))]
64 #[unsafe(method_family = none)]
65 pub unsafe fn preferredFormat() -> Retained<Self>;
66 );
67}
68
69#[cfg(feature = "UIGraphicsRenderer")]
71impl UIGraphicsPDFRendererFormat {
72 extern_methods!(
73 #[unsafe(method(init))]
74 #[unsafe(method_family = init)]
75 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
76
77 #[unsafe(method(new))]
78 #[unsafe(method_family = new)]
79 pub unsafe fn new() -> Retained<Self>;
80 );
81}
82
83extern_class!(
84 #[unsafe(super(UIGraphicsRendererContext, NSObject))]
86 #[derive(Debug, PartialEq, Eq, Hash)]
87 #[cfg(feature = "UIGraphicsRenderer")]
88 pub struct UIGraphicsPDFRendererContext;
89);
90
91#[cfg(feature = "UIGraphicsRenderer")]
92extern_conformance!(
93 unsafe impl NSObjectProtocol for UIGraphicsPDFRendererContext {}
94);
95
96#[cfg(feature = "UIGraphicsRenderer")]
97impl UIGraphicsPDFRendererContext {
98 extern_methods!(
99 #[cfg(feature = "objc2-core-foundation")]
100 #[unsafe(method(pdfContextBounds))]
101 #[unsafe(method_family = none)]
102 pub unsafe fn pdfContextBounds(&self) -> CGRect;
103
104 #[unsafe(method(beginPage))]
105 #[unsafe(method_family = none)]
106 pub unsafe fn beginPage(&self);
107
108 #[cfg(feature = "objc2-core-foundation")]
109 #[unsafe(method(beginPageWithBounds:pageInfo:))]
110 #[unsafe(method_family = none)]
111 pub unsafe fn beginPageWithBounds_pageInfo(
112 &self,
113 bounds: CGRect,
114 page_info: &NSDictionary<NSString, AnyObject>,
115 );
116
117 #[cfg(feature = "objc2-core-foundation")]
118 #[unsafe(method(setURL:forRect:))]
119 #[unsafe(method_family = none)]
120 pub unsafe fn setURL_forRect(&self, url: &NSURL, rect: CGRect);
121
122 #[cfg(feature = "objc2-core-foundation")]
123 #[unsafe(method(addDestinationWithName:atPoint:))]
124 #[unsafe(method_family = none)]
125 pub unsafe fn addDestinationWithName_atPoint(&self, name: &NSString, point: CGPoint);
126
127 #[cfg(feature = "objc2-core-foundation")]
128 #[unsafe(method(setDestinationWithName:forRect:))]
129 #[unsafe(method_family = none)]
130 pub unsafe fn setDestinationWithName_forRect(&self, name: &NSString, rect: CGRect);
131 );
132}
133
134#[cfg(feature = "UIGraphicsRenderer")]
136impl UIGraphicsPDFRendererContext {
137 extern_methods!(
138 #[unsafe(method(init))]
139 #[unsafe(method_family = init)]
140 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
141
142 #[unsafe(method(new))]
143 #[unsafe(method_family = new)]
144 pub unsafe fn new() -> Retained<Self>;
145 );
146}
147
148extern_class!(
149 #[unsafe(super(UIGraphicsRenderer, NSObject))]
151 #[derive(Debug, PartialEq, Eq, Hash)]
152 #[cfg(feature = "UIGraphicsRenderer")]
153 pub struct UIGraphicsPDFRenderer;
154);
155
156#[cfg(feature = "UIGraphicsRenderer")]
157extern_conformance!(
158 unsafe impl NSObjectProtocol for UIGraphicsPDFRenderer {}
159);
160
161#[cfg(feature = "UIGraphicsRenderer")]
162impl UIGraphicsPDFRenderer {
163 extern_methods!(
164 #[cfg(feature = "objc2-core-foundation")]
165 #[unsafe(method(initWithBounds:format:))]
166 #[unsafe(method_family = init)]
167 pub unsafe fn initWithBounds_format(
168 this: Allocated<Self>,
169 bounds: CGRect,
170 format: &UIGraphicsPDFRendererFormat,
171 ) -> Retained<Self>;
172
173 #[cfg(feature = "block2")]
174 #[unsafe(method(writePDFToURL:withActions:error:_))]
175 #[unsafe(method_family = none)]
176 pub unsafe fn writePDFToURL_withActions_error(
177 &self,
178 url: &NSURL,
179 actions: UIGraphicsPDFDrawingActions,
180 ) -> Result<(), Retained<NSError>>;
181
182 #[cfg(feature = "block2")]
183 #[unsafe(method(PDFDataWithActions:))]
184 #[unsafe(method_family = none)]
185 pub unsafe fn PDFDataWithActions(
186 &self,
187 actions: UIGraphicsPDFDrawingActions,
188 ) -> Retained<NSData>;
189 );
190}
191
192#[cfg(feature = "UIGraphicsRenderer")]
194impl UIGraphicsPDFRenderer {
195 extern_methods!(
196 #[cfg(feature = "objc2-core-foundation")]
197 #[unsafe(method(initWithBounds:))]
198 #[unsafe(method_family = init)]
199 pub unsafe fn initWithBounds(this: Allocated<Self>, bounds: CGRect) -> Retained<Self>;
200 );
201}
202
203#[cfg(feature = "UIGraphicsRenderer")]
205impl UIGraphicsPDFRenderer {
206 extern_methods!(
207 #[unsafe(method(init))]
208 #[unsafe(method_family = init)]
209 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
210
211 #[unsafe(method(new))]
212 #[unsafe(method_family = new)]
213 pub unsafe fn new() -> Retained<Self>;
214 );
215}