objc2_quartz/generated/ImageKit/
IKImageView.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_app_kit::*;
7#[cfg(feature = "objc2-core-foundation")]
8use objc2_core_foundation::*;
9#[cfg(feature = "objc2-core-graphics")]
10use objc2_core_graphics::*;
11#[cfg(feature = "objc2-core-image")]
12use objc2_core_image::*;
13use objc2_foundation::*;
14#[cfg(feature = "objc2-quartz-core")]
15use objc2_quartz_core::*;
16
17use crate::*;
18
19extern "C" {
20 pub static IKToolModeNone: Option<&'static NSString>;
22}
23
24extern "C" {
25 pub static IKToolModeMove: Option<&'static NSString>;
27}
28
29extern "C" {
30 pub static IKToolModeSelect: Option<&'static NSString>;
32}
33
34extern "C" {
35 pub static IKToolModeSelectRect: Option<&'static NSString>;
37}
38
39extern "C" {
40 pub static IKToolModeSelectEllipse: Option<&'static NSString>;
42}
43
44extern "C" {
45 pub static IKToolModeSelectLasso: Option<&'static NSString>;
47}
48
49extern "C" {
50 pub static IKToolModeCrop: Option<&'static NSString>;
52}
53
54extern "C" {
55 pub static IKToolModeRotate: Option<&'static NSString>;
57}
58
59extern "C" {
60 pub static IKToolModeAnnotate: Option<&'static NSString>;
62}
63
64extern "C" {
65 pub static IKOverlayTypeBackground: Option<&'static NSString>;
67}
68
69extern "C" {
70 pub static IKOverlayTypeImage: Option<&'static NSString>;
72}
73
74extern_class!(
75 #[unsafe(super(NSView, NSResponder, NSObject))]
79 #[derive(Debug, PartialEq, Eq, Hash)]
80 pub struct IKImageView;
81);
82
83extern_conformance!(
84 unsafe impl NSAccessibility for IKImageView {}
85);
86
87extern_conformance!(
88 unsafe impl NSAccessibilityElementProtocol for IKImageView {}
89);
90
91extern_conformance!(
92 unsafe impl NSAnimatablePropertyContainer for IKImageView {}
93);
94
95extern_conformance!(
96 unsafe impl NSAppearanceCustomization for IKImageView {}
97);
98
99extern_conformance!(
100 unsafe impl NSCoding for IKImageView {}
101);
102
103extern_conformance!(
104 unsafe impl NSDraggingDestination for IKImageView {}
105);
106
107extern_conformance!(
108 unsafe impl NSObjectProtocol for IKImageView {}
109);
110
111extern_conformance!(
112 unsafe impl NSUserInterfaceItemIdentification for IKImageView {}
113);
114
115impl IKImageView {
116 extern_methods!(
117 #[unsafe(method(delegate))]
119 #[unsafe(method_family = none)]
120 pub unsafe fn delegate(&self) -> Option<Retained<AnyObject>>;
121
122 #[unsafe(method(setDelegate:))]
124 #[unsafe(method_family = none)]
125 pub unsafe fn setDelegate(&self, delegate: Option<&AnyObject>);
126
127 #[cfg(feature = "objc2-core-foundation")]
128 #[unsafe(method(zoomFactor))]
130 #[unsafe(method_family = none)]
131 pub unsafe fn zoomFactor(&self) -> CGFloat;
132
133 #[cfg(feature = "objc2-core-foundation")]
134 #[unsafe(method(setZoomFactor:))]
136 #[unsafe(method_family = none)]
137 pub unsafe fn setZoomFactor(&self, zoom_factor: CGFloat);
138
139 #[cfg(feature = "objc2-core-foundation")]
140 #[unsafe(method(rotationAngle))]
142 #[unsafe(method_family = none)]
143 pub unsafe fn rotationAngle(&self) -> CGFloat;
144
145 #[cfg(feature = "objc2-core-foundation")]
146 #[unsafe(method(setRotationAngle:))]
148 #[unsafe(method_family = none)]
149 pub unsafe fn setRotationAngle(&self, rotation_angle: CGFloat);
150
151 #[unsafe(method(currentToolMode))]
153 #[unsafe(method_family = none)]
154 pub unsafe fn currentToolMode(&self) -> Retained<NSString>;
155
156 #[unsafe(method(setCurrentToolMode:))]
158 #[unsafe(method_family = none)]
159 pub unsafe fn setCurrentToolMode(&self, current_tool_mode: Option<&NSString>);
160
161 #[unsafe(method(autoresizes))]
163 #[unsafe(method_family = none)]
164 pub unsafe fn autoresizes(&self) -> bool;
165
166 #[unsafe(method(setAutoresizes:))]
168 #[unsafe(method_family = none)]
169 pub unsafe fn setAutoresizes(&self, autoresizes: bool);
170
171 #[unsafe(method(hasHorizontalScroller))]
173 #[unsafe(method_family = none)]
174 pub unsafe fn hasHorizontalScroller(&self) -> bool;
175
176 #[unsafe(method(setHasHorizontalScroller:))]
178 #[unsafe(method_family = none)]
179 pub unsafe fn setHasHorizontalScroller(&self, has_horizontal_scroller: bool);
180
181 #[unsafe(method(hasVerticalScroller))]
183 #[unsafe(method_family = none)]
184 pub unsafe fn hasVerticalScroller(&self) -> bool;
185
186 #[unsafe(method(setHasVerticalScroller:))]
188 #[unsafe(method_family = none)]
189 pub unsafe fn setHasVerticalScroller(&self, has_vertical_scroller: bool);
190
191 #[unsafe(method(autohidesScrollers))]
193 #[unsafe(method_family = none)]
194 pub unsafe fn autohidesScrollers(&self) -> bool;
195
196 #[unsafe(method(setAutohidesScrollers:))]
198 #[unsafe(method_family = none)]
199 pub unsafe fn setAutohidesScrollers(&self, autohides_scrollers: bool);
200
201 #[unsafe(method(supportsDragAndDrop))]
203 #[unsafe(method_family = none)]
204 pub unsafe fn supportsDragAndDrop(&self) -> bool;
205
206 #[unsafe(method(setSupportsDragAndDrop:))]
208 #[unsafe(method_family = none)]
209 pub unsafe fn setSupportsDragAndDrop(&self, supports_drag_and_drop: bool);
210
211 #[unsafe(method(editable))]
213 #[unsafe(method_family = none)]
214 pub unsafe fn editable(&self) -> bool;
215
216 #[unsafe(method(setEditable:))]
218 #[unsafe(method_family = none)]
219 pub unsafe fn setEditable(&self, editable: bool);
220
221 #[unsafe(method(doubleClickOpensImageEditPanel))]
223 #[unsafe(method_family = none)]
224 pub unsafe fn doubleClickOpensImageEditPanel(&self) -> bool;
225
226 #[unsafe(method(setDoubleClickOpensImageEditPanel:))]
228 #[unsafe(method_family = none)]
229 pub unsafe fn setDoubleClickOpensImageEditPanel(
230 &self,
231 double_click_opens_image_edit_panel: bool,
232 );
233
234 #[cfg(feature = "objc2-core-image")]
235 #[unsafe(method(imageCorrection))]
237 #[unsafe(method_family = none)]
238 pub unsafe fn imageCorrection(&self) -> Option<Retained<CIFilter>>;
239
240 #[cfg(feature = "objc2-core-image")]
241 #[unsafe(method(setImageCorrection:))]
243 #[unsafe(method_family = none)]
244 pub unsafe fn setImageCorrection(&self, image_correction: Option<&CIFilter>);
245
246 #[unsafe(method(backgroundColor))]
248 #[unsafe(method_family = none)]
249 pub unsafe fn backgroundColor(&self) -> Option<Retained<NSColor>>;
250
251 #[unsafe(method(setBackgroundColor:))]
253 #[unsafe(method_family = none)]
254 pub unsafe fn setBackgroundColor(&self, background_color: Option<&NSColor>);
255
256 #[cfg(feature = "objc2-core-graphics")]
257 #[unsafe(method(setImage:imageProperties:))]
261 #[unsafe(method_family = none)]
262 pub unsafe fn setImage_imageProperties(
263 &self,
264 image: Option<&CGImage>,
265 meta_data: Option<&NSDictionary>,
266 );
267
268 #[unsafe(method(setImageWithURL:))]
270 #[unsafe(method_family = none)]
271 pub unsafe fn setImageWithURL(&self, url: Option<&NSURL>);
272
273 #[cfg(feature = "objc2-core-graphics")]
274 #[unsafe(method(image))]
276 #[unsafe(method_family = none)]
277 pub unsafe fn image(&self) -> Option<Retained<CGImage>>;
278
279 #[unsafe(method(imageSize))]
281 #[unsafe(method_family = none)]
282 pub unsafe fn imageSize(&self) -> NSSize;
283
284 #[unsafe(method(imageProperties))]
286 #[unsafe(method_family = none)]
287 pub unsafe fn imageProperties(&self) -> Option<Retained<NSDictionary>>;
288
289 #[cfg(feature = "objc2-core-foundation")]
290 #[unsafe(method(setRotationAngle:centerPoint:))]
292 #[unsafe(method_family = none)]
293 pub unsafe fn setRotationAngle_centerPoint(
294 &self,
295 rotation_angle: CGFloat,
296 center_point: NSPoint,
297 );
298
299 #[unsafe(method(rotateImageLeft:))]
301 #[unsafe(method_family = none)]
302 pub unsafe fn rotateImageLeft(&self, sender: Option<&AnyObject>);
303
304 #[unsafe(method(rotateImageRight:))]
306 #[unsafe(method_family = none)]
307 pub unsafe fn rotateImageRight(&self, sender: Option<&AnyObject>);
308
309 #[cfg(feature = "objc2-core-foundation")]
310 #[unsafe(method(setImageZoomFactor:centerPoint:))]
312 #[unsafe(method_family = none)]
313 pub unsafe fn setImageZoomFactor_centerPoint(
314 &self,
315 zoom_factor: CGFloat,
316 center_point: NSPoint,
317 );
318
319 #[unsafe(method(zoomImageToRect:))]
321 #[unsafe(method_family = none)]
322 pub unsafe fn zoomImageToRect(&self, rect: NSRect);
323
324 #[unsafe(method(zoomImageToFit:))]
326 #[unsafe(method_family = none)]
327 pub unsafe fn zoomImageToFit(&self, sender: Option<&AnyObject>);
328
329 #[unsafe(method(zoomImageToActualSize:))]
331 #[unsafe(method_family = none)]
332 pub unsafe fn zoomImageToActualSize(&self, sender: Option<&AnyObject>);
333
334 #[unsafe(method(zoomIn:))]
336 #[unsafe(method_family = none)]
337 pub unsafe fn zoomIn(&self, sender: Option<&AnyObject>);
338
339 #[unsafe(method(zoomOut:))]
341 #[unsafe(method_family = none)]
342 pub unsafe fn zoomOut(&self, sender: Option<&AnyObject>);
343
344 #[unsafe(method(flipImageHorizontal:))]
346 #[unsafe(method_family = none)]
347 pub unsafe fn flipImageHorizontal(&self, sender: Option<&AnyObject>);
348
349 #[unsafe(method(flipImageVertical:))]
351 #[unsafe(method_family = none)]
352 pub unsafe fn flipImageVertical(&self, sender: Option<&AnyObject>);
353
354 #[unsafe(method(crop:))]
356 #[unsafe(method_family = none)]
357 pub unsafe fn crop(&self, sender: Option<&AnyObject>);
358
359 #[cfg(feature = "objc2-quartz-core")]
360 #[unsafe(method(setOverlay:forType:))]
362 #[unsafe(method_family = none)]
363 pub unsafe fn setOverlay_forType(
364 &self,
365 layer: Option<&CALayer>,
366 layer_type: Option<&NSString>,
367 );
368
369 #[cfg(feature = "objc2-quartz-core")]
370 #[unsafe(method(overlayForType:))]
372 #[unsafe(method_family = none)]
373 pub unsafe fn overlayForType(
374 &self,
375 layer_type: Option<&NSString>,
376 ) -> Option<Retained<CALayer>>;
377
378 #[unsafe(method(scrollToPoint:))]
380 #[unsafe(method_family = none)]
381 pub unsafe fn scrollToPoint(&self, point: NSPoint);
382
383 #[unsafe(method(scrollToRect:))]
385 #[unsafe(method_family = none)]
386 pub unsafe fn scrollToRect(&self, rect: NSRect);
387
388 #[unsafe(method(convertViewPointToImagePoint:))]
390 #[unsafe(method_family = none)]
391 pub unsafe fn convertViewPointToImagePoint(&self, view_point: NSPoint) -> NSPoint;
392
393 #[unsafe(method(convertViewRectToImageRect:))]
395 #[unsafe(method_family = none)]
396 pub unsafe fn convertViewRectToImageRect(&self, view_rect: NSRect) -> NSRect;
397
398 #[unsafe(method(convertImagePointToViewPoint:))]
400 #[unsafe(method_family = none)]
401 pub unsafe fn convertImagePointToViewPoint(&self, image_point: NSPoint) -> NSPoint;
402
403 #[unsafe(method(convertImageRectToViewRect:))]
405 #[unsafe(method_family = none)]
406 pub unsafe fn convertImageRectToViewRect(&self, image_rect: NSRect) -> NSRect;
407 );
408}
409
410impl IKImageView {
412 extern_methods!(
413 #[unsafe(method(initWithFrame:))]
414 #[unsafe(method_family = init)]
415 pub unsafe fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;
416
417 #[unsafe(method(initWithCoder:))]
418 #[unsafe(method_family = init)]
419 pub unsafe fn initWithCoder(
420 this: Allocated<Self>,
421 coder: &NSCoder,
422 ) -> Option<Retained<Self>>;
423 );
424}
425
426impl IKImageView {
428 extern_methods!(
429 #[unsafe(method(init))]
430 #[unsafe(method_family = init)]
431 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
432 );
433}
434
435impl IKImageView {
437 extern_methods!(
438 #[unsafe(method(new))]
439 #[unsafe(method_family = new)]
440 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
441 );
442}