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
47unsafe impl NSCoding for NSPrinter {}
48
49unsafe impl NSCopying for NSPrinter {}
50
51unsafe impl CopyingHelper for NSPrinter {
52    type Result = Self;
53}
54
55unsafe impl NSObjectProtocol for NSPrinter {}
56
57impl NSPrinter {
58    extern_methods!(
59        #[unsafe(method(printerNames))]
60        #[unsafe(method_family = none)]
61        pub unsafe fn printerNames() -> Retained<NSArray<NSString>>;
62
63        #[unsafe(method(printerTypes))]
64        #[unsafe(method_family = none)]
65        pub unsafe fn printerTypes() -> Retained<NSArray<NSPrinterTypeName>>;
66
67        #[unsafe(method(printerWithName:))]
68        #[unsafe(method_family = none)]
69        pub unsafe fn printerWithName(name: &NSString) -> Option<Retained<NSPrinter>>;
70
71        #[unsafe(method(printerWithType:))]
72        #[unsafe(method_family = none)]
73        pub unsafe fn printerWithType(r#type: &NSPrinterTypeName) -> Option<Retained<NSPrinter>>;
74
75        #[unsafe(method(name))]
76        #[unsafe(method_family = none)]
77        pub unsafe fn name(&self) -> Retained<NSString>;
78
79        #[unsafe(method(type))]
80        #[unsafe(method_family = none)]
81        pub unsafe fn r#type(&self) -> Retained<NSPrinterTypeName>;
82
83        #[unsafe(method(languageLevel))]
84        #[unsafe(method_family = none)]
85        pub unsafe fn languageLevel(&self) -> NSInteger;
86
87        #[unsafe(method(pageSizeForPaper:))]
88        #[unsafe(method_family = none)]
89        pub unsafe fn pageSizeForPaper(&self, paper_name: &NSPrinterPaperName) -> NSSize;
90
91        #[cfg(feature = "NSGraphics")]
92        #[unsafe(method(deviceDescription))]
93        #[unsafe(method_family = none)]
94        pub unsafe fn deviceDescription(
95            &self,
96        ) -> Retained<NSDictionary<NSDeviceDescriptionKey, AnyObject>>;
97    );
98}
99
100/// Methods declared on superclass `NSObject`.
101impl NSPrinter {
102    extern_methods!(
103        #[unsafe(method(init))]
104        #[unsafe(method_family = init)]
105        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
106
107        #[unsafe(method(new))]
108        #[unsafe(method_family = new)]
109        pub unsafe fn new() -> Retained<Self>;
110    );
111}
112
113/// NSDeprecated.
114impl NSPrinter {
115    extern_methods!(
116        #[deprecated]
117        #[unsafe(method(statusForTable:))]
118        #[unsafe(method_family = none)]
119        pub unsafe fn statusForTable(&self, table_name: &NSString) -> NSPrinterTableStatus;
120
121        #[deprecated]
122        #[unsafe(method(isKey:inTable:))]
123        #[unsafe(method_family = none)]
124        pub unsafe fn isKey_inTable(&self, key: Option<&NSString>, table: &NSString) -> bool;
125
126        #[deprecated]
127        #[unsafe(method(booleanForKey:inTable:))]
128        #[unsafe(method_family = none)]
129        pub unsafe fn booleanForKey_inTable(
130            &self,
131            key: Option<&NSString>,
132            table: &NSString,
133        ) -> bool;
134
135        #[deprecated]
136        #[unsafe(method(floatForKey:inTable:))]
137        #[unsafe(method_family = none)]
138        pub unsafe fn floatForKey_inTable(
139            &self,
140            key: Option<&NSString>,
141            table: &NSString,
142        ) -> c_float;
143
144        #[deprecated]
145        #[unsafe(method(intForKey:inTable:))]
146        #[unsafe(method_family = none)]
147        pub unsafe fn intForKey_inTable(&self, key: Option<&NSString>, table: &NSString) -> c_int;
148
149        #[deprecated]
150        #[unsafe(method(rectForKey:inTable:))]
151        #[unsafe(method_family = none)]
152        pub unsafe fn rectForKey_inTable(&self, key: Option<&NSString>, table: &NSString)
153            -> NSRect;
154
155        #[deprecated]
156        #[unsafe(method(sizeForKey:inTable:))]
157        #[unsafe(method_family = none)]
158        pub unsafe fn sizeForKey_inTable(&self, key: Option<&NSString>, table: &NSString)
159            -> NSSize;
160
161        #[deprecated]
162        #[unsafe(method(stringForKey:inTable:))]
163        #[unsafe(method_family = none)]
164        pub unsafe fn stringForKey_inTable(
165            &self,
166            key: Option<&NSString>,
167            table: &NSString,
168        ) -> Option<Retained<NSString>>;
169
170        #[deprecated]
171        #[unsafe(method(stringListForKey:inTable:))]
172        #[unsafe(method_family = none)]
173        pub unsafe fn stringListForKey_inTable(
174            &self,
175            key: Option<&NSString>,
176            table: &NSString,
177        ) -> Option<Retained<NSArray>>;
178
179        #[deprecated]
180        #[unsafe(method(imageRectForPaper:))]
181        #[unsafe(method_family = none)]
182        pub unsafe fn imageRectForPaper(&self, paper_name: Option<&NSString>) -> NSRect;
183
184        #[deprecated]
185        #[unsafe(method(acceptsBinary))]
186        #[unsafe(method_family = none)]
187        pub unsafe fn acceptsBinary(&self) -> bool;
188
189        #[deprecated]
190        #[unsafe(method(isColor))]
191        #[unsafe(method_family = none)]
192        pub unsafe fn isColor(&self) -> bool;
193
194        #[deprecated]
195        #[unsafe(method(isFontAvailable:))]
196        #[unsafe(method_family = none)]
197        pub unsafe fn isFontAvailable(&self, face_name: Option<&NSString>) -> bool;
198
199        #[deprecated]
200        #[unsafe(method(isOutputStackInReverseOrder))]
201        #[unsafe(method_family = none)]
202        pub unsafe fn isOutputStackInReverseOrder(&self) -> bool;
203
204        #[deprecated]
205        #[unsafe(method(printerWithName:domain:includeUnavailable:))]
206        #[unsafe(method_family = none)]
207        pub unsafe fn printerWithName_domain_includeUnavailable(
208            name: &NSString,
209            domain: Option<&NSString>,
210            flag: bool,
211        ) -> Option<Retained<NSPrinter>>;
212
213        #[deprecated]
214        #[unsafe(method(domain))]
215        #[unsafe(method_family = none)]
216        pub unsafe fn domain(&self) -> Retained<NSString>;
217
218        #[deprecated]
219        #[unsafe(method(host))]
220        #[unsafe(method_family = none)]
221        pub unsafe fn host(&self) -> Retained<NSString>;
222
223        #[deprecated]
224        #[unsafe(method(note))]
225        #[unsafe(method_family = none)]
226        pub unsafe fn note(&self) -> Retained<NSString>;
227    );
228}