objc2_app_kit/generated/
NSPrintInfo.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 NSPaperOrientation(pub NSInteger);
17impl NSPaperOrientation {
18 #[doc(alias = "NSPaperOrientationPortrait")]
19 pub const Portrait: Self = Self(0);
20 #[doc(alias = "NSPaperOrientationLandscape")]
21 pub const Landscape: Self = Self(1);
22}
23
24unsafe impl Encode for NSPaperOrientation {
25 const ENCODING: Encoding = NSInteger::ENCODING;
26}
27
28unsafe impl RefEncode for NSPaperOrientation {
29 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
30}
31
32#[repr(transparent)]
35#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
36pub struct NSPrintingPaginationMode(pub NSUInteger);
37impl NSPrintingPaginationMode {
38 #[doc(alias = "NSPrintingPaginationModeAutomatic")]
39 pub const Automatic: Self = Self(0);
40 #[doc(alias = "NSPrintingPaginationModeFit")]
41 pub const Fit: Self = Self(1);
42 #[doc(alias = "NSPrintingPaginationModeClip")]
43 pub const Clip: Self = Self(2);
44}
45
46unsafe impl Encode for NSPrintingPaginationMode {
47 const ENCODING: Encoding = NSUInteger::ENCODING;
48}
49
50unsafe impl RefEncode for NSPrintingPaginationMode {
51 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
52}
53
54pub type NSPrintInfoAttributeKey = NSString;
57
58extern "C" {
59 pub static NSPrintPaperName: &'static NSPrintInfoAttributeKey;
61}
62
63extern "C" {
64 pub static NSPrintPaperSize: &'static NSPrintInfoAttributeKey;
66}
67
68extern "C" {
69 pub static NSPrintOrientation: &'static NSPrintInfoAttributeKey;
71}
72
73extern "C" {
74 pub static NSPrintScalingFactor: &'static NSPrintInfoAttributeKey;
76}
77
78extern "C" {
79 pub static NSPrintLeftMargin: &'static NSPrintInfoAttributeKey;
81}
82
83extern "C" {
84 pub static NSPrintRightMargin: &'static NSPrintInfoAttributeKey;
86}
87
88extern "C" {
89 pub static NSPrintTopMargin: &'static NSPrintInfoAttributeKey;
91}
92
93extern "C" {
94 pub static NSPrintBottomMargin: &'static NSPrintInfoAttributeKey;
96}
97
98extern "C" {
99 pub static NSPrintHorizontallyCentered: &'static NSPrintInfoAttributeKey;
101}
102
103extern "C" {
104 pub static NSPrintVerticallyCentered: &'static NSPrintInfoAttributeKey;
106}
107
108extern "C" {
109 pub static NSPrintHorizontalPagination: &'static NSPrintInfoAttributeKey;
111}
112
113extern "C" {
114 pub static NSPrintVerticalPagination: &'static NSPrintInfoAttributeKey;
116}
117
118extern "C" {
119 pub static NSPrintPrinter: &'static NSPrintInfoAttributeKey;
121}
122
123extern "C" {
124 pub static NSPrintCopies: &'static NSPrintInfoAttributeKey;
126}
127
128extern "C" {
129 pub static NSPrintAllPages: &'static NSPrintInfoAttributeKey;
131}
132
133extern "C" {
134 pub static NSPrintFirstPage: &'static NSPrintInfoAttributeKey;
136}
137
138extern "C" {
139 pub static NSPrintLastPage: &'static NSPrintInfoAttributeKey;
141}
142
143extern "C" {
144 pub static NSPrintMustCollate: &'static NSPrintInfoAttributeKey;
146}
147
148extern "C" {
149 pub static NSPrintReversePageOrder: &'static NSPrintInfoAttributeKey;
151}
152
153extern "C" {
154 pub static NSPrintJobDisposition: &'static NSPrintInfoAttributeKey;
156}
157
158extern "C" {
159 pub static NSPrintPagesAcross: &'static NSPrintInfoAttributeKey;
161}
162
163extern "C" {
164 pub static NSPrintPagesDown: &'static NSPrintInfoAttributeKey;
166}
167
168extern "C" {
169 pub static NSPrintTime: &'static NSPrintInfoAttributeKey;
171}
172
173extern "C" {
174 pub static NSPrintDetailedErrorReporting: &'static NSPrintInfoAttributeKey;
176}
177
178extern "C" {
179 pub static NSPrintFaxNumber: &'static NSPrintInfoAttributeKey;
181}
182
183extern "C" {
184 pub static NSPrintPrinterName: &'static NSPrintInfoAttributeKey;
186}
187
188extern "C" {
189 pub static NSPrintSelectionOnly: &'static NSPrintInfoAttributeKey;
191}
192
193extern "C" {
194 pub static NSPrintJobSavingURL: &'static NSPrintInfoAttributeKey;
196}
197
198extern "C" {
199 pub static NSPrintJobSavingFileNameExtensionHidden: &'static NSPrintInfoAttributeKey;
201}
202
203extern "C" {
204 pub static NSPrintHeaderAndFooter: &'static NSPrintInfoAttributeKey;
206}
207
208pub type NSPrintJobDispositionValue = NSString;
211
212extern "C" {
213 pub static NSPrintSpoolJob: &'static NSPrintJobDispositionValue;
215}
216
217extern "C" {
218 pub static NSPrintPreviewJob: &'static NSPrintJobDispositionValue;
220}
221
222extern "C" {
223 pub static NSPrintSaveJob: &'static NSPrintJobDispositionValue;
225}
226
227extern "C" {
228 pub static NSPrintCancelJob: &'static NSPrintJobDispositionValue;
230}
231
232pub type NSPrintInfoSettingKey = NSString;
234
235extern_class!(
236 #[unsafe(super(NSObject))]
238 #[derive(Debug, PartialEq, Eq, Hash)]
239 pub struct NSPrintInfo;
240);
241
242extern_conformance!(
243 unsafe impl NSCoding for NSPrintInfo {}
244);
245
246extern_conformance!(
247 unsafe impl NSCopying for NSPrintInfo {}
248);
249
250unsafe impl CopyingHelper for NSPrintInfo {
251 type Result = Self;
252}
253
254extern_conformance!(
255 unsafe impl NSObjectProtocol for NSPrintInfo {}
256);
257
258impl NSPrintInfo {
259 extern_methods!(
260 #[unsafe(method(sharedPrintInfo))]
261 #[unsafe(method_family = none)]
262 pub unsafe fn sharedPrintInfo() -> Retained<NSPrintInfo>;
263
264 #[unsafe(method(setSharedPrintInfo:))]
266 #[unsafe(method_family = none)]
267 pub unsafe fn setSharedPrintInfo(shared_print_info: &NSPrintInfo);
268
269 #[unsafe(method(initWithDictionary:))]
270 #[unsafe(method_family = init)]
271 pub unsafe fn initWithDictionary(
272 this: Allocated<Self>,
273 attributes: &NSDictionary<NSPrintInfoAttributeKey, AnyObject>,
274 ) -> Retained<Self>;
275
276 #[unsafe(method(initWithCoder:))]
277 #[unsafe(method_family = init)]
278 pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Retained<Self>;
279
280 #[unsafe(method(init))]
281 #[unsafe(method_family = init)]
282 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
283
284 #[unsafe(method(dictionary))]
285 #[unsafe(method_family = none)]
286 pub unsafe fn dictionary(
287 &self,
288 ) -> Retained<NSMutableDictionary<NSPrintInfoAttributeKey, AnyObject>>;
289
290 #[cfg(feature = "NSPrinter")]
291 #[unsafe(method(paperName))]
292 #[unsafe(method_family = none)]
293 pub unsafe fn paperName(&self) -> Option<Retained<NSPrinterPaperName>>;
294
295 #[cfg(feature = "NSPrinter")]
296 #[unsafe(method(setPaperName:))]
298 #[unsafe(method_family = none)]
299 pub unsafe fn setPaperName(&self, paper_name: Option<&NSPrinterPaperName>);
300
301 #[unsafe(method(paperSize))]
302 #[unsafe(method_family = none)]
303 pub unsafe fn paperSize(&self) -> NSSize;
304
305 #[unsafe(method(setPaperSize:))]
307 #[unsafe(method_family = none)]
308 pub unsafe fn setPaperSize(&self, paper_size: NSSize);
309
310 #[unsafe(method(orientation))]
311 #[unsafe(method_family = none)]
312 pub unsafe fn orientation(&self) -> NSPaperOrientation;
313
314 #[unsafe(method(setOrientation:))]
316 #[unsafe(method_family = none)]
317 pub unsafe fn setOrientation(&self, orientation: NSPaperOrientation);
318
319 #[cfg(feature = "objc2-core-foundation")]
320 #[unsafe(method(scalingFactor))]
321 #[unsafe(method_family = none)]
322 pub unsafe fn scalingFactor(&self) -> CGFloat;
323
324 #[cfg(feature = "objc2-core-foundation")]
325 #[unsafe(method(setScalingFactor:))]
327 #[unsafe(method_family = none)]
328 pub unsafe fn setScalingFactor(&self, scaling_factor: CGFloat);
329
330 #[cfg(feature = "objc2-core-foundation")]
331 #[unsafe(method(leftMargin))]
332 #[unsafe(method_family = none)]
333 pub unsafe fn leftMargin(&self) -> CGFloat;
334
335 #[cfg(feature = "objc2-core-foundation")]
336 #[unsafe(method(setLeftMargin:))]
338 #[unsafe(method_family = none)]
339 pub unsafe fn setLeftMargin(&self, left_margin: CGFloat);
340
341 #[cfg(feature = "objc2-core-foundation")]
342 #[unsafe(method(rightMargin))]
343 #[unsafe(method_family = none)]
344 pub unsafe fn rightMargin(&self) -> CGFloat;
345
346 #[cfg(feature = "objc2-core-foundation")]
347 #[unsafe(method(setRightMargin:))]
349 #[unsafe(method_family = none)]
350 pub unsafe fn setRightMargin(&self, right_margin: CGFloat);
351
352 #[cfg(feature = "objc2-core-foundation")]
353 #[unsafe(method(topMargin))]
354 #[unsafe(method_family = none)]
355 pub unsafe fn topMargin(&self) -> CGFloat;
356
357 #[cfg(feature = "objc2-core-foundation")]
358 #[unsafe(method(setTopMargin:))]
360 #[unsafe(method_family = none)]
361 pub unsafe fn setTopMargin(&self, top_margin: CGFloat);
362
363 #[cfg(feature = "objc2-core-foundation")]
364 #[unsafe(method(bottomMargin))]
365 #[unsafe(method_family = none)]
366 pub unsafe fn bottomMargin(&self) -> CGFloat;
367
368 #[cfg(feature = "objc2-core-foundation")]
369 #[unsafe(method(setBottomMargin:))]
371 #[unsafe(method_family = none)]
372 pub unsafe fn setBottomMargin(&self, bottom_margin: CGFloat);
373
374 #[unsafe(method(isHorizontallyCentered))]
375 #[unsafe(method_family = none)]
376 pub unsafe fn isHorizontallyCentered(&self) -> bool;
377
378 #[unsafe(method(setHorizontallyCentered:))]
380 #[unsafe(method_family = none)]
381 pub unsafe fn setHorizontallyCentered(&self, horizontally_centered: bool);
382
383 #[unsafe(method(isVerticallyCentered))]
384 #[unsafe(method_family = none)]
385 pub unsafe fn isVerticallyCentered(&self) -> bool;
386
387 #[unsafe(method(setVerticallyCentered:))]
389 #[unsafe(method_family = none)]
390 pub unsafe fn setVerticallyCentered(&self, vertically_centered: bool);
391
392 #[unsafe(method(horizontalPagination))]
393 #[unsafe(method_family = none)]
394 pub unsafe fn horizontalPagination(&self) -> NSPrintingPaginationMode;
395
396 #[unsafe(method(setHorizontalPagination:))]
398 #[unsafe(method_family = none)]
399 pub unsafe fn setHorizontalPagination(
400 &self,
401 horizontal_pagination: NSPrintingPaginationMode,
402 );
403
404 #[unsafe(method(verticalPagination))]
405 #[unsafe(method_family = none)]
406 pub unsafe fn verticalPagination(&self) -> NSPrintingPaginationMode;
407
408 #[unsafe(method(setVerticalPagination:))]
410 #[unsafe(method_family = none)]
411 pub unsafe fn setVerticalPagination(&self, vertical_pagination: NSPrintingPaginationMode);
412
413 #[unsafe(method(jobDisposition))]
414 #[unsafe(method_family = none)]
415 pub unsafe fn jobDisposition(&self) -> Retained<NSPrintJobDispositionValue>;
416
417 #[unsafe(method(setJobDisposition:))]
419 #[unsafe(method_family = none)]
420 pub unsafe fn setJobDisposition(&self, job_disposition: &NSPrintJobDispositionValue);
421
422 #[cfg(feature = "NSPrinter")]
423 #[unsafe(method(printer))]
424 #[unsafe(method_family = none)]
425 pub unsafe fn printer(&self) -> Retained<NSPrinter>;
426
427 #[cfg(feature = "NSPrinter")]
428 #[unsafe(method(setPrinter:))]
430 #[unsafe(method_family = none)]
431 pub unsafe fn setPrinter(&self, printer: &NSPrinter);
432
433 #[unsafe(method(setUpPrintOperationDefaultValues))]
434 #[unsafe(method_family = none)]
435 pub unsafe fn setUpPrintOperationDefaultValues(&self);
436
437 #[unsafe(method(imageablePageBounds))]
438 #[unsafe(method_family = none)]
439 pub unsafe fn imageablePageBounds(&self) -> NSRect;
440
441 #[unsafe(method(localizedPaperName))]
442 #[unsafe(method_family = none)]
443 pub unsafe fn localizedPaperName(&self) -> Option<Retained<NSString>>;
444
445 #[cfg(feature = "NSPrinter")]
446 #[unsafe(method(defaultPrinter))]
447 #[unsafe(method_family = none)]
448 pub unsafe fn defaultPrinter() -> Option<Retained<NSPrinter>>;
449
450 #[unsafe(method(printSettings))]
451 #[unsafe(method_family = none)]
452 pub unsafe fn printSettings(
453 &self,
454 ) -> Retained<NSMutableDictionary<NSPrintInfoSettingKey, AnyObject>>;
455
456 #[unsafe(method(PMPrintSession))]
457 #[unsafe(method_family = none)]
458 pub unsafe fn PMPrintSession(&self) -> NonNull<c_void>;
459
460 #[unsafe(method(PMPageFormat))]
461 #[unsafe(method_family = none)]
462 pub unsafe fn PMPageFormat(&self) -> NonNull<c_void>;
463
464 #[unsafe(method(PMPrintSettings))]
465 #[unsafe(method_family = none)]
466 pub unsafe fn PMPrintSettings(&self) -> NonNull<c_void>;
467
468 #[unsafe(method(updateFromPMPageFormat))]
469 #[unsafe(method_family = none)]
470 pub unsafe fn updateFromPMPageFormat(&self);
471
472 #[unsafe(method(updateFromPMPrintSettings))]
473 #[unsafe(method_family = none)]
474 pub unsafe fn updateFromPMPrintSettings(&self);
475
476 #[unsafe(method(isSelectionOnly))]
477 #[unsafe(method_family = none)]
478 pub unsafe fn isSelectionOnly(&self) -> bool;
479
480 #[unsafe(method(setSelectionOnly:))]
482 #[unsafe(method_family = none)]
483 pub unsafe fn setSelectionOnly(&self, selection_only: bool);
484
485 #[cfg(feature = "NSPDFInfo")]
486 #[unsafe(method(takeSettingsFromPDFInfo:))]
487 #[unsafe(method_family = none)]
488 pub unsafe fn takeSettingsFromPDFInfo(&self, in_pdf_info: &NSPDFInfo);
489 );
490}
491
492impl NSPrintInfo {
494 extern_methods!(
495 #[unsafe(method(new))]
496 #[unsafe(method_family = new)]
497 pub unsafe fn new() -> Retained<Self>;
498 );
499}
500
501impl NSPrintInfo {
503 extern_methods!(
504 #[cfg(feature = "NSPrinter")]
505 #[deprecated = "NSPrintInfo's implementation has no effect"]
506 #[unsafe(method(setDefaultPrinter:))]
507 #[unsafe(method_family = none)]
508 pub unsafe fn setDefaultPrinter(printer: Option<&NSPrinter>);
509
510 #[cfg(feature = "NSPrinter")]
511 #[deprecated = "Use -[NSPrinter pageSizeForPaper:] instead"]
512 #[unsafe(method(sizeForPaperName:))]
513 #[unsafe(method_family = none)]
514 pub unsafe fn sizeForPaperName(name: Option<&NSPrinterPaperName>) -> NSSize;
515 );
516}
517
518extern "C" {
519 pub static NSPrintFormName: &'static NSString;
521}
522
523extern "C" {
524 pub static NSPrintJobFeatures: &'static NSString;
526}
527
528extern "C" {
529 pub static NSPrintManualFeed: &'static NSString;
531}
532
533extern "C" {
534 pub static NSPrintPagesPerSheet: &'static NSString;
536}
537
538extern "C" {
539 pub static NSPrintPaperFeed: &'static NSString;
541}
542
543extern "C" {
544 pub static NSPrintSavePath: &'static NSString;
546}
547
548#[deprecated]
551#[repr(transparent)]
552#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
553pub struct NSPrintingOrientation(pub NSUInteger);
554impl NSPrintingOrientation {
555 #[doc(alias = "NSPortraitOrientation")]
556 #[deprecated]
557 pub const PortraitOrientation: Self = Self(0);
558 #[doc(alias = "NSLandscapeOrientation")]
559 #[deprecated]
560 pub const LandscapeOrientation: Self = Self(1);
561}
562
563unsafe impl Encode for NSPrintingOrientation {
564 const ENCODING: Encoding = NSUInteger::ENCODING;
565}
566
567unsafe impl RefEncode for NSPrintingOrientation {
568 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
569}
570
571pub static NSAutoPagination: NSPrintingPaginationMode =
573 NSPrintingPaginationMode(NSPrintingPaginationMode::Automatic.0);
574
575pub static NSFitPagination: NSPrintingPaginationMode =
577 NSPrintingPaginationMode(NSPrintingPaginationMode::Fit.0);
578
579pub static NSClipPagination: NSPrintingPaginationMode =
581 NSPrintingPaginationMode(NSPrintingPaginationMode::Clip.0);