//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_app_kit::*;
use objc2_foundation::*;
use crate::*;
extern_class!(
/// The IKFilterBrowserPanel provides the shared IKFilterBrowser with its runtime model.
///
/// See information in the introduction.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/quartz/ikfilterbrowserpanel?language=objc)
#[unsafe(super(NSPanel, NSWindow, NSResponder, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct IKFilterBrowserPanel;
);
extern_conformance!(
unsafe impl NSAccessibility for IKFilterBrowserPanel {}
);
extern_conformance!(
unsafe impl NSAccessibilityElementProtocol for IKFilterBrowserPanel {}
);
extern_conformance!(
unsafe impl NSAnimatablePropertyContainer for IKFilterBrowserPanel {}
);
extern_conformance!(
unsafe impl NSAppearanceCustomization for IKFilterBrowserPanel {}
);
extern_conformance!(
unsafe impl NSCoding for IKFilterBrowserPanel {}
);
extern_conformance!(
unsafe impl NSMenuItemValidation for IKFilterBrowserPanel {}
);
extern_conformance!(
unsafe impl NSObjectProtocol for IKFilterBrowserPanel {}
);
extern_conformance!(
unsafe impl NSUserInterfaceItemIdentification for IKFilterBrowserPanel {}
);
extern_conformance!(
unsafe impl NSUserInterfaceValidations for IKFilterBrowserPanel {}
);
impl IKFilterBrowserPanel {
extern_methods!(
/// Create a shared instance of the IKFilterBrowser
///
/// 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.
#[unsafe(method(filterBrowserPanelWithStyleMask:))]
#[unsafe(method_family = none)]
pub unsafe fn filterBrowserPanelWithStyleMask(
style_mask: c_uint,
mtm: MainThreadMarker,
) -> Option<Retained<AnyObject>>;
/// Returns the name of the currently selected filter.
///
/// Use this method in response to a IKFilterBrowserFilterSelectedNotification or IKFilterBrowserFilterDoubleClickNotification or afer returning from a modal session.
#[unsafe(method(filterName))]
#[unsafe(method_family = none)]
pub unsafe fn filterName(&self) -> Option<Retained<NSString>>;
);
}
/// Methods declared on superclass `NSWindow`.
impl IKFilterBrowserPanel {
extern_methods!(
#[unsafe(method(initWithContentRect:styleMask:backing:defer:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithContentRect_styleMask_backing_defer(
this: Allocated<Self>,
content_rect: NSRect,
style: NSWindowStyleMask,
backing_store_type: NSBackingStoreType,
flag: bool,
) -> Retained<Self>;
#[unsafe(method(initWithContentRect:styleMask:backing:defer:screen:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithContentRect_styleMask_backing_defer_screen(
this: Allocated<Self>,
content_rect: NSRect,
style: NSWindowStyleMask,
backing_store_type: NSBackingStoreType,
flag: bool,
screen: Option<&NSScreen>,
) -> Retained<Self>;
/// # Safety
///
/// `coder` possibly has further requirements.
#[unsafe(method(initWithCoder:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Retained<Self>;
/// 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].
#[unsafe(method(windowWithContentViewController:))]
#[unsafe(method_family = none)]
pub unsafe fn windowWithContentViewController(
content_view_controller: &NSViewController,
) -> Retained<Self>;
);
}
/// Methods declared on superclass `NSResponder`.
impl IKFilterBrowserPanel {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
);
}
/// Methods declared on superclass `NSObject`.
impl IKFilterBrowserPanel {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
);
}
/// IKFilterBrowserPanelRuntime.
///
/// Use the methods in the IKFilterBrowserPanelRuntime to display and run the IKFilterBrowser.
///
/// 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.
impl IKFilterBrowserPanel {
extern_methods!(
/// Displays the FilterBrowser in a new window unless it is already open.
///
/// 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.
/// didEndSelector should have the following signature:
///
/// - (void)openPanelDidEnd:(NSOpenPanel *)panel returnCode:(int)returnCode contextInfo:(void *)contextInfo
///
/// The value passed as returnCode will be either NSCancelButton or NSOKButton.
///
/// Parameter `inOptions`: A dictionary describing the desired UI configuration for the IKFilterBrowser
///
/// Parameter `modelessDelegate`: See discussion below
///
/// Parameter `didEndSelector`: See discussion below
///
/// Parameter `contextInfo`: See discussion below
///
/// # Safety
///
/// - `in_options` generic should be of the correct type.
/// - `in_options` might not allow `None`.
/// - `modeless_delegate` should be of the correct type.
/// - `modeless_delegate` might not allow `None`.
/// - `did_end_selector` must be a valid selector.
/// - `context_info` must be a valid pointer.
#[unsafe(method(beginWithOptions:modelessDelegate:didEndSelector:contextInfo:))]
#[unsafe(method_family = none)]
pub unsafe fn beginWithOptions_modelessDelegate_didEndSelector_contextInfo(
&self,
in_options: Option<&NSDictionary>,
modeless_delegate: Option<&AnyObject>,
did_end_selector: Option<Sel>,
context_info: *mut c_void,
);
/// Displays the FilterBrowser in a sheet attached to the passed in window.
///
/// 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.
/// didEndSelector should have the following signature:
///
/// - (void)openPanelDidEnd:(NSOpenPanel *)panel returnCode:(int)returnCode contextInfo:(void *)contextInfo
///
/// The value passed as returnCode will be either NSCancelButton or NSOKButton.
///
/// Parameter `inOptions`: A dictionary describing the desired UI configuration for the IKFilterBrowser
///
/// Parameter `modalForWindow`: The window to which the sheet should be attached to.
///
/// Parameter `modalDelegate`: See discussion below
///
/// Parameter `didEndSelector`: See discussion below
///
/// Parameter `contextInfo`: See discussion below
///
/// # Safety
///
/// - `in_options` generic should be of the correct type.
/// - `in_options` might not allow `None`.
/// - `doc_window` might not allow `None`.
/// - `modal_delegate` should be of the correct type.
/// - `modal_delegate` might not allow `None`.
/// - `did_end_selector` must be a valid selector.
/// - `context_info` must be a valid pointer.
#[unsafe(method(beginSheetWithOptions:modalForWindow:modalDelegate:didEndSelector:contextInfo:))]
#[unsafe(method_family = none)]
pub unsafe fn beginSheetWithOptions_modalForWindow_modalDelegate_didEndSelector_contextInfo(
&self,
in_options: Option<&NSDictionary>,
doc_window: Option<&NSWindow>,
modal_delegate: Option<&AnyObject>,
did_end_selector: Option<Sel>,
context_info: *mut c_void,
);
/// Displays the FilterBrowser in a modal dialog.
///
/// Use this method to run the IKFilterBrowser in a modal dialog. The value passed as returnCode will be either NSCancelButton or NSOKButton.
///
/// Parameter `inOptions`: A dictionary describing the desired UI configuration for the IKFilterBrowser
///
/// # Safety
///
/// - `in_options` generic should be of the correct type.
/// - `in_options` might not allow `None`.
#[unsafe(method(runModalWithOptions:))]
#[unsafe(method_family = none)]
pub unsafe fn runModalWithOptions(&self, in_options: Option<&NSDictionary>) -> c_int;
#[cfg(feature = "IKFilterBrowserView")]
/// Returns a view containing the FilterBrowser.
///
/// Use this method to run the IKFilterBrowser in your own UI. To dismiss it, invoke the finish action as described below.
///
/// Parameter `inOptions`: A dictionary describing the desired UI configuration for the IKFilterBrowser
///
/// # Safety
///
/// - `in_options` generic should be of the correct type.
/// - `in_options` might not allow `None`.
#[unsafe(method(filterBrowserViewWithOptions:))]
#[unsafe(method_family = none)]
pub unsafe fn filterBrowserViewWithOptions(
&self,
in_options: Option<&NSDictionary>,
) -> Option<Retained<IKFilterBrowserView>>;
/// Closes the IKFilterBrowser.
///
/// Invoke this action for instance from your OK or Cancel button when you are running the IKFilterBrowserView modal in your own UI.
///
/// # Safety
///
/// - `sender` should be of the correct type.
/// - `sender` might not allow `None`.
#[unsafe(method(finish:))]
#[unsafe(method_family = none)]
pub unsafe fn finish(&self, sender: Option<&AnyObject>);
);
}
extern "C" {
/// IKFilterBrowserFilterSelectedNotification
///
/// 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
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/quartz/ikfilterbrowserfilterselectednotification?language=objc)
pub static IKFilterBrowserFilterSelectedNotification: Option<&'static NSString>;
}
extern "C" {
/// IKFilterBrowserFilterDoubleClickNotification
///
/// 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
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/quartz/ikfilterbrowserfilterdoubleclicknotification?language=objc)
pub static IKFilterBrowserFilterDoubleClickNotification: Option<&'static NSString>;
}
extern "C" {
/// IKFilterBrowserWillPreviewFilterNotification
///
/// 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
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/quartz/ikfilterbrowserwillpreviewfilternotification?language=objc)
pub static IKFilterBrowserWillPreviewFilterNotification: Option<&'static NSString>;
}
extern "C" {
/// IKFilterBrowserShowCategories
///
/// BOOL - Determines if the filter browser should show the category list
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/quartz/ikfilterbrowsershowcategories?language=objc)
pub static IKFilterBrowserShowCategories: Option<&'static NSString>;
}
extern "C" {
/// IKFilterBrowserShowPreview
///
/// BOOL - Determines if the filter browser should show the preview well
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/quartz/ikfilterbrowsershowpreview?language=objc)
pub static IKFilterBrowserShowPreview: Option<&'static NSString>;
}
extern "C" {
/// IKFilterBrowserExcludeCategories
///
/// NSArray - The categories in this array will not be displayed in the browser
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/quartz/ikfilterbrowserexcludecategories?language=objc)
pub static IKFilterBrowserExcludeCategories: Option<&'static NSString>;
}
extern "C" {
/// IKFilterBrowserExcludeFilters
///
/// NSArray - The filters in this array will not be displayed in the browser
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/quartz/ikfilterbrowserexcludefilters?language=objc)
pub static IKFilterBrowserExcludeFilters: Option<&'static NSString>;
}
extern "C" {
/// IKFilterBrowserDefaultInputImage - Allows you to set a custom image to be used as the inputImage for the filter preview.
///
/// 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.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/quartz/ikfilterbrowserdefaultinputimage?language=objc)
pub static IKFilterBrowserDefaultInputImage: Option<&'static NSString>;
}