objc2_app_kit/generated/
NSImageView.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10#[repr(transparent)]
15#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
16pub struct NSImageDynamicRange(pub NSInteger);
17impl NSImageDynamicRange {
18 #[doc(alias = "NSImageDynamicRangeUnspecified")]
19 pub const Unspecified: Self = Self(-1);
20 #[doc(alias = "NSImageDynamicRangeStandard")]
22 pub const Standard: Self = Self(0);
23 #[doc(alias = "NSImageDynamicRangeConstrainedHigh")]
25 pub const ConstrainedHigh: Self = Self(1);
26 #[doc(alias = "NSImageDynamicRangeHigh")]
28 pub const High: Self = Self(2);
29}
30
31unsafe impl Encode for NSImageDynamicRange {
32 const ENCODING: Encoding = NSInteger::ENCODING;
33}
34
35unsafe impl RefEncode for NSImageDynamicRange {
36 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
37}
38
39extern_class!(
40 #[unsafe(super(NSControl, NSView, NSResponder, NSObject))]
42 #[derive(Debug, PartialEq, Eq, Hash)]
43 #[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
44 pub struct NSImageView;
45);
46
47#[cfg(all(
48 feature = "NSAccessibilityProtocols",
49 feature = "NSControl",
50 feature = "NSResponder",
51 feature = "NSView"
52))]
53extern_conformance!(
54 unsafe impl NSAccessibility for NSImageView {}
55);
56
57#[cfg(all(
58 feature = "NSAccessibilityProtocols",
59 feature = "NSControl",
60 feature = "NSResponder",
61 feature = "NSView"
62))]
63extern_conformance!(
64 unsafe impl NSAccessibilityElementProtocol for NSImageView {}
65);
66
67#[cfg(all(
68 feature = "NSAccessibilityProtocols",
69 feature = "NSControl",
70 feature = "NSResponder",
71 feature = "NSView"
72))]
73extern_conformance!(
74 unsafe impl NSAccessibilityImage for NSImageView {}
75);
76
77#[cfg(all(
78 feature = "NSAnimation",
79 feature = "NSControl",
80 feature = "NSResponder",
81 feature = "NSView"
82))]
83extern_conformance!(
84 unsafe impl NSAnimatablePropertyContainer for NSImageView {}
85);
86
87#[cfg(all(
88 feature = "NSAppearance",
89 feature = "NSControl",
90 feature = "NSResponder",
91 feature = "NSView"
92))]
93extern_conformance!(
94 unsafe impl NSAppearanceCustomization for NSImageView {}
95);
96
97#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
98extern_conformance!(
99 unsafe impl NSCoding for NSImageView {}
100);
101
102#[cfg(all(
103 feature = "NSControl",
104 feature = "NSDragging",
105 feature = "NSResponder",
106 feature = "NSView"
107))]
108extern_conformance!(
109 unsafe impl NSDraggingDestination for NSImageView {}
110);
111
112#[cfg(all(
113 feature = "NSControl",
114 feature = "NSMenu",
115 feature = "NSResponder",
116 feature = "NSView"
117))]
118extern_conformance!(
119 unsafe impl NSMenuItemValidation for NSImageView {}
120);
121
122#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
123extern_conformance!(
124 unsafe impl NSObjectProtocol for NSImageView {}
125);
126
127#[cfg(all(
128 feature = "NSControl",
129 feature = "NSResponder",
130 feature = "NSUserInterfaceItemIdentification",
131 feature = "NSView"
132))]
133extern_conformance!(
134 unsafe impl NSUserInterfaceItemIdentification for NSImageView {}
135);
136
137#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
138impl NSImageView {
139 extern_methods!(
140 #[cfg(feature = "NSImage")]
141 #[unsafe(method(imageViewWithImage:))]
147 #[unsafe(method_family = none)]
148 pub unsafe fn imageViewWithImage(image: &NSImage, mtm: MainThreadMarker) -> Retained<Self>;
149
150 #[cfg(feature = "NSImage")]
151 #[unsafe(method(image))]
152 #[unsafe(method_family = none)]
153 pub unsafe fn image(&self) -> Option<Retained<NSImage>>;
154
155 #[cfg(feature = "NSImage")]
156 #[unsafe(method(setImage:))]
158 #[unsafe(method_family = none)]
159 pub unsafe fn setImage(&self, image: Option<&NSImage>);
160
161 #[unsafe(method(isEditable))]
162 #[unsafe(method_family = none)]
163 pub unsafe fn isEditable(&self) -> bool;
164
165 #[unsafe(method(setEditable:))]
167 #[unsafe(method_family = none)]
168 pub unsafe fn setEditable(&self, editable: bool);
169
170 #[cfg(feature = "NSImageCell")]
171 #[unsafe(method(imageAlignment))]
172 #[unsafe(method_family = none)]
173 pub unsafe fn imageAlignment(&self) -> NSImageAlignment;
174
175 #[cfg(feature = "NSImageCell")]
176 #[unsafe(method(setImageAlignment:))]
178 #[unsafe(method_family = none)]
179 pub unsafe fn setImageAlignment(&self, image_alignment: NSImageAlignment);
180
181 #[cfg(feature = "NSCell")]
182 #[unsafe(method(imageScaling))]
183 #[unsafe(method_family = none)]
184 pub unsafe fn imageScaling(&self) -> NSImageScaling;
185
186 #[cfg(feature = "NSCell")]
187 #[unsafe(method(setImageScaling:))]
189 #[unsafe(method_family = none)]
190 pub unsafe fn setImageScaling(&self, image_scaling: NSImageScaling);
191
192 #[cfg(feature = "NSImageCell")]
193 #[unsafe(method(imageFrameStyle))]
194 #[unsafe(method_family = none)]
195 pub unsafe fn imageFrameStyle(&self) -> NSImageFrameStyle;
196
197 #[cfg(feature = "NSImageCell")]
198 #[unsafe(method(setImageFrameStyle:))]
200 #[unsafe(method_family = none)]
201 pub unsafe fn setImageFrameStyle(&self, image_frame_style: NSImageFrameStyle);
202
203 #[cfg(feature = "NSImage")]
204 #[unsafe(method(symbolConfiguration))]
206 #[unsafe(method_family = none)]
207 pub unsafe fn symbolConfiguration(&self) -> Option<Retained<NSImageSymbolConfiguration>>;
208
209 #[cfg(feature = "NSImage")]
210 #[unsafe(method(setSymbolConfiguration:))]
212 #[unsafe(method_family = none)]
213 pub unsafe fn setSymbolConfiguration(
214 &self,
215 symbol_configuration: Option<&NSImageSymbolConfiguration>,
216 );
217
218 #[cfg(feature = "NSColor")]
219 #[unsafe(method(contentTintColor))]
221 #[unsafe(method_family = none)]
222 pub unsafe fn contentTintColor(&self) -> Option<Retained<NSColor>>;
223
224 #[cfg(feature = "NSColor")]
225 #[unsafe(method(setContentTintColor:))]
227 #[unsafe(method_family = none)]
228 pub unsafe fn setContentTintColor(&self, content_tint_color: Option<&NSColor>);
229
230 #[unsafe(method(animates))]
231 #[unsafe(method_family = none)]
232 pub unsafe fn animates(&self) -> bool;
233
234 #[unsafe(method(setAnimates:))]
236 #[unsafe(method_family = none)]
237 pub unsafe fn setAnimates(&self, animates: bool);
238
239 #[unsafe(method(allowsCutCopyPaste))]
240 #[unsafe(method_family = none)]
241 pub unsafe fn allowsCutCopyPaste(&self) -> bool;
242
243 #[unsafe(method(setAllowsCutCopyPaste:))]
245 #[unsafe(method_family = none)]
246 pub unsafe fn setAllowsCutCopyPaste(&self, allows_cut_copy_paste: bool);
247
248 #[unsafe(method(defaultPreferredImageDynamicRange))]
250 #[unsafe(method_family = none)]
251 pub unsafe fn defaultPreferredImageDynamicRange(
252 mtm: MainThreadMarker,
253 ) -> NSImageDynamicRange;
254
255 #[unsafe(method(setDefaultPreferredImageDynamicRange:))]
257 #[unsafe(method_family = none)]
258 pub unsafe fn setDefaultPreferredImageDynamicRange(
259 default_preferred_image_dynamic_range: NSImageDynamicRange,
260 mtm: MainThreadMarker,
261 );
262
263 #[unsafe(method(preferredImageDynamicRange))]
265 #[unsafe(method_family = none)]
266 pub unsafe fn preferredImageDynamicRange(&self) -> NSImageDynamicRange;
267
268 #[unsafe(method(setPreferredImageDynamicRange:))]
270 #[unsafe(method_family = none)]
271 pub unsafe fn setPreferredImageDynamicRange(
272 &self,
273 preferred_image_dynamic_range: NSImageDynamicRange,
274 );
275
276 #[unsafe(method(imageDynamicRange))]
278 #[unsafe(method_family = none)]
279 pub unsafe fn imageDynamicRange(&self) -> NSImageDynamicRange;
280 );
281}
282
283#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
285impl NSImageView {
286 extern_methods!(
287 #[unsafe(method(initWithFrame:))]
288 #[unsafe(method_family = init)]
289 pub unsafe fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;
290
291 #[unsafe(method(initWithCoder:))]
292 #[unsafe(method_family = init)]
293 pub unsafe fn initWithCoder(
294 this: Allocated<Self>,
295 coder: &NSCoder,
296 ) -> Option<Retained<Self>>;
297 );
298}
299
300#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
302impl NSImageView {
303 extern_methods!(
304 #[unsafe(method(init))]
305 #[unsafe(method_family = init)]
306 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
307 );
308}
309
310#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
312impl NSImageView {
313 extern_methods!(
314 #[unsafe(method(new))]
315 #[unsafe(method_family = new)]
316 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
317 );
318}