IKImageBrowserCell Class Reference

Inherits from
Conforms to
Framework
/System/Library/Frameworks/Quartz.framework/ImageKit.framework
Availability
Available in OS X v10.6 and later.
Declared in
IKImageBrowserCell.h
Related sample code

Overview

The IKImageBrowserCell class is used to display a cell conforming to the IKImageBrowserItem Protocol protocol in an IKImageBrowserView.

Tasks

Cell Component Frames

Represented Item

Selection Handling

Cell Content Display

Getting The Cell State

Core Animation Integration

Getting The Parent Browser View

Instance Methods

cellState

Returns the current cell state of the receiver.

Return Value

The current state of the cell. See “IKImageBrowserCellState” for possible values.

Discussion

The IKImageBrowserView creates thumbnails asynchronously. This method returns the current state.

Availability
  • Available in OS X v10.6 and later.
Related Sample Code
Declared In
IKImageBrowserCell.h

frame

Returns the receiver’s frame rectangle, which defines its position in its IKImageBrowserView.

- (NSRect)frame
Return Value

The coordinates of the frame, in the IKImageBrowserView coordinate space.

Discussion

Subclasses should not override this method.

Availability
  • Available in OS X v10.6 and later.
Declared In
IKImageBrowserCell.h

imageAlignment

Returns the position of the cell’s image in the frame.

- (NSImageAlignment)imageAlignment
Return Value

The alignment of the image. See NSImageAlignment for possible values.

Discussion

Subclasses can override this method to customize the image alignment.

The image frame will be computed automatically from the image container frame by taking in account the image alignment and the image aspect ratio.

Availability
  • Available in OS X v10.6 and later.
Declared In
IKImageBrowserCell.h

imageBrowserView

Returns the view the receiver uses to display the cell.

- (IKImageBrowserView *)imageBrowserView
Return Value

The browser view containing the cell.

Discussion

Subclasses should not override this method.

Availability
  • Available in OS X v10.6 and later.
Declared In
IKImageBrowserCell.h

imageContainerFrame

Returns the receiver’s image container frame rectangle, which defines the position of the container of the thumbnail.

- (NSRect)imageContainerFrame
Return Value

The coordinates of image container frame, in the IKImageBrowserView coordinate space.

Discussion

The image frame is computed automatically from the image container frame by taking in account the image alignment and the image aspect ratio.

Subclasses can override this method to customize the position of the thumbnail container.

Availability
  • Available in OS X v10.6 and later.
Related Sample Code
Declared In
IKImageBrowserCell.h

imageFrame

Returns the receiver’s image frame rectangle, which defines the position of the thumbnail in its IKImageBrowserView.

- (NSRect)imageFrame
Return Value

The coordinates of the frame, in the IKImageBrowserView coordinate space.

Discussion

It is the developer’s responsibility to compute the imageFrame such that it lies entirely within the cell’s frame rectangle.

Subclasses can override this method to customize the position of the thumbnail.

Availability
  • Available in OS X v10.6 and later.
Related Sample Code
Declared In
IKImageBrowserCell.h

indexOfRepresentedItem

Returns the index of the receiver’s represented object in the datasource.

- (NSUInteger)indexOfRepresentedItem
Return Value

The index of the represented object in the datasource.

Discussion

Subclasses should not override this method.

Availability
  • Available in OS X v10.6 and later.
Declared In
IKImageBrowserCell.h

isSelected

Returns whether the cell is selected.

- (BOOL)isSelected
Return Value

YES if the cell is selected, otherwise NO.

Discussion

Subclasses should not override this method.

Availability
  • Available in OS X v10.6 and later.
Declared In
IKImageBrowserCell.h

layerForType:

Returns a layer for the specified position.

- (CALayer *)layerForType:(NSString *)type
Parameters
type

A string representing the layer location. See “Cell Layer Positions” for possible values.

Return Value

The CALayer to display in the specified position.

Discussion

