Next Page > Hide TOC

IKFilterBrowserPanel Class Reference

Inherits from
Conforms to
Framework
System/Library/Frameworks/Quartz.framework/ImageKit.framework
Availability
Available in Mac OS X v10.5 and later.
Declared in
IKFilterBrowserPanel.h

Overview

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:

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/.

Tasks

Getting a Filter Name

Displaying and Running the Panel

Creating a Filter Browser Panel

Class Methods

filterBrowserPanelWithStyleMask:

Creates a shared instance of the IKFilterBrowserPanel class.

+ (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.

Availability
Declared In
IKFilterBrowserPanel.h

Instance Methods

beginSheetWithOptions:modalForWindow:modalDelegate:didEndSelector:contextInfo:

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.

- (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.

Availability
See Also
Declared In
IKFilterBrowserPanel.h

beginWithOptions:modelessDelegate:didEndSelector:contextInfo:

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

- (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.

Availability
See Also
Declared In
IKFilterBrowserPanel.h

filterBrowserViewWithOptions:

Returns a view that contains a filter browser.

- (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.

Availability
Declared In
IKFilterBrowserPanel.h

filterName

Returns the name of the filter that is currently selected in the filter browser.

- (NSString*)filterName;

Return Value

The name of the currently selected filter.

Discussion

Use this method in response to the notifications IKFilterBrowserFilterSelectedNotification or IKFilterBrowserFilterDoubleClickNotification, or after the user makes a choice in a dialog.

Availability
Declared In
IKFilterBrowserPanel.h

finish:

Closes a filter browser view.

- (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.

Availability
See Also
Declared In
IKFilterBrowserPanel.h

runModalWithOptions:

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

- (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.

Availability
See Also
Declared In
IKFilterBrowserPanel.h

Constants

Filter Browser Option Keys

Keys for filter browser options.

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.

Available in Mac OS X v10.5 and later.

Declared in IKFilterBrowserPanel.h.

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.

Available in Mac OS X v10.5 and later.

Declared in IKFilterBrowserPanel.h.

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.

Available in Mac OS X v10.5 and later.

Declared in IKFilterBrowserPanel.h.

IKFilterBrowserShowCategories

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

Available in Mac OS X v10.5 and later.

Declared in IKFilterBrowserPanel.h.

IKFilterBrowserShowPreview

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

Available in Mac OS X v10.5 and later.

Declared in IKFilterBrowserPanel.h.

Declared In
IKFilterBrowserPanel.h

Notifications

IKFilterBrowserWillPreviewFilterNotification

Posted before showing a filter preview, allowing an application to set the parameters of a filter.

The selected filter is sent as the object in the notification.

Availability
Declared In
IKFilterBrowserPanel.h

IKFilterBrowserFilterSelectedNotification

Posted when the user clicks a filter name in the filter browser.

The name of the selected filter is sent as the object in the notification.

Availability
Declared In
IKFilterBrowserPanel.h

IKFilterBrowserFilterDoubleClickNotification

Posted when the user double-clicks a filter in the filter browser.

The name of the selected filter is send as the object in the notification.

Availability
Declared In
IKFilterBrowserPanel.h

Next Page > Hide TOC


© 2007 Apple Inc. All Rights Reserved. (Last updated: 2007-10-31)


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.