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))]
53unsafe impl NSAccessibility for NSImageView {}
54
55#[cfg(all(
56 feature = "NSAccessibilityProtocols",
57 feature = "NSControl",
58 feature = "NSResponder",
59 feature = "NSView"
60))]
61unsafe impl NSAccessibilityElementProtocol for NSImageView {}
62
63#[cfg(all(
64 feature = "NSAccessibilityProtocols",
65 feature = "NSControl",
66 feature = "NSResponder",
67 feature = "NSView"
68))]
69unsafe impl NSAccessibilityImage for NSImageView {}
70
71#[cfg(all(
72 feature = "NSAnimation",
73 feature = "NSControl",
74 feature = "NSResponder",
75 feature = "NSView"
76))]
77unsafe impl NSAnimatablePropertyContainer for NSImageView {}
78
79#[cfg(all(
80 feature = "NSAppearance",
81 feature = "NSControl",
82 feature = "NSResponder",
83 feature = "NSView"
84))]
85unsafe impl NSAppearanceCustomization for NSImageView {}
86
87#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
88unsafe impl NSCoding for NSImageView {}
89
90#[cfg(all(
91 feature = "NSControl",
92 feature = "NSDragging",
93 feature = "NSResponder",
94 feature = "NSView"
95))]
96unsafe impl NSDraggingDestination for NSImageView {}
97
98#[cfg(all(
99 feature = "NSControl",
100 feature = "NSMenu",
101 feature = "NSResponder",
102 feature = "NSView"
103))]
104unsafe impl NSMenuItemValidation for NSImageView {}
105
106#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
107unsafe impl NSObjectProtocol for NSImageView {}
108
109#[cfg(all(
110 feature = "NSControl",
111 feature = "NSResponder",
112 feature = "NSUserInterfaceItemIdentification",
113 feature = "NSView"
114))]
115unsafe impl NSUserInterfaceItemIdentification for NSImageView {}
116
117#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
118impl NSImageView {
119 extern_methods!(
120 #[cfg(feature = "NSImage")]
121 #[unsafe(method(imageViewWithImage:))]
127 #[unsafe(method_family = none)]
128 pub unsafe fn imageViewWithImage(image: &NSImage, mtm: MainThreadMarker) -> Retained<Self>;
129
130 #[cfg(feature = "NSImage")]
131 #[unsafe(method(image))]
132 #[unsafe(method_family = none)]
133 pub unsafe fn image(&self) -> Option<Retained<NSImage>>;
134
135 #[cfg(feature = "NSImage")]
136 #[unsafe(method(setImage:))]
138 #[unsafe(method_family = none)]
139 pub unsafe fn setImage(&self, image: Option<&NSImage>);
140
141 #[unsafe(method(isEditable))]
142 #[unsafe(method_family = none)]
143 pub unsafe fn isEditable(&self) -> bool;
144
145 #[unsafe(method(setEditable:))]
147 #[unsafe(method_family = none)]
148 pub unsafe fn setEditable(&self, editable: bool);
149
150 #[cfg(feature = "NSImageCell")]
151 #[unsafe(method(imageAlignment))]
152 #[unsafe(method_family = none)]
153 pub unsafe fn imageAlignment(&self) -> NSImageAlignment;
154
155 #[cfg(feature = "NSImageCell")]
156 #[unsafe(method(setImageAlignment:))]
158 #[unsafe(method_family = none)]
159 pub unsafe fn setImageAlignment(&self, image_alignment: NSImageAlignment);
160
161 #[cfg(feature = "NSCell")]
162 #[unsafe(method(imageScaling))]
163 #[unsafe(method_family = none)]
164 pub unsafe fn imageScaling(&self) -> NSImageScaling;
165
166 #[cfg(feature = "NSCell")]
167 #[unsafe(method(setImageScaling:))]
169 #[unsafe(method_family = none)]
170 pub unsafe fn setImageScaling(&self, image_scaling: NSImageScaling);
171
172 #[cfg(feature = "NSImageCell")]
173 #[unsafe(method(imageFrameStyle))]
174 #[unsafe(method_family = none)]
175 pub unsafe fn imageFrameStyle(&self) -> NSImageFrameStyle;
176
177 #[cfg(feature = "NSImageCell")]
178 #[unsafe(method(setImageFrameStyle:))]
180 #[unsafe(method_family = none)]
181 pub unsafe fn setImageFrameStyle(&self, image_frame_style: NSImageFrameStyle);
182
183 #[cfg(feature = "NSImage")]
184 #[unsafe(method(symbolConfiguration))]
186 #[unsafe(method_family = none)]
187 pub unsafe fn symbolConfiguration(&self) -> Option<Retained<NSImageSymbolConfiguration>>;
188
189 #[cfg(feature = "NSImage")]
190 #[unsafe(method(setSymbolConfiguration:))]
192 #[unsafe(method_family = none)]
193 pub unsafe fn setSymbolConfiguration(
194 &self,
195 symbol_configuration: Option<&NSImageSymbolConfiguration>,
196 );
197
198 #[cfg(feature = "NSColor")]
199 #[unsafe(method(contentTintColor))]
201 #[unsafe(method_family = none)]
202 pub unsafe fn contentTintColor(&self) -> Option<Retained<NSColor>>;
203
204 #[cfg(feature = "NSColor")]
205 #[unsafe(method(setContentTintColor:))]
207 #[unsafe(method_family = none)]
208 pub unsafe fn setContentTintColor(&self, content_tint_color: Option<&NSColor>);
209
210 #[unsafe(method(animates))]
211 #[unsafe(method_family = none)]
212 pub unsafe fn animates(&self) -> bool;
213
214 #[unsafe(method(setAnimates:))]
216 #[unsafe(method_family = none)]
217 pub unsafe fn setAnimates(&self, animates: bool);
218
219 #[unsafe(method(allowsCutCopyPaste))]
220 #[unsafe(method_family = none)]
221 pub unsafe fn allowsCutCopyPaste(&self) -> bool;
222
223 #[unsafe(method(setAllowsCutCopyPaste:))]
225 #[unsafe(method_family = none)]
226 pub unsafe fn setAllowsCutCopyPaste(&self, allows_cut_copy_paste: bool);
227
228 #[unsafe(method(defaultPreferredImageDynamicRange))]
230 #[unsafe(method_family = none)]
231 pub unsafe fn defaultPreferredImageDynamicRange(
232 mtm: MainThreadMarker,
233 ) -> NSImageDynamicRange;
234
235 #[unsafe(method(setDefaultPreferredImageDynamicRange:))]
237 #[unsafe(method_family = none)]
238 pub unsafe fn setDefaultPreferredImageDynamicRange(
239 default_preferred_image_dynamic_range: NSImageDynamicRange,
240 mtm: MainThreadMarker,
241 );
242
243 #[unsafe(method(preferredImageDynamicRange))]
245 #[unsafe(method_family = none)]
246 pub unsafe fn preferredImageDynamicRange(&self) -> NSImageDynamicRange;
247
248 #[unsafe(method(setPreferredImageDynamicRange:))]
250 #[unsafe(method_family = none)]
251 pub unsafe fn setPreferredImageDynamicRange(
252 &self,
253 preferred_image_dynamic_range: NSImageDynamicRange,
254 );
255
256 #[unsafe(method(imageDynamicRange))]
258 #[unsafe(method_family = none)]
259 pub unsafe fn imageDynamicRange(&self) -> NSImageDynamicRange;
260 );
261}
262
263#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
265impl NSImageView {
266 extern_methods!(
267 #[unsafe(method(initWithFrame:))]
268 #[unsafe(method_family = init)]
269 pub unsafe fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;
270
271 #[unsafe(method(initWithCoder:))]
272 #[unsafe(method_family = init)]
273 pub unsafe fn initWithCoder(
274 this: Allocated<Self>,
275 coder: &NSCoder,
276 ) -> Option<Retained<Self>>;
277 );
278}
279
280#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
282impl NSImageView {
283 extern_methods!(
284 #[unsafe(method(init))]
285 #[unsafe(method_family = init)]
286 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
287 );
288}
289
290#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
292impl NSImageView {
293 extern_methods!(
294 #[unsafe(method(new))]
295 #[unsafe(method_family = new)]
296 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
297 );
298}