Subclasses can override this method to add a Core Animation layer to the cell

Availability
  • Available in OS X v10.6 and later.
Declared In
IKImageBrowserCell.h

opacity

Returns the opacity of the receiver.

- (CGFloat)opacity
Return Value

The cell’s opacity.

Discussion

Possible values are between 0.0 (transparent) and 1.0 (opaque).

Subclasses can override this method to customize the opacity of the cell.

Availability
  • Available in OS X v10.6 and later.
Declared In
IKImageBrowserCell.h

representedItem

Returns the receiver’s represented object.

- (id)representedItem
Return Value

The item represented by the cell.

Discussion

Subclasses should not override this method.

Availability
  • Available in OS X v10.6 and later.
Declared In
IKImageBrowserCell.h

selectionFrame

Returns the receiver’s selection frame rectangle, which defines the position of the selection rectangle in its IKImageBrowserView.

- (NSRect)selectionFrame
Return Value

The cells selection frame, in the IKImageBrowserView coordinate space.

Discussion

Subclasses can override this method to customize the position of the selection frame.

Availability
  • Available in OS X v10.6 and later.
Related Sample Code
Declared In
IKImageBrowserCell.h

subtitleFrame

Returns the receiver’s subtitle frame rectangle.

- (NSRect)subtitleFrame
Return Value

The coordinates of the subtitle frame, in the IKImageBrowserView coordinate space.

Discussion

It is the developer’s responsibility to compute the subtitleFrame such that it lies entirely within the cell’s frame rectangle.

Subclasses can override this method to customize the position of the subtitle.

Availability
  • Available in OS X v10.6 and later.
Declared In
IKImageBrowserCell.h

titleFrame

Returns the receiver’s title frame rectangle.

- (NSRect)titleFrame
Return Value

The coordinates of the title frame, in the IKImageBrowserView coordinate space.

Discussion

It is the developer’s responsibility to compute the titleFrame such that it lies entirely within the cell’s frame rectangle.

Subclasses can override this method to customize the position of the title.

Availability
  • Available in OS X v10.6 and later.
Related Sample Code
Declared In
IKImageBrowserCell.h

Constants

IKImageBrowserCellState

The possible states for the browser cell. These values are used by the cellState method.

typedef enum{
   IKImageStateNoImage=0,
   IKImageStateInvalid,
   IKImageStateReady,
} IKImageBrowserCellState;
Constants
IKImageStateNoImage

Returned until a thumbnail has been created from the represented object.

Available in OS X v10.6 and later.

Declared in IKImageBrowserCell.h.

IKImageStateInvalid

The thumbnail is invalid. For example, an unsupported image is provided.

Available in OS X v10.6 and later.

Declared in IKImageBrowserCell.h.

IKImageStateReady

The receiver’s represented object has been set and the cell is ready to display.

Available in OS X v10.6 and later.

Declared in IKImageBrowserCell.h.

Cell Layer Positions

Optional positioning of additional layers displayed with the cell. Used by the layerForType: method.

NSString *const IKImageBrowserCellBackgroundLayer;
NSString *const IKImageBrowserCellForegroundLayer;
NSString *const IKImageBrowserCellSelectionLayer;
NSString *const IKImageBrowserCellPlaceHolderLayer;
Constants
IKImageBrowserCellBackgroundLayer

Layer displayed in the background.

Available in OS X v10.6 and later.

Declared in IKImageBrowserCell.h.

IKImageBrowserCellForegroundLayer

Layer displayed in the foreground.

Available in OS X v10.6 and later.

Declared in IKImageBrowserCell.h.

IKImageBrowserCellSelectionLayer

Layer displayed as the selection.

Available in OS X v10.6 and later.

Declared in IKImageBrowserCell.h.

IKImageBrowserCellPlaceHolderLayer

Layer displayed as a placeholder when an image is not yet available.

Available in OS X v10.6 and later.

Declared in IKImageBrowserCell.h.