objc2_ui_kit/generated/
UIPrintInfo.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiprintinfooutputtype?language=objc)
11// NS_ENUM
12#[repr(transparent)]
13#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
14pub struct UIPrintInfoOutputType(pub NSInteger);
15impl UIPrintInfoOutputType {
16    #[doc(alias = "UIPrintInfoOutputGeneral")]
17    pub const General: Self = Self(0);
18    #[doc(alias = "UIPrintInfoOutputPhoto")]
19    pub const Photo: Self = Self(1);
20    #[doc(alias = "UIPrintInfoOutputGrayscale")]
21    pub const Grayscale: Self = Self(2);
22    #[doc(alias = "UIPrintInfoOutputPhotoGrayscale")]
23    pub const PhotoGrayscale: Self = Self(3);
24}
25
26unsafe impl Encode for UIPrintInfoOutputType {
27    const ENCODING: Encoding = NSInteger::ENCODING;
28}
29
30unsafe impl RefEncode for UIPrintInfoOutputType {
31    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
32}
33
34/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiprintinfoorientation?language=objc)
35// NS_ENUM
36#[repr(transparent)]
37#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
38pub struct UIPrintInfoOrientation(pub NSInteger);
39impl UIPrintInfoOrientation {
40    #[doc(alias = "UIPrintInfoOrientationPortrait")]
41    pub const Portrait: Self = Self(0);
42    #[doc(alias = "UIPrintInfoOrientationLandscape")]
43    pub const Landscape: Self = Self(1);
44}
45
46unsafe impl Encode for UIPrintInfoOrientation {
47    const ENCODING: Encoding = NSInteger::ENCODING;
48}
49
50unsafe impl RefEncode for UIPrintInfoOrientation {
51    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
52}
53
54/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiprintinfoduplex?language=objc)
55// NS_ENUM
56#[repr(transparent)]
57#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
58pub struct UIPrintInfoDuplex(pub NSInteger);
59impl UIPrintInfoDuplex {
60    #[doc(alias = "UIPrintInfoDuplexNone")]
61    pub const None: Self = Self(0);
62    #[doc(alias = "UIPrintInfoDuplexLongEdge")]
63    pub const LongEdge: Self = Self(1);
64    #[doc(alias = "UIPrintInfoDuplexShortEdge")]
65    pub const ShortEdge: Self = Self(2);
66}
67
68unsafe impl Encode for UIPrintInfoDuplex {
69    const ENCODING: Encoding = NSInteger::ENCODING;
70}
71
72unsafe impl RefEncode for UIPrintInfoDuplex {
73    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
74}
75
76extern_class!(
77    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiprintinfo?language=objc)
78    #[unsafe(super(NSObject))]
79    #[thread_kind = MainThreadOnly]
80    #[derive(Debug, PartialEq, Eq, Hash)]
81    pub struct UIPrintInfo;
82);
83
84extern_conformance!(
85    unsafe impl NSCoding for UIPrintInfo {}
86);
87
88extern_conformance!(
89    unsafe impl NSCopying for UIPrintInfo {}
90);
91
92unsafe impl CopyingHelper for UIPrintInfo {
93    type Result = Self;
94}
95
96extern_conformance!(
97    unsafe impl NSObjectProtocol for UIPrintInfo {}
98);
99
100impl UIPrintInfo {
101    extern_methods!(
102        /// # Safety
103        ///
104        /// `coder` possibly has further requirements.
105        #[unsafe(method(initWithCoder:))]
106        #[unsafe(method_family = init)]
107        pub unsafe fn initWithCoder(
108            this: Allocated<Self>,
109            coder: &NSCoder,
110        ) -> Option<Retained<Self>>;
111
112        #[unsafe(method(printInfo))]
113        #[unsafe(method_family = none)]
114        pub fn printInfo(mtm: MainThreadMarker) -> Retained<UIPrintInfo>;
115
116        /// # Safety
117        ///
118        /// `dictionary` generic should be of the correct type.
119        #[unsafe(method(printInfoWithDictionary:))]
120        #[unsafe(method_family = none)]
121        pub unsafe fn printInfoWithDictionary(
122            dictionary: Option<&NSDictionary>,
123            mtm: MainThreadMarker,
124        ) -> Retained<UIPrintInfo>;
125
126        #[unsafe(method(printerID))]
127        #[unsafe(method_family = none)]
128        pub fn printerID(&self) -> Option<Retained<NSString>>;
129
130        /// Setter for [`printerID`][Self::printerID].
131        ///
132        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
133        #[unsafe(method(setPrinterID:))]
134        #[unsafe(method_family = none)]
135        pub fn setPrinterID(&self, printer_id: Option<&NSString>);
136
137        #[unsafe(method(jobName))]
138        #[unsafe(method_family = none)]
139        pub fn jobName(&self) -> Retained<NSString>;
140
141        /// Setter for [`jobName`][Self::jobName].
142        ///
143        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
144        #[unsafe(method(setJobName:))]
145        #[unsafe(method_family = none)]
146        pub fn setJobName(&self, job_name: &NSString);
147
148        #[unsafe(method(outputType))]
149        #[unsafe(method_family = none)]
150        pub fn outputType(&self) -> UIPrintInfoOutputType;
151
152        /// Setter for [`outputType`][Self::outputType].
153        #[unsafe(method(setOutputType:))]
154        #[unsafe(method_family = none)]
155        pub fn setOutputType(&self, output_type: UIPrintInfoOutputType);
156
157        #[unsafe(method(orientation))]
158        #[unsafe(method_family = none)]
159        pub fn orientation(&self) -> UIPrintInfoOrientation;
160
161        /// Setter for [`orientation`][Self::orientation].
162        #[unsafe(method(setOrientation:))]
163        #[unsafe(method_family = none)]
164        pub fn setOrientation(&self, orientation: UIPrintInfoOrientation);
165
166        #[unsafe(method(duplex))]
167        #[unsafe(method_family = none)]
168        pub fn duplex(&self) -> UIPrintInfoDuplex;
169
170        /// Setter for [`duplex`][Self::duplex].
171        #[unsafe(method(setDuplex:))]
172        #[unsafe(method_family = none)]
173        pub fn setDuplex(&self, duplex: UIPrintInfoDuplex);
174
175        #[unsafe(method(dictionaryRepresentation))]
176        #[unsafe(method_family = none)]
177        pub fn dictionaryRepresentation(&self) -> Retained<NSDictionary>;
178    );
179}
180
181/// Methods declared on superclass `NSObject`.
182impl UIPrintInfo {
183    extern_methods!(
184        #[unsafe(method(init))]
185        #[unsafe(method_family = init)]
186        pub fn init(this: Allocated<Self>) -> Retained<Self>;
187
188        #[unsafe(method(new))]
189        #[unsafe(method_family = new)]
190        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
191    );
192}