objc2_quartz/generated/ImageKit/
IKFilterBrowserPanel.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::*;
7use objc2_foundation::*;
8
9use crate::*;
10
11extern_class!(
12    /// The IKFilterBrowserPanel provides the shared IKFilterBrowser with its runtime model.
13    ///
14    /// See information in the introduction.
15    ///
16    /// See also [Apple's documentation](https://developer.apple.com/documentation/quartz/ikfilterbrowserpanel?language=objc)
17    #[unsafe(super(NSPanel, NSWindow, NSResponder, NSObject))]
18    #[derive(Debug, PartialEq, Eq, Hash)]
19    pub struct IKFilterBrowserPanel;
20);
21
22extern_conformance!(
23    unsafe impl NSAccessibility for IKFilterBrowserPanel {}
24);
25
26extern_conformance!(
27    unsafe impl NSAccessibilityElementProtocol for IKFilterBrowserPanel {}
28);
29
30extern_conformance!(
31    unsafe impl NSAnimatablePropertyContainer for IKFilterBrowserPanel {}
32);
33
34extern_conformance!(
35    unsafe impl NSAppearanceCustomization for IKFilterBrowserPanel {}
36);
37
38extern_conformance!(
39    unsafe impl NSCoding for IKFilterBrowserPanel {}
40);
41
42extern_conformance!(
43    unsafe impl NSMenuItemValidation for IKFilterBrowserPanel {}
44);
45
46extern_conformance!(
47    unsafe impl NSObjectProtocol for IKFilterBrowserPanel {}
48);
49
50extern_conformance!(
51    unsafe impl NSUserInterfaceItemIdentification for IKFilterBrowserPanel {}
52);
53
54extern_conformance!(
55    unsafe impl NSUserInterfaceValidations for IKFilterBrowserPanel {}
56);
57
58impl IKFilterBrowserPanel {
59    extern_methods!(
60        /// Create a shared instance of the IKFilterBrowser
61        ///
62        /// Use this method to create a shared instance of the IKFilterBrowser with a specific NSWindow style. Right now it only supports selecting of deselecting the NSTexturedBackgroundWindowMask style bit.
63        #[unsafe(method(filterBrowserPanelWithStyleMask:))]
64        #[unsafe(method_family = none)]
65        pub unsafe fn filterBrowserPanelWithStyleMask(
66            style_mask: c_uint,
67            mtm: MainThreadMarker,
68        ) -> Option<Retained<AnyObject>>;
69
70        /// Returns the name of the currently selected filter.
71        ///
72        /// Use this method in response to a IKFilterBrowserFilterSelectedNotification or IKFilterBrowserFilterDoubleClickNotification or afer returning from a modal session.
73        #[unsafe(method(filterName))]
74        #[unsafe(method_family = none)]
75        pub unsafe fn filterName(&self) -> Option<Retained<NSString>>;
76    );
77}
78
79/// Methods declared on superclass `NSWindow`.
80impl IKFilterBrowserPanel {
81    extern_methods!(
82        #[unsafe(method(initWithContentRect:styleMask:backing:defer:))]
83        #[unsafe(method_family = init)]
84        pub unsafe fn initWithContentRect_styleMask_backing_defer(
85            this: Allocated<Self>,
86            content_rect: NSRect,
87            style: NSWindowStyleMask,
88            backing_store_type: NSBackingStoreType,
89            flag: bool,
90        ) -> Retained<Self>;
91
92        #[unsafe(method(initWithContentRect:styleMask:backing:defer:screen:))]
93        #[unsafe(method_family = init)]
94        pub unsafe fn initWithContentRect_styleMask_backing_defer_screen(
95            this: Allocated<Self>,
96            content_rect: NSRect,
97            style: NSWindowStyleMask,
98            backing_store_type: NSBackingStoreType,
99            flag: bool,
100            screen: Option<&NSScreen>,
101        ) -> Retained<Self>;
102
103        /// # Safety
104        ///
105        /// `coder` possibly has further requirements.
106        #[unsafe(method(initWithCoder:))]
107        #[unsafe(method_family = init)]
108        pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Retained<Self>;
109
110        /// 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].
111        #[unsafe(method(windowWithContentViewController:))]
112        #[unsafe(method_family = none)]
113        pub unsafe fn windowWithContentViewController(
114            content_view_controller: &NSViewController,
115        ) -> Retained<Self>;
116    );
117}
118
119/// Methods declared on superclass `NSResponder`.
120impl IKFilterBrowserPanel {
121    extern_methods!(
122        #[unsafe(method(init))]
123        #[unsafe(method_family = init)]
124        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
125    );
126}
127
128/// Methods declared on superclass `NSObject`.
129impl IKFilterBrowserPanel {
130    extern_methods!(
131        #[unsafe(method(new))]
132        #[unsafe(method_family = new)]
133        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
134    );
135}
136
137/// IKFilterBrowserPanelRuntime.
138///
139/// Use the methods in the IKFilterBrowserPanelRuntime to display and run the IKFilterBrowser.
140///
141/// These methods are modeled after the NSOpenPanel methods with additions to allow for different UI configurations and to just get a IKFilterBrowserView to be inserted in your UI.
142impl IKFilterBrowserPanel {
143    extern_methods!(
144        /// Displays the FilterBrowser in a new window unless it is already open.
145        ///
146        /// Use this method to open the IKFilterBrowser in a seperate window, much like a panel. When the panel operation is ended, didEndSelector is invoked on the modelessDelegate, passing contextInfo as an argument.
147        /// didEndSelector should have the following signature:
148        ///
149        /// - (void)openPanelDidEnd:(NSOpenPanel *)panel returnCode:(int)returnCode  contextInfo:(void  *)contextInfo
150        ///
151        /// The value passed as returnCode will be either NSCancelButton or NSOKButton.
152        ///
153        /// Parameter `inOptions`: A dictionary describing the desired UI configuration for the IKFilterBrowser
154        ///
155        /// Parameter `modelessDelegate`: See discussion below
156        ///
157        /// Parameter `didEndSelector`: See discussion below
158        ///
159        /// Parameter `contextInfo`: See discussion below
160        ///
161        /// # Safety
162        ///
163        /// - `in_options` generic should be of the correct type.
164        /// - `in_options` might not allow `None`.
165        /// - `modeless_delegate` should be of the correct type.
166        /// - `modeless_delegate` might not allow `None`.
167        /// - `did_end_selector` must be a valid selector.
168        /// - `context_info` must be a valid pointer.
169        #[unsafe(method(beginWithOptions:modelessDelegate:didEndSelector:contextInfo:))]
170        #[unsafe(method_family = none)]
171        pub unsafe fn beginWithOptions_modelessDelegate_didEndSelector_contextInfo(
172            &self,
173            in_options: Option<&NSDictionary>,
174            modeless_delegate: Option<&AnyObject>,
175            did_end_selector: Option<Sel>,
176            context_info: *mut c_void,
177        );
178
179        /// Displays the FilterBrowser in a sheet attached to the passed in window.
180        ///
181        /// Use this method to open the IKFilterBrowser in a sheet attached to a window. When the sheet operation is ended, didEndSelector is invoked on the modalDelegate, passing contextInfo as an argument.
182        /// didEndSelector should have the following signature:
183        ///
184        /// - (void)openPanelDidEnd:(NSOpenPanel *)panel returnCode:(int)returnCode  contextInfo:(void  *)contextInfo
185        ///
186        /// The value passed as returnCode will be either NSCancelButton or NSOKButton.
187        ///
188        /// Parameter `inOptions`: A dictionary describing the desired UI configuration for the IKFilterBrowser
189        ///
190        /// Parameter `modalForWindow`: The window to which the sheet should be attached to.
191        ///
192        /// Parameter `modalDelegate`: See discussion below
193        ///
194        /// Parameter `didEndSelector`: See discussion below
195        ///
196        /// Parameter `contextInfo`: See discussion below
197        ///
198        /// # Safety
199        ///
200        /// - `in_options` generic should be of the correct type.
201        /// - `in_options` might not allow `None`.
202        /// - `doc_window` might not allow `None`.
203        /// - `modal_delegate` should be of the correct type.
204        /// - `modal_delegate` might not allow `None`.
205        /// - `did_end_selector` must be a valid selector.
206        /// - `context_info` must be a valid pointer.
207        #[unsafe(method(beginSheetWithOptions:modalForWindow:modalDelegate:didEndSelector:contextInfo:))]
208        #[unsafe(method_family = none)]
209        pub unsafe fn beginSheetWithOptions_modalForWindow_modalDelegate_didEndSelector_contextInfo(
210            &self,
211            in_options: Option<&NSDictionary>,
212            doc_window: Option<&NSWindow>,
213            modal_delegate: Option<&AnyObject>,
214            did_end_selector: Option<Sel>,
215            context_info: *mut c_void,
216        );
217
218        /// Displays the FilterBrowser in a modal dialog.
219        ///
220        /// Use this method to run the IKFilterBrowser in a modal dialog. The value passed as returnCode will be either NSCancelButton or NSOKButton.
221        ///
222        /// Parameter `inOptions`: A dictionary describing the desired UI configuration for the IKFilterBrowser
223        ///
224        /// # Safety
225        ///
226        /// - `in_options` generic should be of the correct type.
227        /// - `in_options` might not allow `None`.
228        #[unsafe(method(runModalWithOptions:))]
229        #[unsafe(method_family = none)]
230        pub unsafe fn runModalWithOptions(&self, in_options: Option<&NSDictionary>) -> c_int;
231
232        #[cfg(feature = "IKFilterBrowserView")]
233        /// Returns a view containing the FilterBrowser.
234        ///
235        /// Use this method to run the IKFilterBrowser in your own UI. To dismiss it, invoke the finish action as described below.
236        ///
237        /// Parameter `inOptions`: A dictionary describing the desired UI configuration for the IKFilterBrowser
238        ///
239        /// # Safety
240        ///
241        /// - `in_options` generic should be of the correct type.
242        /// - `in_options` might not allow `None`.
243        #[unsafe(method(filterBrowserViewWithOptions:))]
244        #[unsafe(method_family = none)]
245        pub unsafe fn filterBrowserViewWithOptions(
246            &self,
247            in_options: Option<&NSDictionary>,
248        ) -> Option<Retained<IKFilterBrowserView>>;
249
250        /// Closes the IKFilterBrowser.
251        ///
252        /// Invoke this action for instance from your OK or Cancel button when you are running the IKFilterBrowserView modal in your own UI.
253        ///
254        /// # Safety
255        ///
256        /// - `sender` should be of the correct type.
257        /// - `sender` might not allow `None`.
258        #[unsafe(method(finish:))]
259        #[unsafe(method_family = none)]
260        pub unsafe fn finish(&self, sender: Option<&AnyObject>);
261    );
262}
263
264extern "C" {
265    /// IKFilterBrowserFilterSelectedNotification
266    ///
267    /// Send when the user clicked on a filter in the Filter Browser. The name of the selected filter is send as the object in the notification
268    ///
269    /// See also [Apple's documentation](https://developer.apple.com/documentation/quartz/ikfilterbrowserfilterselectednotification?language=objc)
270    pub static IKFilterBrowserFilterSelectedNotification: Option<&'static NSString>;
271}
272
273extern "C" {
274    /// IKFilterBrowserFilterDoubleClickNotification
275    ///
276    /// Send when the user made a double click on a filter in the Filter Browser. The name of the selected filter is send as the object in the notification
277    ///
278    /// See also [Apple's documentation](https://developer.apple.com/documentation/quartz/ikfilterbrowserfilterdoubleclicknotification?language=objc)
279    pub static IKFilterBrowserFilterDoubleClickNotification: Option<&'static NSString>;
280}
281
282extern "C" {
283    /// IKFilterBrowserWillPreviewFilterNotification
284    ///
285    /// Send before a filter is previewed allowing for setting parameters of that filter. The selected CIFilter object is send as the object in the notification
286    ///
287    /// See also [Apple's documentation](https://developer.apple.com/documentation/quartz/ikfilterbrowserwillpreviewfilternotification?language=objc)
288    pub static IKFilterBrowserWillPreviewFilterNotification: Option<&'static NSString>;
289}
290
291extern "C" {
292    /// IKFilterBrowserShowCategories
293    ///
294    /// BOOL - Determines if the filter browser should show the category list
295    ///
296    /// See also [Apple's documentation](https://developer.apple.com/documentation/quartz/ikfilterbrowsershowcategories?language=objc)
297    pub static IKFilterBrowserShowCategories: Option<&'static NSString>;
298}
299
300extern "C" {
301    /// IKFilterBrowserShowPreview
302    ///
303    /// BOOL - Determines if the filter browser should show the preview well
304    ///
305    /// See also [Apple's documentation](https://developer.apple.com/documentation/quartz/ikfilterbrowsershowpreview?language=objc)
306    pub static IKFilterBrowserShowPreview: Option<&'static NSString>;
307}
308
309extern "C" {
310    /// IKFilterBrowserExcludeCategories
311    ///
312    /// NSArray - The categories in this array will not be displayed in the browser
313    ///
314    /// See also [Apple's documentation](https://developer.apple.com/documentation/quartz/ikfilterbrowserexcludecategories?language=objc)
315    pub static IKFilterBrowserExcludeCategories: Option<&'static NSString>;
316}
317
318extern "C" {
319    /// IKFilterBrowserExcludeFilters
320    ///
321    /// NSArray - The filters in this array will not be displayed in the browser
322    ///
323    /// See also [Apple's documentation](https://developer.apple.com/documentation/quartz/ikfilterbrowserexcludefilters?language=objc)
324    pub static IKFilterBrowserExcludeFilters: Option<&'static NSString>;
325}
326
327extern "C" {
328    /// IKFilterBrowserDefaultInputImage - Allows you to set a custom image to be used as the inputImage for the filter preview.
329    ///
330    /// CIImage* - You can also set the inputImage among other parameters during the IKFilterBrowserWillPreviewFilterNotification. This image will be set before the notification is called. Setting the image to nil falls back to the image suplied by the framework.
331    ///
332    /// See also [Apple's documentation](https://developer.apple.com/documentation/quartz/ikfilterbrowserdefaultinputimage?language=objc)
333    pub static IKFilterBrowserDefaultInputImage: Option<&'static NSString>;
334}