objc2_ui_kit/generated/
UIImageReader.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12extern_class!(
13 #[unsafe(super(NSObject))]
15 #[derive(Debug, PartialEq, Eq, Hash)]
16 pub struct UIImageReaderConfiguration;
17);
18
19extern_conformance!(
20 unsafe impl NSCopying for UIImageReaderConfiguration {}
21);
22
23unsafe impl CopyingHelper for UIImageReaderConfiguration {
24 type Result = Self;
25}
26
27extern_conformance!(
28 unsafe impl NSObjectProtocol for UIImageReaderConfiguration {}
29);
30
31impl UIImageReaderConfiguration {
32 extern_methods!(
33 #[unsafe(method(prefersHighDynamicRange))]
35 #[unsafe(method_family = none)]
36 pub unsafe fn prefersHighDynamicRange(&self) -> bool;
37
38 #[unsafe(method(setPrefersHighDynamicRange:))]
40 #[unsafe(method_family = none)]
41 pub unsafe fn setPrefersHighDynamicRange(&self, prefers_high_dynamic_range: bool);
42
43 #[unsafe(method(preparesImagesForDisplay))]
45 #[unsafe(method_family = none)]
46 pub unsafe fn preparesImagesForDisplay(&self) -> bool;
47
48 #[unsafe(method(setPreparesImagesForDisplay:))]
50 #[unsafe(method_family = none)]
51 pub unsafe fn setPreparesImagesForDisplay(&self, prepares_images_for_display: bool);
52
53 #[cfg(feature = "objc2-core-foundation")]
54 #[unsafe(method(preferredThumbnailSize))]
56 #[unsafe(method_family = none)]
57 pub unsafe fn preferredThumbnailSize(&self) -> CGSize;
58
59 #[cfg(feature = "objc2-core-foundation")]
60 #[unsafe(method(setPreferredThumbnailSize:))]
62 #[unsafe(method_family = none)]
63 pub unsafe fn setPreferredThumbnailSize(&self, preferred_thumbnail_size: CGSize);
64
65 #[cfg(feature = "objc2-core-foundation")]
66 #[unsafe(method(pixelsPerInch))]
68 #[unsafe(method_family = none)]
69 pub unsafe fn pixelsPerInch(&self) -> CGFloat;
70
71 #[cfg(feature = "objc2-core-foundation")]
72 #[unsafe(method(setPixelsPerInch:))]
74 #[unsafe(method_family = none)]
75 pub unsafe fn setPixelsPerInch(&self, pixels_per_inch: CGFloat);
76 );
77}
78
79impl UIImageReaderConfiguration {
81 extern_methods!(
82 #[unsafe(method(init))]
83 #[unsafe(method_family = init)]
84 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
85
86 #[unsafe(method(new))]
87 #[unsafe(method_family = new)]
88 pub unsafe fn new() -> Retained<Self>;
89 );
90}
91
92extern_class!(
93 #[unsafe(super(NSObject))]
95 #[derive(Debug, PartialEq, Eq, Hash)]
96 pub struct UIImageReader;
97);
98
99extern_conformance!(
100 unsafe impl NSObjectProtocol for UIImageReader {}
101);
102
103impl UIImageReader {
104 extern_methods!(
105 #[unsafe(method(defaultReader))]
107 #[unsafe(method_family = none)]
108 pub unsafe fn defaultReader() -> Retained<UIImageReader>;
109
110 #[unsafe(method(readerWithConfiguration:))]
112 #[unsafe(method_family = none)]
113 pub unsafe fn readerWithConfiguration(
114 configuration: &UIImageReaderConfiguration,
115 ) -> Retained<Self>;
116
117 #[unsafe(method(configuration))]
118 #[unsafe(method_family = none)]
119 pub unsafe fn configuration(&self) -> Retained<UIImageReaderConfiguration>;
120
121 #[cfg(feature = "UIImage")]
122 #[unsafe(method(imageWithContentsOfFileURL:))]
124 #[unsafe(method_family = none)]
125 pub unsafe fn imageWithContentsOfFileURL(&self, url: &NSURL) -> Retained<UIImage>;
126
127 #[cfg(feature = "UIImage")]
128 #[unsafe(method(imageWithData:))]
130 #[unsafe(method_family = none)]
131 pub unsafe fn imageWithData(&self, data: &NSData) -> Retained<UIImage>;
132
133 #[cfg(all(feature = "UIImage", feature = "block2"))]
134 #[unsafe(method(imageWithContentsOfFileURL:completion:))]
136 #[unsafe(method_family = none)]
137 pub unsafe fn imageWithContentsOfFileURL_completion(
138 &self,
139 url: &NSURL,
140 completion: &block2::DynBlock<dyn Fn(*mut UIImage)>,
141 );
142
143 #[cfg(all(feature = "UIImage", feature = "block2"))]
144 #[unsafe(method(imageWithData:completion:))]
146 #[unsafe(method_family = none)]
147 pub unsafe fn imageWithData_completion(
148 &self,
149 data: &NSData,
150 completion: &block2::DynBlock<dyn Fn(*mut UIImage)>,
151 );
152 );
153}
154
155impl UIImageReader {
157 extern_methods!(
158 #[unsafe(method(init))]
159 #[unsafe(method_family = init)]
160 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
161
162 #[unsafe(method(new))]
163 #[unsafe(method_family = new)]
164 pub unsafe fn new() -> Retained<Self>;
165 );
166}