use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;
use objc2_foundation::*;
use crate::*;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSPaperOrientation(pub NSInteger);
impl NSPaperOrientation {
#[doc(alias = "NSPaperOrientationPortrait")]
pub const Portrait: Self = Self(0);
#[doc(alias = "NSPaperOrientationLandscape")]
pub const Landscape: Self = Self(1);
}
unsafe impl Encode for NSPaperOrientation {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for NSPaperOrientation {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSPrintingPaginationMode(pub NSUInteger);
impl NSPrintingPaginationMode {
#[doc(alias = "NSPrintingPaginationModeAutomatic")]
pub const Automatic: Self = Self(0);
#[doc(alias = "NSPrintingPaginationModeFit")]
pub const Fit: Self = Self(1);
#[doc(alias = "NSPrintingPaginationModeClip")]
pub const Clip: Self = Self(2);
}
unsafe impl Encode for NSPrintingPaginationMode {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for NSPrintingPaginationMode {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
pub type NSPrintInfoAttributeKey = NSString;
extern "C" {
pub static NSPrintPaperName: &'static NSPrintInfoAttributeKey;
}
extern "C" {
pub static NSPrintPaperSize: &'static NSPrintInfoAttributeKey;
}
extern "C" {
pub static NSPrintOrientation: &'static NSPrintInfoAttributeKey;
}
extern "C" {
pub static NSPrintScalingFactor: &'static NSPrintInfoAttributeKey;
}
extern "C" {
pub static NSPrintLeftMargin: &'static NSPrintInfoAttributeKey;
}
extern "C" {
pub static NSPrintRightMargin: &'static NSPrintInfoAttributeKey;
}
extern "C" {
pub static NSPrintTopMargin: &'static NSPrintInfoAttributeKey;
}
extern "C" {
pub static NSPrintBottomMargin: &'static NSPrintInfoAttributeKey;
}
extern "C" {
pub static NSPrintHorizontallyCentered: &'static NSPrintInfoAttributeKey;
}
extern "C" {
pub static NSPrintVerticallyCentered: &'static NSPrintInfoAttributeKey;
}
extern "C" {
pub static NSPrintHorizontalPagination: &'static NSPrintInfoAttributeKey;
}
extern "C" {
pub static NSPrintVerticalPagination: &'static NSPrintInfoAttributeKey;
}
extern "C" {
pub static NSPrintPrinter: &'static NSPrintInfoAttributeKey;
}
extern "C" {
pub static NSPrintCopies: &'static NSPrintInfoAttributeKey;
}
extern "C" {
pub static NSPrintAllPages: &'static NSPrintInfoAttributeKey;
}
extern "C" {
pub static NSPrintFirstPage: &'static NSPrintInfoAttributeKey;
}
extern "C" {
pub static NSPrintLastPage: &'static NSPrintInfoAttributeKey;
}
extern "C" {
pub static NSPrintMustCollate: &'static NSPrintInfoAttributeKey;
}
extern "C" {
pub static NSPrintReversePageOrder: &'static NSPrintInfoAttributeKey;
}
extern "C" {
pub static NSPrintJobDisposition: &'static NSPrintInfoAttributeKey;
}
extern "C" {
pub static NSPrintPagesAcross: &'static NSPrintInfoAttributeKey;
}
extern "C" {
pub static NSPrintPagesDown: &'static NSPrintInfoAttributeKey;
}
extern "C" {
pub static NSPrintTime: &'static NSPrintInfoAttributeKey;
}
extern "C" {
pub static NSPrintDetailedErrorReporting: &'static NSPrintInfoAttributeKey;
}
extern "C" {
pub static NSPrintFaxNumber: &'static NSPrintInfoAttributeKey;
}
extern "C" {
pub static NSPrintPrinterName: &'static NSPrintInfoAttributeKey;
}
extern "C" {
pub static NSPrintSelectionOnly: &'static NSPrintInfoAttributeKey;
}
extern "C" {
pub static NSPrintJobSavingURL: &'static NSPrintInfoAttributeKey;
}
extern "C" {
pub static NSPrintJobSavingFileNameExtensionHidden: &'static NSPrintInfoAttributeKey;
}
extern "C" {
pub static NSPrintHeaderAndFooter: &'static NSPrintInfoAttributeKey;
}
pub type NSPrintJobDispositionValue = NSString;
extern "C" {
pub static NSPrintSpoolJob: &'static NSPrintJobDispositionValue;
}
extern "C" {
pub static NSPrintPreviewJob: &'static NSPrintJobDispositionValue;
}
extern "C" {
pub static NSPrintSaveJob: &'static NSPrintJobDispositionValue;
}
extern "C" {
pub static NSPrintCancelJob: &'static NSPrintJobDispositionValue;
}
pub type NSPrintInfoSettingKey = NSString;
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSPrintInfo;
);
extern_conformance!(
unsafe impl NSCoding for NSPrintInfo {}
);
extern_conformance!(
unsafe impl NSCopying for NSPrintInfo {}
);
unsafe impl CopyingHelper for NSPrintInfo {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for NSPrintInfo {}
);
impl NSPrintInfo {
extern_methods!(
#[unsafe(method(sharedPrintInfo))]
#[unsafe(method_family = none)]
pub fn sharedPrintInfo() -> Retained<NSPrintInfo>;
#[unsafe(method(setSharedPrintInfo:))]
#[unsafe(method_family = none)]
pub fn setSharedPrintInfo(shared_print_info: &NSPrintInfo);
#[unsafe(method(initWithDictionary:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithDictionary(
this: Allocated<Self>,
attributes: &NSDictionary<NSPrintInfoAttributeKey, AnyObject>,
) -> Retained<Self>;
#[unsafe(method(initWithCoder:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Retained<Self>;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(dictionary))]
#[unsafe(method_family = none)]
pub unsafe fn dictionary(
&self,
) -> Retained<NSMutableDictionary<NSPrintInfoAttributeKey, AnyObject>>;
#[cfg(feature = "NSPrinter")]
#[unsafe(method(paperName))]
#[unsafe(method_family = none)]
pub fn paperName(&self) -> Option<Retained<NSPrinterPaperName>>;
#[cfg(feature = "NSPrinter")]
#[unsafe(method(setPaperName:))]
#[unsafe(method_family = none)]
pub fn setPaperName(&self, paper_name: Option<&NSPrinterPaperName>);
#[unsafe(method(paperSize))]
#[unsafe(method_family = none)]
pub fn paperSize(&self) -> NSSize;
#[unsafe(method(setPaperSize:))]
#[unsafe(method_family = none)]
pub fn setPaperSize(&self, paper_size: NSSize);
#[unsafe(method(orientation))]
#[unsafe(method_family = none)]
pub fn orientation(&self) -> NSPaperOrientation;
#[unsafe(method(setOrientation:))]
#[unsafe(method_family = none)]
pub fn setOrientation(&self, orientation: NSPaperOrientation);
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(scalingFactor))]
#[unsafe(method_family = none)]
pub fn scalingFactor(&self) -> CGFloat;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(setScalingFactor:))]
#[unsafe(method_family = none)]
pub fn setScalingFactor(&self, scaling_factor: CGFloat);
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(leftMargin))]
#[unsafe(method_family = none)]
pub fn leftMargin(&self) -> CGFloat;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(setLeftMargin:))]
#[unsafe(method_family = none)]
pub fn setLeftMargin(&self, left_margin: CGFloat);
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(rightMargin))]
#[unsafe(method_family = none)]
pub fn rightMargin(&self) -> CGFloat;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(setRightMargin:))]
#[unsafe(method_family = none)]
pub fn setRightMargin(&self, right_margin: CGFloat);
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(topMargin))]
#[unsafe(method_family = none)]
pub fn topMargin(&self) -> CGFloat;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(setTopMargin:))]
#[unsafe(method_family = none)]
pub fn setTopMargin(&self, top_margin: CGFloat);
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(bottomMargin))]
#[unsafe(method_family = none)]
pub fn bottomMargin(&self) -> CGFloat;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(setBottomMargin:))]
#[unsafe(method_family = none)]
pub fn setBottomMargin(&self, bottom_margin: CGFloat);
#[unsafe(method(isHorizontallyCentered))]
#[unsafe(method_family = none)]
pub fn isHorizontallyCentered(&self) -> bool;
#[unsafe(method(setHorizontallyCentered:))]
#[unsafe(method_family = none)]
pub fn setHorizontallyCentered(&self, horizontally_centered: bool);
#[unsafe(method(isVerticallyCentered))]
#[unsafe(method_family = none)]
pub fn isVerticallyCentered(&self) -> bool;
#[unsafe(method(setVerticallyCentered:))]
#[unsafe(method_family = none)]
pub fn setVerticallyCentered(&self, vertically_centered: bool);
#[unsafe(method(horizontalPagination))]
#[unsafe(method_family = none)]
pub fn horizontalPagination(&self) -> NSPrintingPaginationMode;
#[unsafe(method(setHorizontalPagination:))]
#[unsafe(method_family = none)]
pub fn setHorizontalPagination(&self, horizontal_pagination: NSPrintingPaginationMode);
#[unsafe(method(verticalPagination))]
#[unsafe(method_family = none)]
pub fn verticalPagination(&self) -> NSPrintingPaginationMode;
#[unsafe(method(setVerticalPagination:))]
#[unsafe(method_family = none)]
pub fn setVerticalPagination(&self, vertical_pagination: NSPrintingPaginationMode);
#[unsafe(method(jobDisposition))]
#[unsafe(method_family = none)]
pub fn jobDisposition(&self) -> Retained<NSPrintJobDispositionValue>;
#[unsafe(method(setJobDisposition:))]
#[unsafe(method_family = none)]
pub fn setJobDisposition(&self, job_disposition: &NSPrintJobDispositionValue);
#[cfg(feature = "NSPrinter")]
#[unsafe(method(printer))]
#[unsafe(method_family = none)]
pub fn printer(&self) -> Retained<NSPrinter>;
#[cfg(feature = "NSPrinter")]
#[unsafe(method(setPrinter:))]
#[unsafe(method_family = none)]
pub fn setPrinter(&self, printer: &NSPrinter);
#[unsafe(method(setUpPrintOperationDefaultValues))]
#[unsafe(method_family = none)]
pub fn setUpPrintOperationDefaultValues(&self);
#[unsafe(method(imageablePageBounds))]
#[unsafe(method_family = none)]
pub fn imageablePageBounds(&self) -> NSRect;
#[unsafe(method(localizedPaperName))]
#[unsafe(method_family = none)]
pub fn localizedPaperName(&self) -> Option<Retained<NSString>>;
#[cfg(feature = "NSPrinter")]
#[unsafe(method(defaultPrinter))]
#[unsafe(method_family = none)]
pub fn defaultPrinter() -> Option<Retained<NSPrinter>>;
#[unsafe(method(printSettings))]
#[unsafe(method_family = none)]
pub unsafe fn printSettings(
&self,
) -> Retained<NSMutableDictionary<NSPrintInfoSettingKey, AnyObject>>;
#[unsafe(method(PMPrintSession))]
#[unsafe(method_family = none)]
pub fn PMPrintSession(&self) -> NonNull<c_void>;
#[unsafe(method(PMPageFormat))]
#[unsafe(method_family = none)]
pub fn PMPageFormat(&self) -> NonNull<c_void>;
#[unsafe(method(PMPrintSettings))]
#[unsafe(method_family = none)]
pub fn PMPrintSettings(&self) -> NonNull<c_void>;
#[unsafe(method(updateFromPMPageFormat))]
#[unsafe(method_family = none)]
pub fn updateFromPMPageFormat(&self);
#[unsafe(method(updateFromPMPrintSettings))]
#[unsafe(method_family = none)]
pub fn updateFromPMPrintSettings(&self);
#[unsafe(method(isSelectionOnly))]
#[unsafe(method_family = none)]
pub fn isSelectionOnly(&self) -> bool;
#[unsafe(method(setSelectionOnly:))]
#[unsafe(method_family = none)]
pub fn setSelectionOnly(&self, selection_only: bool);
#[cfg(feature = "NSPDFInfo")]
#[unsafe(method(takeSettingsFromPDFInfo:))]
#[unsafe(method_family = none)]
pub fn takeSettingsFromPDFInfo(&self, in_pdf_info: &NSPDFInfo);
);
}
impl NSPrintInfo {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub fn new() -> Retained<Self>;
);
}
impl DefaultRetained for NSPrintInfo {
#[inline]
fn default_retained() -> Retained<Self> {
Self::new()
}
}
impl NSPrintInfo {
extern_methods!(
#[cfg(feature = "NSPrinter")]
#[deprecated = "NSPrintInfo's implementation has no effect"]
#[unsafe(method(setDefaultPrinter:))]
#[unsafe(method_family = none)]
pub fn setDefaultPrinter(printer: Option<&NSPrinter>);
#[cfg(feature = "NSPrinter")]
#[deprecated = "Use -[NSPrinter pageSizeForPaper:] instead"]
#[unsafe(method(sizeForPaperName:))]
#[unsafe(method_family = none)]
pub fn sizeForPaperName(name: Option<&NSPrinterPaperName>) -> NSSize;
);
}
extern "C" {
#[deprecated = "NSPrintInfo does not recognize this attribute"]
pub static NSPrintFormName: &'static NSString;
}
extern "C" {
#[deprecated = "NSPrintInfo does not recognize this attribute. -[NSPrintInfo setUpPrintOperationDefaultValues] sets a default value of an empty dictionary"]
pub static NSPrintJobFeatures: &'static NSString;
}
extern "C" {
#[deprecated = "NSPrintInfo does not recognize this attribute"]
pub static NSPrintManualFeed: &'static NSString;
}
extern "C" {
#[deprecated = "NSPrintInfo does not recognize this attribute. -[NSPrintInfo setUpPrintOperationDefaultValues] sets a default value of 1"]
pub static NSPrintPagesPerSheet: &'static NSString;
}
extern "C" {
#[deprecated = "NSPrintInfo does not recognize this attribute"]
pub static NSPrintPaperFeed: &'static NSString;
}
extern "C" {
#[deprecated = "Use NSPrintJobSavingURL instead"]
pub static NSPrintSavePath: &'static NSString;
}
#[deprecated]
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSPrintingOrientation(pub NSUInteger);
impl NSPrintingOrientation {
#[doc(alias = "NSPortraitOrientation")]
#[deprecated]
pub const PortraitOrientation: Self = Self(0);
#[doc(alias = "NSLandscapeOrientation")]
#[deprecated]
pub const LandscapeOrientation: Self = Self(1);
}
unsafe impl Encode for NSPrintingOrientation {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for NSPrintingOrientation {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[deprecated]
pub static NSAutoPagination: NSPrintingPaginationMode =
NSPrintingPaginationMode(NSPrintingPaginationMode::Automatic.0);
#[deprecated]
pub static NSFitPagination: NSPrintingPaginationMode =
NSPrintingPaginationMode(NSPrintingPaginationMode::Fit.0);
#[deprecated]
pub static NSClipPagination: NSPrintingPaginationMode =
NSPrintingPaginationMode(NSPrintingPaginationMode::Clip.0);