objc2_app_kit/generated/
NSPrinter.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/appkit/nsprintertablestatus?language=objc)
11// NS_ENUM
12#[repr(transparent)]
13#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
14pub struct NSPrinterTableStatus(pub NSUInteger);
15impl NSPrinterTableStatus {
16    #[doc(alias = "NSPrinterTableOK")]
17    pub const OK: Self = Self(0);
18    #[doc(alias = "NSPrinterTableNotFound")]
19    pub const NotFound: Self = Self(1);
20    #[doc(alias = "NSPrinterTableError")]
21    pub const Error: Self = Self(2);
22}
23
24unsafe impl Encode for NSPrinterTableStatus {
25    const ENCODING: Encoding = NSUInteger::ENCODING;
26}
27
28unsafe impl RefEncode for NSPrinterTableStatus {
29    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
30}
31
32/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsprintertypename?language=objc)
33// NS_TYPED_EXTENSIBLE_ENUM
34pub type NSPrinterTypeName = NSString;
35
36/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsprinterpapername?language=objc)
37// NS_TYPED_EXTENSIBLE_ENUM
38pub type NSPrinterPaperName = NSString;
39
40extern_class!(
41    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsprinter?language=objc)
42    #[unsafe(super(NSObject))]
43    #[derive(Debug, PartialEq, Eq, Hash)]
44    pub struct NSPrinter;
45);
46
47extern_conformance!(
48    unsafe impl NSCoding for NSPrinter {}
49);
50
51extern_conformance!(
52    unsafe impl NSCopying for NSPrinter {}
53);
54
55unsafe impl CopyingHelper for NSPrinter {
56    type Result = Self;
57}
58
59extern_conformance!(
60    unsafe impl NSObjectProtocol for NSPrinter {}
61);
62
63impl NSPrinter {
64    extern_methods!(
65        #[unsafe(method(printerNames))]
66        #[unsafe(method_family = none)]
67        pub unsafe fn printerNames() -> Retained<NSArray<NSString>>;
68
69        #[unsafe(method(printerTypes))]
70        #[unsafe(method_family = none)]
71        pub unsafe fn printerTypes() -> Retained<NSArray<NSPrinterTypeName>>;
72
73        #[unsafe(method(printerWithName:))]
74        #[unsafe(method_family = none)]
75        pub unsafe fn printerWithName(name: &NSString) -> Option<Retained<NSPrinter>>;
76
77        #[unsafe(method(printerWithType:))]
78        #[unsafe(method_family = none)]
79        pub unsafe fn printerWithType(r#type: &NSPrinterTypeName) -> Option<Retained<NSPrinter>>;
80
81        #[unsafe(method(name))]
82        #[unsafe(method_family = none)]
83        pub unsafe fn name(&self) -> Retained<NSString>;
84
85        #[unsafe(method(type))]
86        #[unsafe(method_family = none)]
87        pub unsafe fn r#type(&self) -> Retained<NSPrinterTypeName>;
88
89        #[unsafe(method(languageLevel))]
90        #[unsafe(method_family = none)]
91        pub unsafe fn languageLevel(&self) -> NSInteger;
92
93        #[unsafe(method(pageSizeForPaper:))]
94        #[unsafe(method_family = none)]
95        pub unsafe fn pageSizeForPaper(&self, paper_name: &NSPrinterPaperName) -> NSSize;
96
97        #[cfg(feature = "NSGraphics")]
98        #[unsafe(method(deviceDescription))]
99        #[unsafe(method_family = none)]
100        pub unsafe fn deviceDescription(
101            &self,
102        ) -> Retained<NSDictionary<NSDeviceDescriptionKey, AnyObject>>;
103    );
104}
105
106/// Methods declared on superclass `NSObject`.
107impl NSPrinter {
108    extern_methods!(
109        #[unsafe(method(init))]
110        #[unsafe(method_family = init)]
111        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
112
113        #[unsafe(method(new))]
114        #[unsafe(method_family = new)]
115        pub unsafe fn new() -> Retained<Self>;
116    );
117}
118
119/// NSDeprecated.
120impl NSPrinter {
121    extern_methods!(
122        #[deprecated]
123        #[unsafe(method(statusForTable:))]
124        #[unsafe(method_family = none)]
125        pub unsafe fn statusForTable(&self, table_name: &NSString) -> NSPrinterTableStatus;
126
127        #[deprecated]
128        #[unsafe(method(isKey:inTable:))]
129        #[unsafe(method_family = none)]
130        pub unsafe fn isKey_inTable(&self, key: Option<&NSString>, table: &NSString) -> bool;
131
132        #[deprecated]
133        #[unsafe(method(booleanForKey:inTable:))]
134        #[unsafe(method_family = none)]
135        pub unsafe fn booleanForKey_inTable(
136            &self,
137            key: Option<&NSString>,
138            table: &NSString,
139        ) -> bool;
140
141        #[deprecated]
142        #[unsafe(method(floatForKey:inTable:))]
143        #[unsafe(method_family = none)]
144        pub unsafe fn floatForKey_inTable(
145            &self,
146            key: Option<&NSString>,
147            table: &NSString,
148        ) -> c_float;
149
150        #[deprecated]
151        #[unsafe(method(intForKey:inTable:))]
152        #[unsafe(method_family = none)]
153        pub unsafe fn intForKey_inTable(&self, key: Option<&NSString>, table: &NSString) -> c_int;
154
155        #[deprecated]
156        #[unsafe(method(rectForKey:inTable:))]
157        #[unsafe(method_family = none)]
158        pub unsafe fn rectForKey_inTable(&self, key: Option<&NSString>, table: &NSString)
159            -> NSRect;
160
161        #[deprecated]
162        #[unsafe(method(sizeForKey:inTable:))]
163        #[unsafe(method_family = none)]
164        pub unsafe fn sizeForKey_inTable(&self, key: Option<&NSString>, table: &NSString)
165            -> NSSize;
166
167        #[deprecated]
168        #[unsafe(method(stringForKey:inTable:))]
169        #[unsafe(method_family = none)]
170        pub unsafe fn stringForKey_inTable(
171            &self,
172            key: Option<&NSString>,
173            table: &NSString,
174        ) -> Option<Retained<NSString>>;
175
176        #[deprecated]
177        #[unsafe(method(stringListForKey:inTable:))]
178        #[unsafe(method_family = none)]
179        pub unsafe fn stringListForKey_inTable(
180            &self,
181            key: Option<&NSString>,
182            table: &NSString,
183        ) -> Option<Retained<NSArray>>;
184
185        #[deprecated]
186        #[unsafe(method(imageRectForPaper:))]
187        #[unsafe(method_family = none)]
188        pub unsafe fn imageRectForPaper(&self, paper_name: Option<&NSString>) -> NSRect;
189
190        #[deprecated]
191        #[unsafe(method(acceptsBinary))]
192        #[unsafe(method_family = none)]
193        pub unsafe fn acceptsBinary(&self) -> bool;
194
195        #[deprecated]
196        #[unsafe(method(isColor))]
197        #[unsafe(method_family = none)]
198        pub unsafe fn isColor(&self) -> bool;
199
200        #[deprecated]
201        #[unsafe(method(isFontAvailable:))]
202        #[unsafe(method_family = none)]
203        pub unsafe fn isFontAvailable(&self, face_name: Option<&NSString>) -> bool;
204
205        #[deprecated]
206        #[unsafe(method(isOutputStackInReverseOrder))]
207        #[unsafe(method_family = none)]
208        pub unsafe fn isOutputStackInReverseOrder(&self) -> bool;
209
210        #[deprecated]
211        #[unsafe(method(printerWithName:domain:includeUnavailable:))]
212        #[unsafe(method_family = none)]
213        pub unsafe fn printerWithName_domain_includeUnavailable(
214            name: &NSString,
215            domain: Option<&NSString>,
216            flag: bool,
217        ) -> Option<Retained<NSPrinter>>;
218
219        #[deprecated]
220        #[unsafe(method(domain))]
221        #[unsafe(method_family = none)]
222        pub unsafe fn domain(&self) -> Retained<NSString>;
223
224        #[deprecated]
225        #[unsafe(method(host))]
226        #[unsafe(method_family = none)]
227        pub unsafe fn host(&self) -> Retained<NSString>;
228
229        #[deprecated]
230        #[unsafe(method(note))]
231        #[unsafe(method_family = none)]
232        pub unsafe fn note(&self) -> Retained<NSString>;
233    );
234}