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        #[unsafe(method(initWithCoder:))]
104        #[unsafe(method_family = init)]
105        pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Retained<Self>;
106
107        /// 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].
108        #[unsafe(method(windowWithContentViewController:))]
109        #[unsafe(method_family = none)]
110        pub unsafe fn windowWithContentViewController(
111            content_view_controller: &NSViewController,
112        ) -> Retained<Self>;
113    );
114}
115
116/// Methods declared on superclass `NSResponder`.
117impl IKFilterBrowserPanel {
118    extern_methods!(
119        #[unsafe(method(init))]
120        #[unsafe(method_family = init)]
121        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
122    );
123}
124
125/// Methods declared on superclass `NSObject`.
126impl IKFilterBrowserPanel {
127    extern_methods!(
128        #[unsafe(method(new))]
129        #[unsafe(method_family = new)]
130        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
131    );
132}
133
134/// IKFilterBrowserPanelRuntime.
135/// Use the methods in the IKFilterBrowserPanelRuntime to display and run the IKFilterBrowser.
136///
137/// 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.
138impl IKFilterBrowserPanel {
139    extern_methods!(
140        /// Displays the FilterBrowser in a new window unless it is already open.
141        ///
142        /// 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.
143        /// didEndSelector should have the following signature:
144        ///
145        /// - (void)openPanelDidEnd:(NSOpenPanel *)panel returnCode:(int)returnCode  contextInfo:(void  *)contextInfo
146        ///
147        /// The value passed as returnCode will be either NSCancelButton or NSOKButton.
148        ///
149        /// Parameter `inOptions`: A dictionary describing the desired UI configuration for the IKFilterBrowser
150        ///
151        /// Parameter `modelessDelegate`: See discussion below
152        ///
153        /// Parameter `didEndSelector`: See discussion below
154        ///
155        /// Parameter `contextInfo`: See discussion below
156        #[unsafe(method(beginWithOptions:modelessDelegate:didEndSelector:contextInfo:))]
157        #[unsafe(method_family = none)]
158        pub unsafe fn beginWithOptions_modelessDelegate_didEndSelector_contextInfo(
159            &self,
160            in_options: Option<&NSDictionary>,
161            modeless_delegate: Option<&AnyObject>,
162            did_end_selector: Option<Sel>,
163            context_info: *mut c_void,
164        );
165
166        /// Displays the FilterBrowser in a sheet attached to the passed in window.
167        ///
168        /// 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.
169        /// didEndSelector should have the following signature:
170        ///
171        /// - (void)openPanelDidEnd:(NSOpenPanel *)panel returnCode:(int)returnCode  contextInfo:(void  *)contextInfo
172        ///
173        /// The value passed as returnCode will be either NSCancelButton or NSOKButton.
174        ///
175        /// Parameter `inOptions`: A dictionary describing the desired UI configuration for the IKFilterBrowser
176        ///
177        /// Parameter `modalForWindow`: The window to which the sheet should be attached to.
178        ///
179        /// Parameter `modalDelegate`: See discussion below
180        ///
181        /// Parameter `didEndSelector`: See discussion below
182        ///
183        /// Parameter `contextInfo`: See discussion below
184        #[unsafe(method(beginSheetWithOptions:modalForWindow:modalDelegate:didEndSelector:contextInfo:))]
185        #[unsafe(method_family = none)]
186        pub unsafe fn beginSheetWithOptions_modalForWindow_modalDelegate_didEndSelector_contextInfo(
187            &self,
188            in_options: Option<&NSDictionary>,
189            doc_window: Option<&NSWindow>,
190            modal_delegate: Option<&AnyObject>,
191            did_end_selector: Option<Sel>,
192            context_info: *mut c_void,
193        );
194
195        /// Displays the FilterBrowser in a modal dialog.
196        ///
197        /// Use this method to run the IKFilterBrowser in a modal dialog. The value passed as returnCode will be either NSCancelButton or NSOKButton.
198        ///
199        /// Parameter `inOptions`: A dictionary describing the desired UI configuration for the IKFilterBrowser
200        #[unsafe(method(runModalWithOptions:))]
201        #[unsafe(method_family = none)]
202        pub unsafe fn runModalWithOptions(&self, in_options: Option<&NSDictionary>) -> c_int;
203
204        #[cfg(feature = "IKFilterBrowserView")]
205        /// Returns a view containing the FilterBrowser.
206        ///
207        /// Use this method to run the IKFilterBrowser in your own UI. To dismiss it, invoke the finish action as described below.
208        ///
209        /// Parameter `inOptions`: A dictionary describing the desired UI configuration for the IKFilterBrowser
210        #[unsafe(method(filterBrowserViewWithOptions:))]
211        #[unsafe(method_family = none)]
212        pub unsafe fn filterBrowserViewWithOptions(
213            &self,
214            in_options: Option<&NSDictionary>,
215        ) -> Option<Retained<IKFilterBrowserView>>;
216
217        /// Closes the IKFilterBrowser.
218        ///
219        /// Invoke this action for instance from your OK or Cancel button when you are running the IKFilterBrowserView modal in your own UI.
220        #[unsafe(method(finish:))]
221        #[unsafe(method_family = none)]
222        pub unsafe fn finish(&self, sender: Option<&AnyObject>);
223    );
224}
225
226extern "C" {
227    /// IKFilterBrowserFilterSelectedNotification
228    ///
229    /// 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
230    ///
231    /// See also [Apple's documentation](https://developer.apple.com/documentation/quartz/ikfilterbrowserfilterselectednotification?language=objc)
232    pub static IKFilterBrowserFilterSelectedNotification: Option<&'static NSString>;
233}
234
235extern "C" {
236    /// IKFilterBrowserFilterDoubleClickNotification
237    ///
238    /// 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
239    ///
240    /// See also [Apple's documentation](https://developer.apple.com/documentation/quartz/ikfilterbrowserfilterdoubleclicknotification?language=objc)
241    pub static IKFilterBrowserFilterDoubleClickNotification: Option<&'static NSString>;
242}
243
244extern "C" {
245    /// IKFilterBrowserWillPreviewFilterNotification
246    ///
247    /// 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
248    ///
249    /// See also [Apple's documentation](https://developer.apple.com/documentation/quartz/ikfilterbrowserwillpreviewfilternotification?language=objc)
250    pub static IKFilterBrowserWillPreviewFilterNotification: Option<&'static NSString>;
251}
252
253extern "C" {
254    /// IKFilterBrowserShowCategories
255    ///
256    /// BOOL - Determines if the filter browser should show the category list
257    ///
258    /// See also [Apple's documentation](https://developer.apple.com/documentation/quartz/ikfilterbrowsershowcategories?language=objc)
259    pub static IKFilterBrowserShowCategories: Option<&'static NSString>;
260}
261
262extern "C" {
263    /// IKFilterBrowserShowPreview
264    ///
265    /// BOOL - Determines if the filter browser should show the preview well
266    ///
267    /// See also [Apple's documentation](https://developer.apple.com/documentation/quartz/ikfilterbrowsershowpreview?language=objc)
268    pub static IKFilterBrowserShowPreview: Option<&'static NSString>;
269}
270
271extern "C" {
272    /// IKFilterBrowserExcludeCategories
273    ///
274    /// NSArray - The categories in this array will not be displayed in the browser
275    ///
276    /// See also [Apple's documentation](https://developer.apple.com/documentation/quartz/ikfilterbrowserexcludecategories?language=objc)
277    pub static IKFilterBrowserExcludeCategories: Option<&'static NSString>;
278}
279
280extern "C" {
281    /// IKFilterBrowserExcludeFilters
282    ///
283    /// NSArray - The filters in this array will not be displayed in the browser
284    ///
285    /// See also [Apple's documentation](https://developer.apple.com/documentation/quartz/ikfilterbrowserexcludefilters?language=objc)
286    pub static IKFilterBrowserExcludeFilters: Option<&'static NSString>;
287}
288
289extern "C" {
290    /// IKFilterBrowserDefaultInputImage - Allows you to set a custom image to be used as the inputImage for the filter preview.
291    ///
292    /// 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.
293    ///
294    /// See also [Apple's documentation](https://developer.apple.com/documentation/quartz/ikfilterbrowserdefaultinputimage?language=objc)
295    pub static IKFilterBrowserDefaultInputImage: Option<&'static NSString>;
296}