use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIPrintInfoOutputType(pub NSInteger);
impl UIPrintInfoOutputType {
#[doc(alias = "UIPrintInfoOutputGeneral")]
pub const General: Self = Self(0);
#[doc(alias = "UIPrintInfoOutputPhoto")]
pub const Photo: Self = Self(1);
#[doc(alias = "UIPrintInfoOutputGrayscale")]
pub const Grayscale: Self = Self(2);
#[doc(alias = "UIPrintInfoOutputPhotoGrayscale")]
pub const PhotoGrayscale: Self = Self(3);
}
unsafe impl Encode for UIPrintInfoOutputType {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UIPrintInfoOutputType {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIPrintInfoOrientation(pub NSInteger);
impl UIPrintInfoOrientation {
#[doc(alias = "UIPrintInfoOrientationPortrait")]
pub const Portrait: Self = Self(0);
#[doc(alias = "UIPrintInfoOrientationLandscape")]
pub const Landscape: Self = Self(1);
}
unsafe impl Encode for UIPrintInfoOrientation {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UIPrintInfoOrientation {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIPrintInfoDuplex(pub NSInteger);
impl UIPrintInfoDuplex {
#[doc(alias = "UIPrintInfoDuplexNone")]
pub const None: Self = Self(0);
#[doc(alias = "UIPrintInfoDuplexLongEdge")]
pub const LongEdge: Self = Self(1);
#[doc(alias = "UIPrintInfoDuplexShortEdge")]
pub const ShortEdge: Self = Self(2);
}
unsafe impl Encode for UIPrintInfoDuplex {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UIPrintInfoDuplex {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(NSObject))]
#[thread_kind = MainThreadOnly]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct UIPrintInfo;
);
extern_conformance!(
unsafe impl NSCoding for UIPrintInfo {}
);
extern_conformance!(
unsafe impl NSCopying for UIPrintInfo {}
);
unsafe impl CopyingHelper for UIPrintInfo {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for UIPrintInfo {}
);
impl UIPrintInfo {
extern_methods!(
#[unsafe(method(initWithCoder:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
coder: &NSCoder,
) -> Option<Retained<Self>>;
#[unsafe(method(printInfo))]
#[unsafe(method_family = none)]
pub fn printInfo(mtm: MainThreadMarker) -> Retained<UIPrintInfo>;
#[unsafe(method(printInfoWithDictionary:))]
#[unsafe(method_family = none)]
pub unsafe fn printInfoWithDictionary(
dictionary: Option<&NSDictionary>,
mtm: MainThreadMarker,
) -> Retained<UIPrintInfo>;
#[unsafe(method(printerID))]
#[unsafe(method_family = none)]
pub fn printerID(&self) -> Option<Retained<NSString>>;
#[unsafe(method(setPrinterID:))]
#[unsafe(method_family = none)]
pub fn setPrinterID(&self, printer_id: Option<&NSString>);
#[unsafe(method(jobName))]
#[unsafe(method_family = none)]
pub fn jobName(&self) -> Retained<NSString>;
#[unsafe(method(setJobName:))]
#[unsafe(method_family = none)]
pub fn setJobName(&self, job_name: &NSString);
#[unsafe(method(outputType))]
#[unsafe(method_family = none)]
pub fn outputType(&self) -> UIPrintInfoOutputType;
#[unsafe(method(setOutputType:))]
#[unsafe(method_family = none)]
pub fn setOutputType(&self, output_type: UIPrintInfoOutputType);
#[unsafe(method(orientation))]
#[unsafe(method_family = none)]
pub fn orientation(&self) -> UIPrintInfoOrientation;
#[unsafe(method(setOrientation:))]
#[unsafe(method_family = none)]
pub fn setOrientation(&self, orientation: UIPrintInfoOrientation);
#[unsafe(method(duplex))]
#[unsafe(method_family = none)]
pub fn duplex(&self) -> UIPrintInfoDuplex;
#[unsafe(method(setDuplex:))]
#[unsafe(method_family = none)]
pub fn setDuplex(&self, duplex: UIPrintInfoDuplex);
#[unsafe(method(dictionaryRepresentation))]
#[unsafe(method_family = none)]
pub fn dictionaryRepresentation(&self) -> Retained<NSDictionary>;
);
}
impl UIPrintInfo {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
);
}