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        ///
27        /// # Safety
28        ///
29        /// - `image` might not allow `None`.
30        /// - `meta_data` generic should be of the correct type.
31        /// - `meta_data` might not allow `None`.
32        #[unsafe(method(setImage:imageProperties:))]
33        #[unsafe(method_family = none)]
34        unsafe fn setImage_imageProperties(
35            &self,
36            image: Option<&CGImage>,
37            meta_data: Option<&NSDictionary>,
38        );
39
40        #[cfg(feature = "objc2-core-graphics")]
41        /// Returns a thumbnail image whose size is no larger than the specified size.
42        #[optional]
43        #[unsafe(method(thumbnailWithMaximumSize:))]
44        #[unsafe(method_family = none)]
45        unsafe fn thumbnailWithMaximumSize(&self, size: NSSize) -> Option<Retained<CGImage>>;
46
47        /// Returns a dictionary of the image properties associated with the image in the image edit panel.
48        #[optional]
49        #[unsafe(method(imageProperties))]
50        #[unsafe(method_family = none)]
51        unsafe fn imageProperties(&self) -> Retained<NSDictionary>;
52
53        /// Show the adjust view tab
54        #[optional]
55        #[unsafe(method(hasAdjustMode))]
56        #[unsafe(method_family = none)]
57        unsafe fn hasAdjustMode(&self) -> bool;
58
59        /// Show the effects view tab
60        #[optional]
61        #[unsafe(method(hasEffectsMode))]
62        #[unsafe(method_family = none)]
63        unsafe fn hasEffectsMode(&self) -> bool;
64
65        /// Show the details view tab
66        #[optional]
67        #[unsafe(method(hasDetailsMode))]
68        #[unsafe(method_family = none)]
69        unsafe fn hasDetailsMode(&self) -> bool;
70    }
71);
72
73extern_class!(
74    /// The IKImageEditPanel class provides a panel, that is, a utility window that floats on top of document windows, optimized for image editing.
75    ///
76    /// See also [Apple's documentation](https://developer.apple.com/documentation/quartz/ikimageeditpanel?language=objc)
77    #[unsafe(super(NSPanel, NSWindow, NSResponder, NSObject))]
78    #[derive(Debug, PartialEq, Eq, Hash)]
79    pub struct IKImageEditPanel;
80);
81
82extern_conformance!(
83    unsafe impl NSAccessibility for IKImageEditPanel {}
84);
85
86extern_conformance!(
87    unsafe impl NSAccessibilityElementProtocol for IKImageEditPanel {}
88);
89
90extern_conformance!(
91    unsafe impl NSAnimatablePropertyContainer for IKImageEditPanel {}
92);
93
94extern_conformance!(
95    unsafe impl NSAppearanceCustomization for IKImageEditPanel {}
96);
97
98extern_conformance!(
99    unsafe impl NSCoding for IKImageEditPanel {}
100);
101
102extern_conformance!(
103    unsafe impl NSMenuItemValidation for IKImageEditPanel {}
104);
105
106extern_conformance!(
107    unsafe impl NSObjectProtocol for IKImageEditPanel {}
108);
109
110extern_conformance!(
111    unsafe impl NSUserInterfaceItemIdentification for IKImageEditPanel {}
112);
113
114extern_conformance!(
115    unsafe impl NSUserInterfaceValidations for IKImageEditPanel {}
116);
117
118impl IKImageEditPanel {
119    extern_methods!(
120        /// Data source associated with an image editing panel
121        ///
122        /// # Safety
123        ///
124        /// This is not retained internally, you must ensure the object is still alive.
125        #[unsafe(method(dataSource))]
126        #[unsafe(method_family = none)]
127        pub unsafe fn dataSource(
128            &self,
129        ) -> Option<Retained<ProtocolObject<dyn IKImageEditPanelDataSource>>>;
130
131        /// Setter for [`dataSource`][Self::dataSource].
132        ///
133        /// # Safety
134        ///
135        /// - `data_source` might not allow `None`.
136        /// - This is unretained, you must ensure the object is kept alive while in use.
137        #[unsafe(method(setDataSource:))]
138        #[unsafe(method_family = none)]
139        pub unsafe fn setDataSource(
140            &self,
141            data_source: Option<&ProtocolObject<dyn IKImageEditPanelDataSource>>,
142        );
143
144        /// Array of filters reflecting the current user adjustments in the adjust or effects tab.
145        #[unsafe(method(filterArray))]
146        #[unsafe(method_family = none)]
147        pub unsafe fn filterArray(&self) -> Option<Retained<NSArray>>;
148
149        /// Creates a shared instance of an image editing panel.
150        #[unsafe(method(sharedImageEditPanel))]
151        #[unsafe(method_family = none)]
152        pub unsafe fn sharedImageEditPanel(
153            mtm: MainThreadMarker,
154        ) -> Option<Retained<IKImageEditPanel>>;
155
156        /// Reloads the data from the data associated with an image editing panel.
157        #[unsafe(method(reloadData))]
158        #[unsafe(method_family = none)]
159        pub unsafe fn reloadData(&self);
160    );
161}
162
163/// Methods declared on superclass `NSWindow`.
164impl IKImageEditPanel {
165    extern_methods!(
166        #[unsafe(method(initWithContentRect:styleMask:backing:defer:))]
167        #[unsafe(method_family = init)]
168        pub unsafe fn initWithContentRect_styleMask_backing_defer(
169            this: Allocated<Self>,
170            content_rect: NSRect,
171            style: NSWindowStyleMask,
172            backing_store_type: NSBackingStoreType,
173            flag: bool,
174        ) -> Retained<Self>;
175
176        #[unsafe(method(initWithContentRect:styleMask:backing:defer:screen:))]
177        #[unsafe(method_family = init)]
178        pub unsafe fn initWithContentRect_styleMask_backing_defer_screen(
179            this: Allocated<Self>,
180            content_rect: NSRect,
181            style: NSWindowStyleMask,
182            backing_store_type: NSBackingStoreType,
183            flag: bool,
184            screen: Option<&NSScreen>,
185        ) -> Retained<Self>;
186
187        /// # Safety
188        ///
189        /// `coder` possibly has further requirements.
190        #[unsafe(method(initWithCoder:))]
191        #[unsafe(method_family = init)]
192        pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Retained<Self>;
193
194        /// 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].
195        #[unsafe(method(windowWithContentViewController:))]
196        #[unsafe(method_family = none)]
197        pub unsafe fn windowWithContentViewController(
198            content_view_controller: &NSViewController,
199        ) -> Retained<Self>;
200    );
201}
202
203/// Methods declared on superclass `NSResponder`.
204impl IKImageEditPanel {
205    extern_methods!(
206        #[unsafe(method(init))]
207        #[unsafe(method_family = init)]
208        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
209    );
210}
211
212/// Methods declared on superclass `NSObject`.
213impl IKImageEditPanel {
214    extern_methods!(
215        #[unsafe(method(new))]
216        #[unsafe(method_family = new)]
217        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
218    );
219}