Next Page > Hide TOC

IKImageBrowserDataSource Protocol Reference

(informal protocol)

Adopted by
Framework
/System/Library/Frameworks/Quartz.framework/ImageKit.framework
Declared in
IKImageBrowserView.h

Overview

The IKImageBrowserDataSource informal protocol declares the methods that an instance of the IKImageBrowserView class uses to access the contents of its data source object.

Tasks

Providing Information About Items (Required)

Supporting Item Editing (Optional)

Providing Information About Groups (Optional)

Instance Methods

imageBrowser:groupAtIndex:

Returns the group at the specified index.

- (NSDictionary *) imageBrowser:(IKImageBrowserView *) aBrowser groupAtIndex:(NSUInteger) index;

Parameters
aBrowser

An image browser view.

index

The index of the group you want to retrieve.

Return Value

A dictionary that defines the group. The keys in this dictionary can be any of the following constants: IKImageBrowserGroupStyle, IKImageBrowserGroupBackgroundColorKey, IKImageBrowserGroupTitleKey, and IKImageBrowserGroupRangeKey. For more information on these constants, see IKImageBrowserView Class Reference.

Discussion

This method is optional.

Availability
Declared In
IKImageBrowserView.h

imageBrowser:itemAtIndex:

Returns an object for the item in an image browser view that corresponds to the specified index.

- (id) imageBrowser:(IKImageBrowserView *) aBrowser itemAtIndex:(NSUInteger)index;

Parameters
aBrowser

An image browser view.

index

The index of the item you want to retrieve.

Return Value

An IKImageBrowserItem object.

Discussion

Your data source must implement this method. The returned object must implement the required methods of the IKImageBrowserItem protocol.

Availability
Declared In
IKImageBrowserView.h

imageBrowser:moveItemsAtIndexes:toIndex:

Signals that the specified items should be moved to the specified destination.

- (BOOL) imageBrowser:(IKImageBrowserView *) aBrowser moveItemsAtIndexes: (NSIndexSet *)indexes toIndex:(NSUInteger)destinationIndex;

Parameters
aBrowser

An image browser view.

indexes

The indexes of the items that should be reordered.

destinationIndex

The starting index of the destination the items should be moved to.

Return Value

YES if successful; NO otherwise.

Discussion

This method is optional. It is invoked by the image browser view after Image Kit determines that a reordering operation should be applied. The data source should update itself by reordering its elements.

Availability
See Also
Declared In
IKImageBrowserView.h

imageBrowser:removeItemsAtIndexes:

Signals that a remove operation should be applied to the specified items.

- (void) imageBrowser:(IKImageBrowserView *) aBrowser removeItemsAtIndexes:(NSIndexSet *) indexes;

Parameters
aBrowser

An image browser view.

indexes

The indexes of the items that should be removed.

Discussion

This method is optional. It is invoked by the image browser after Image Kit determines that a remove operation should be applied. In response, the data source should update itself by removing the specified items.

Availability
Declared In
IKImageBrowserView.h

imageBrowser:writeItemsAtIndexes:toPasteboard:

Signals that a drag should begin.

- (NSUInteger) imageBrowser:(IKImageBrowserView *) aBrowser writeItemsAtIndexes:(NSIndexSet *) itemIndexes toPasteboard:(NSPasteboard *)pasteboard;

Parameters
aBrowser

An image browser view.

itemIndexes

The indexes of the items that should be dragged.

pasteboard

The pasteboard to copy the items to.

Return Value

The number of items written to the pasteboard.

Discussion

This method is optional. It is invoked after Image Kit determines that a drag should begin, but before the drag has been started.

Availability
Declared In
IKImageBrowserView.h

numberOfGroupsInImageBrowser:

Returns the number of groups in an image browser view.

- (NSUInteger) numberOfGroupsInImageBrowser:(IKImageBrowserView *) aBrowser;

Parameters
aBrowser

An image browser view.

Return Value

The number of groups.

Discussion

This method is optional.

Availability
Declared In
IKImageBrowserView.h

numberOfItemsInImageBrowser:

Returns the number of records managed by the data source object.

- (NSUInteger) numberOfItemsInImageBrowser:(IKImageBrowserView *) aBrowser;

Parameters
aBrowser

An image browser view.

Return Value

The number of records managed by the image browser view.

Discussion

Your data source must implement this method. An IKImageView object uses this method to determine how many cells it should create and display.

Availability
Declared In
IKImageBrowserView.h

Next Page > Hide TOC


© 2007 Apple Inc. All Rights Reserved. (Last updated: 2007-07-17)


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.