Mac Developer Library

Developer

IKFilterBrowserPanel Class Reference

Options
Deployment Target:

On This Page

IKFilterBrowserPanel

The IKFilterBrowserPanel class provides a user interface that allows users to browse Core Image filters (CIFilter), to preview a filter, and to get additional information about the filter, such as its description.

An IKFilterBrowserPanel object can be displayed as:

  • a separate panel, that is, a utility window that floats on top of document windows

  • a modal dialog

  • a sheet, that is, a dialog that is attached to its parent window and must be dismissed by the user

  • a view that an application can insert into a custom user interface

An IKFilterBrowserPanel object can be configured through a style mask to use either the default or brushed metal look for windows. The size and number of visible controls are specified through an options dictionary. An IKFilterBrowserPanel object communicates selection changes through notifications.

The IKFilterBrowserPanel class allows the user to create filter collections that are stored with the filterCollections key in the com.apple.CoreImageKit.plist property list located in ~/Library/Preferences/.

  • Returns a view that contains a filter browser.

    Declaration

    - (IKFilterBrowserView*)filterBrowserViewWithOptions:(NSDictionary*)inOptions;

    Parameters

    inOptions

    A dictionary of options that describe the configuration to use for the filter browser user interface. For the possible keys you can supply see “Filter Browser Option Keys” and the constant IKUISizeFlavor.

    Return Value

    A filter browser view that is configured as specified.

    Discussion

    Use this method to add a view that contains the filter browser to your custom user interface. To dismiss the filter browser view, invoke the finish method.

  • Displays the filter browser in a new utility window, unless the filter browser is already open.

    Declaration

    - (void)beginWithOptions:(NSDictionary*)inOptions modelessDelegate:(id)modelessDelegate didEndSelector:(SEL)didEndSelector contextInfo:(void *)contextInfo;

    Parameters

    inOptions

    A dictionary of options that describe the configuration to use for the filter browser user interface. For the possible keys you can supply see “Filter Browser Option Keys” and the constant IKUISizeFlavor.

    modelessDelegate

    The object that will invoke the selector didEndSelector when the filter browser session terminates.

    didEndSelector

    The selector to invoke when the filter browser session terminates.

    contextInfo

    Any data that must be passed as an argument to the delegate through didEndSelector after the filter browser session terminates.

    Discussion

    When the filter browser session ends, didEndSelector is invoked on the modeless delegate, passing contextInfo as an argument. The selector didEndSelector must have the following signature:

    - (void)openPanelDidEnd:(NSOpenPanel *)panel returnCode:(int)returnCode contextInfo:(void *)contextInfo

    The returnCode value passed to the selector is set to NSOKButton if the user validates, or to NSCancelButton if the user cancels.

  • Displays the filter browser in a sheet—that is, a dialog that is attached to its parent window and must be dismissed by the user.

    Declaration

    - (void)beginSheetWithOptions:(NSDictionary*)inOptions modalForWindow:(NSWindow *)docWindow modalDelegate:(id)modalDelegate didEndSelector:(SEL)didEndSelector contextInfo:(void *)contextInfo;

    Parameters

    inOptions

    A dictionary of options that describe the configuration to use for the filter browser user interface. For the possible keys you can supply see “Filter Browser Option Keys” and the constant IKUISizeFlavor.

    modalForWindow

    The parent window for the dialog.

    modalDelegate

    The object that will invoke the selector didEndSelector when the filter browser session terminates.

    didEndSelector

    The selector to invoke when the filter browser session terminates.

    contextInfo

    Any data that must be passed as an argument to the delegate through didEndSelector after the filter browser session terminates.

    Discussion

    When the filter browser session ends, didEndSelector is invoked on the modeless delegate, passing contextInfo as an argument. The selector didEndSelector must have the following signature:

    - (void)openPanelDidEnd:(NSOpenPanel *)panel returnCode:(int)returnCode contextInfo:(void *)contextInfo

    The returnCode value passed to the selector is set to NSOKButton if the user validates, or to NSCancelButton if the user cancels.

  • Displays the filter browser in a modal dialog that must be dismissed by the user but that is not attached to a window.

    Declaration

    - (int)runModalWithOptions:(NSDictionary*)inOptions;

    Parameters

    inOptions

    A dictionary of options that describe the configuration to use for the filter browser user interface. For the possible keys you can supply see “Filter Browser Option Keys” and the constant IKUISizeFlavor.

    Return Value

    Either NSOKButton if the user validates, or NSCancelButton if the user cancels.

  • Closes a filter browser view.

    Declaration

    - (void)finish:(id)sender;

    Parameters

    sender

    The object that invokes the action, such as an OK or Cancel button.

    Discussion

    Invoke this action when you want to dismiss the filter browser.

  • Creates a shared instance of the IKFilterBrowserPanel class.

    Declaration

    + (id)filterBrowserPanelWithStyleMask:(unsigned int)styleMask;

    Parameters

    styleMask

    A mask that specifies whether to use the default or brushed metal look for the window. You can select or deselect the NSTexturedBackgroundWindowMask style bit.

    Return Value

    The shared instance.

  • Keys for filter browser options.

    Declaration

    NSString *const IKFilterBrowserDefaultInputImage; NSString *const IKFilterBrowserExcludeCategories; NSString *const IKFilterBrowserExcludeFilters; NSString *const IKFilterBrowserShowCategories; NSString *const IKFilterBrowserShowPreview;

    Constants

    • IKFilterBrowserDefaultInputImage

      The key for the default input image. The associated value is the CIImage object to use as the default input image for the filter preview. Setting the image to nil causes Image Kit to use the image supplied by the framework. You can also set the input image and other parameters during the notification IKFilterBrowserWillPreviewFilterNotification.

    • IKFilterBrowserExcludeCategories

      The key for excluding filter categories. The associated value is an NSArray object that lists the categories that you do not want to display in the filter browser.

    • IKFilterBrowserExcludeFilters

      The key for excluding filters. The associated value is an NSArray object that lists the filters that you do not want to display in the filter browser.

    • IKFilterBrowserShowCategories

      The key for showing categories. The associated value is a BOOL value that determines if the filter browser should show the category list.

    • IKFilterBrowserShowPreview

      The associated value is a BOOL value that determines if the filter browser should provide a preview.