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
19unsafe impl NSCopying for UIImageReaderConfiguration {}
20
21unsafe impl CopyingHelper for UIImageReaderConfiguration {
22 type Result = Self;
23}
24
25unsafe impl NSObjectProtocol for UIImageReaderConfiguration {}
26
27impl UIImageReaderConfiguration {
28 extern_methods!(
29 #[unsafe(method(prefersHighDynamicRange))]
31 #[unsafe(method_family = none)]
32 pub unsafe fn prefersHighDynamicRange(&self) -> bool;
33
34 #[unsafe(method(setPrefersHighDynamicRange:))]
36 #[unsafe(method_family = none)]
37 pub unsafe fn setPrefersHighDynamicRange(&self, prefers_high_dynamic_range: bool);
38
39 #[unsafe(method(preparesImagesForDisplay))]
41 #[unsafe(method_family = none)]
42 pub unsafe fn preparesImagesForDisplay(&self) -> bool;
43
44 #[unsafe(method(setPreparesImagesForDisplay:))]
46 #[unsafe(method_family = none)]
47 pub unsafe fn setPreparesImagesForDisplay(&self, prepares_images_for_display: bool);
48
49 #[cfg(feature = "objc2-core-foundation")]
50 #[unsafe(method(preferredThumbnailSize))]
52 #[unsafe(method_family = none)]
53 pub unsafe fn preferredThumbnailSize(&self) -> CGSize;
54
55 #[cfg(feature = "objc2-core-foundation")]
56 #[unsafe(method(setPreferredThumbnailSize:))]
58 #[unsafe(method_family = none)]
59 pub unsafe fn setPreferredThumbnailSize(&self, preferred_thumbnail_size: CGSize);
60
61 #[cfg(feature = "objc2-core-foundation")]
62 #[unsafe(method(pixelsPerInch))]
64 #[unsafe(method_family = none)]
65 pub unsafe fn pixelsPerInch(&self) -> CGFloat;
66
67 #[cfg(feature = "objc2-core-foundation")]
68 #[unsafe(method(setPixelsPerInch:))]
70 #[unsafe(method_family = none)]
71 pub unsafe fn setPixelsPerInch(&self, pixels_per_inch: CGFloat);
72 );
73}
74
75impl UIImageReaderConfiguration {
77 extern_methods!(
78 #[unsafe(method(init))]
79 #[unsafe(method_family = init)]
80 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
81
82 #[unsafe(method(new))]
83 #[unsafe(method_family = new)]
84 pub unsafe fn new() -> Retained<Self>;
85 );
86}
87
88extern_class!(
89 #[unsafe(super(NSObject))]
91 #[derive(Debug, PartialEq, Eq, Hash)]
92 pub struct UIImageReader;
93);
94
95unsafe impl NSObjectProtocol for UIImageReader {}
96
97impl UIImageReader {
98 extern_methods!(
99 #[unsafe(method(defaultReader))]
101 #[unsafe(method_family = none)]
102 pub unsafe fn defaultReader() -> Retained<UIImageReader>;
103
104 #[unsafe(method(readerWithConfiguration:))]
106 #[unsafe(method_family = none)]
107 pub unsafe fn readerWithConfiguration(
108 configuration: &UIImageReaderConfiguration,
109 ) -> Retained<Self>;
110
111 #[unsafe(method(configuration))]
112 #[unsafe(method_family = none)]
113 pub unsafe fn configuration(&self) -> Retained<UIImageReaderConfiguration>;
114
115 #[cfg(feature = "UIImage")]
116 #[unsafe(method(imageWithContentsOfFileURL:))]
118 #[unsafe(method_family = none)]
119 pub unsafe fn imageWithContentsOfFileURL(&self, url: &NSURL) -> Retained<UIImage>;
120
121 #[cfg(feature = "UIImage")]
122 #[unsafe(method(imageWithData:))]
124 #[unsafe(method_family = none)]
125 pub unsafe fn imageWithData(&self, data: &NSData) -> Retained<UIImage>;
126
127 #[cfg(all(feature = "UIImage", feature = "block2"))]
128 #[unsafe(method(imageWithContentsOfFileURL:completion:))]
130 #[unsafe(method_family = none)]
131 pub unsafe fn imageWithContentsOfFileURL_completion(
132 &self,
133 url: &NSURL,
134 completion: &block2::Block<dyn Fn(*mut UIImage)>,
135 );
136
137 #[cfg(all(feature = "UIImage", feature = "block2"))]
138 #[unsafe(method(imageWithData:completion:))]
140 #[unsafe(method_family = none)]
141 pub unsafe fn imageWithData_completion(
142 &self,
143 data: &NSData,
144 completion: &block2::Block<dyn Fn(*mut UIImage)>,
145 );
146 );
147}
148
149impl UIImageReader {
151 extern_methods!(
152 #[unsafe(method(init))]
153 #[unsafe(method_family = init)]
154 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
155
156 #[unsafe(method(new))]
157 #[unsafe(method_family = new)]
158 pub unsafe fn new() -> Retained<Self>;
159 );
160}