objc2_quartz/generated/ImageKit/
IKImageEditPanel.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_app_kit::*;
7#[cfg(feature = "objc2-core-graphics")]
8use objc2_core_graphics::*;
9use objc2_foundation::*;
10
11use crate::*;
12
13extern_protocol!(
14    /// The data source of IKImageEditPanel must conform to IKImageEditPanelDataSource protocol.
15    ///
16    /// See also [Apple's documentation](https://developer.apple.com/documentation/quartz/ikimageeditpaneldatasource?language=objc)
17    pub unsafe trait IKImageEditPanelDataSource {
18        #[cfg(feature = "objc2-core-graphics")]
19        /// Returns an image.
20        #[unsafe(method(image))]
21        #[unsafe(method_family = none)]
22        unsafe fn image(&self) -> Option<Retained<CGImage>>;
23
24        #[cfg(feature = "objc2-core-graphics")]
25        /// Sets an image with the specifies properties.
26        #[unsafe(method(setImage:imageProperties:))]
27        #[unsafe(method_family = none)]
28        unsafe fn setImage_imageProperties(
29            &self,
30            image: Option<&CGImage>,
31            meta_data: Option<&NSDictionary>,
32        );
33
34        #[cfg(feature = "objc2-core-graphics")]
35        /// Returns a thumbnail image whose size is no larger than the specified size.
36        #[optional]
37        #[unsafe(method(thumbnailWithMaximumSize:))]
38        #[unsafe(method_family = none)]
39        unsafe fn thumbnailWithMaximumSize(&self, size: NSSize) -> Option<Retained<CGImage>>;
40
41        /// Returns a dictionary of the image properties associated with the image in the image edit panel.
42        #[optional]
43        #[unsafe(method(imageProperties))]
44        #[unsafe(method_family = none)]
45        unsafe fn imageProperties(&self) -> Retained<NSDictionary>;
46
47        /// Show the adjust view tab
48        #[optional]
49        #[unsafe(method(hasAdjustMode))]
50        #[unsafe(method_family = none)]
51        unsafe fn hasAdjustMode(&self) -> bool;
52
53        /// Show the effects view tab
54        #[optional]
55        #[unsafe(method(hasEffectsMode))]
56        #[unsafe(method_family = none)]
57        unsafe fn hasEffectsMode(&self) -> bool;
58
59        /// Show the details view tab
60        #[optional]
61        #[unsafe(method(hasDetailsMode))]
62        #[unsafe(method_family = none)]
63        unsafe fn hasDetailsMode(&self) -> bool;
64    }
65);
66
67extern_class!(
68    /// The IKImageEditPanel class provides a panel, that is, a utility window that floats on top of document windows, optimized for image editing.
69    ///
70    /// See also [Apple's documentation](https://developer.apple.com/documentation/quartz/ikimageeditpanel?language=objc)
71    #[unsafe(super(NSPanel, NSWindow, NSResponder, NSObject))]
72    #[derive(Debug, PartialEq, Eq, Hash)]
73    pub struct IKImageEditPanel;
74);
75
76extern_conformance!(
77    unsafe impl NSAccessibility for IKImageEditPanel {}
78);
79
80extern_conformance!(
81    unsafe impl NSAccessibilityElementProtocol for IKImageEditPanel {}
82);
83
84extern_conformance!(
85    unsafe impl NSAnimatablePropertyContainer for IKImageEditPanel {}
86);
87
88extern_conformance!(
89    unsafe impl NSAppearanceCustomization for IKImageEditPanel {}
90);
91
92extern_conformance!(
93    unsafe impl NSCoding for IKImageEditPanel {}
94);
95
96extern_conformance!(
97    unsafe impl NSMenuItemValidation for IKImageEditPanel {}
98);
99
100extern_conformance!(
101    unsafe impl NSObjectProtocol for IKImageEditPanel {}
102);
103
104extern_conformance!(
105    unsafe impl NSUserInterfaceItemIdentification for IKImageEditPanel {}
106);
107
108extern_conformance!(
109    unsafe impl NSUserInterfaceValidations for IKImageEditPanel {}
110);
111
112impl IKImageEditPanel {
113    extern_methods!(
114        /// Data source associated with an image editing panel
115        #[unsafe(method(dataSource))]
116        #[unsafe(method_family = none)]
117        pub unsafe fn dataSource(
118            &self,
119        ) -> Option<Retained<ProtocolObject<dyn IKImageEditPanelDataSource>>>;
120
121        /// Setter for [`dataSource`][Self::dataSource].
122        #[unsafe(method(setDataSource:))]
123        #[unsafe(method_family = none)]
124        pub unsafe fn setDataSource(
125            &self,
126            data_source: Option<&ProtocolObject<dyn IKImageEditPanelDataSource>>,
127        );
128
129        /// Array of filters reflecting the current user adjustments in the adjust or effects tab.
130        #[unsafe(method(filterArray))]
131        #[unsafe(method_family = none)]
132        pub unsafe fn filterArray(&self) -> Option<Retained<NSArray>>;
133
134        /// Creates a shared instance of an image editing panel.
135        #[unsafe(method(sharedImageEditPanel))]
136        #[unsafe(method_family = none)]
137        pub unsafe fn sharedImageEditPanel(
138            mtm: MainThreadMarker,
139        ) -> Option<Retained<IKImageEditPanel>>;
140
141        /// Reloads the data from the data associated with an image editing panel.
142        #[unsafe(method(reloadData))]
143        #[unsafe(method_family = none)]
144        pub unsafe fn reloadData(&self);
145    );
146}
147
148/// Methods declared on superclass `NSWindow`.
149impl IKImageEditPanel {
150    extern_methods!(
151        #[unsafe(method(initWithContentRect:styleMask:backing:defer:))]
152        #[unsafe(method_family = init)]
153        pub unsafe fn initWithContentRect_styleMask_backing_defer(
154            this: Allocated<Self>,
155            content_rect: NSRect,
156            style: NSWindowStyleMask,
157            backing_store_type: NSBackingStoreType,
158            flag: bool,
159        ) -> Retained<Self>;
160
161        #[unsafe(method(initWithContentRect:styleMask:backing:defer:screen:))]
162        #[unsafe(method_family = init)]
163        pub unsafe fn initWithContentRect_styleMask_backing_defer_screen(
164            this: Allocated<Self>,
165            content_rect: NSRect,
166            style: NSWindowStyleMask,
167            backing_store_type: NSBackingStoreType,
168            flag: bool,
169            screen: Option<&NSScreen>,
170        ) -> Retained<Self>;
171
172        #[unsafe(method(initWithCoder:))]
173        #[unsafe(method_family = init)]
174        pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Retained<Self>;
175
176        /// Convenience method for creating an autoreleased titled window with the given contentViewController. A basic NSWindow with the following attributes is made: titled, closable, resizable, miniaturizable. The window's title is automatically bound to the contentViewController's title. The size of the window can easily be controlled by utilizing autolayout and applying size constraints to the view (or its subviews). The window has isReleasedWhenClosed set to NO, and it must be explicitly retained to keep the window instance alive. To have it automatically be freed when it is closed, do the following: [window retain] and [window setReleasedWhenClosed:YES].
177        #[unsafe(method(windowWithContentViewController:))]
178        #[unsafe(method_family = none)]
179        pub unsafe fn windowWithContentViewController(
180            content_view_controller: &NSViewController,
181        ) -> Retained<Self>;
182    );
183}
184
185/// Methods declared on superclass `NSResponder`.
186impl IKImageEditPanel {
187    extern_methods!(
188        #[unsafe(method(init))]
189        #[unsafe(method_family = init)]
190        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
191    );
192}
193
194/// Methods declared on superclass `NSObject`.
195impl IKImageEditPanel {
196    extern_methods!(
197        #[unsafe(method(new))]
198        #[unsafe(method_family = new)]
199        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
200    );
201}