objc2_ui_kit/generated/
UIPrintServiceExtension.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
10extern_class!(
11    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiprinterdestination?language=objc)
12    #[unsafe(super(NSObject))]
13    #[thread_kind = MainThreadOnly]
14    #[derive(Debug, PartialEq, Eq, Hash)]
15    pub struct UIPrinterDestination;
16);
17
18extern_conformance!(
19    unsafe impl NSCoding for UIPrinterDestination {}
20);
21
22extern_conformance!(
23    unsafe impl NSObjectProtocol for UIPrinterDestination {}
24);
25
26extern_conformance!(
27    unsafe impl NSSecureCoding for UIPrinterDestination {}
28);
29
30impl UIPrinterDestination {
31    extern_methods!(
32        #[unsafe(method(initWithURL:))]
33        #[unsafe(method_family = init)]
34        pub fn initWithURL(this: Allocated<Self>, url: &NSURL) -> Retained<Self>;
35
36        #[unsafe(method(URL))]
37        #[unsafe(method_family = none)]
38        pub fn URL(&self) -> Retained<NSURL>;
39
40        /// Setter for [`URL`][Self::URL].
41        ///
42        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
43        #[unsafe(method(setURL:))]
44        #[unsafe(method_family = none)]
45        pub fn setURL(&self, url: &NSURL);
46
47        #[unsafe(method(displayName))]
48        #[unsafe(method_family = none)]
49        pub fn displayName(&self) -> Option<Retained<NSString>>;
50
51        /// Setter for [`displayName`][Self::displayName].
52        ///
53        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
54        #[unsafe(method(setDisplayName:))]
55        #[unsafe(method_family = none)]
56        pub fn setDisplayName(&self, display_name: Option<&NSString>);
57
58        #[unsafe(method(txtRecord))]
59        #[unsafe(method_family = none)]
60        pub fn txtRecord(&self) -> Option<Retained<NSData>>;
61
62        /// Setter for [`txtRecord`][Self::txtRecord].
63        ///
64        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
65        #[unsafe(method(setTxtRecord:))]
66        #[unsafe(method_family = none)]
67        pub fn setTxtRecord(&self, txt_record: Option<&NSData>);
68    );
69}
70
71/// Methods declared on superclass `NSObject`.
72impl UIPrinterDestination {
73    extern_methods!(
74        #[unsafe(method(init))]
75        #[unsafe(method_family = init)]
76        pub fn init(this: Allocated<Self>) -> Retained<Self>;
77
78        #[unsafe(method(new))]
79        #[unsafe(method_family = new)]
80        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
81    );
82}
83
84extern_class!(
85    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiprintserviceextension?language=objc)
86    #[unsafe(super(NSObject))]
87    #[thread_kind = MainThreadOnly]
88    #[derive(Debug, PartialEq, Eq, Hash)]
89    pub struct UIPrintServiceExtension;
90);
91
92extern_conformance!(
93    unsafe impl NSObjectProtocol for UIPrintServiceExtension {}
94);
95
96impl UIPrintServiceExtension {
97    extern_methods!(
98        #[cfg(feature = "UIPrintInfo")]
99        #[unsafe(method(printerDestinationsForPrintInfo:))]
100        #[unsafe(method_family = none)]
101        pub fn printerDestinationsForPrintInfo(
102            &self,
103            print_info: &UIPrintInfo,
104        ) -> Retained<NSArray<UIPrinterDestination>>;
105    );
106}
107
108/// Methods declared on superclass `NSObject`.
109impl UIPrintServiceExtension {
110    extern_methods!(
111        #[unsafe(method(init))]
112        #[unsafe(method_family = init)]
113        pub fn init(this: Allocated<Self>) -> Retained<Self>;
114
115        #[unsafe(method(new))]
116        #[unsafe(method_family = new)]
117        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
118    );
119}