Mac Developer Library

Developer

IKImageBrowserDataSource Protocol Reference

Options
Deployment Target:

On This Page
Language:

IKImageBrowserDataSource

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

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

    Declaration

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

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

    Declaration

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

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

    Declaration

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

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

    Declaration

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

    YEStrue if successful; NOfalse 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.

  • Signals that a drag should begin.

    Declaration

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