IKImageBrowserView Class Reference
| Inherits from | |
| Conforms to | |
| Framework | /System/Library/Frameworks/Quartz.framework/ImageKit.framework |
| Availability | Available in OS X v10.5 and later. |
| Declared in | IKImageBrowserView.h |
Overview
The IKImageBrowserView class is a view for displaying and browsing a large amount of images and movies efficiently.
You must set a datasource for the view and implement, at a minimum, the numberOfItemsInImageBrowser: and imageBrowser:itemAtIndex: described in IKImageBrowserDataSource Protocol Reference. The items must conform to the IKImageBrowserItem Protocol protocol.
The class’s delegate object must conform to IKImageBrowserDelegate Protocol protocol. It receives notification of changes in selection, as well as mouse events in the cells.
Tasks
Initializing and Setting Up an Image Browser View
Updating the Display of the Content
Getting and Setting the Delegate
Getting and Setting the Data Source
Setting the Appearance
-
– setCellsStyleMask: -
– cellsStyleMask -
– setConstrainsToOriginalSize: -
– constrainsToOriginalSize -
– setIntercellSpacing: -
– intercellSpacing
Creating a Custom Cell for an Item
Zooming and Resizing
Scrolling
Setting and Getting Cell Size
Getting Item Information
Reordering and Groups Items
-
– selectionIndexes -
– setSelectionIndexes:byExtendingSelection: -
– setAllowsMultipleSelection: -
– allowsMultipleSelection -
– setAllowsEmptySelection: -
– allowsEmptySelection -
– setAllowsReordering: -
– allowsReordering -
– setAnimates: -
– animates -
– expandGroupAtIndex: -
– collapseGroupAtIndex: -
– isGroupExpandedAtIndex:
Supporting Drag and Drop
-
– setDraggingDestinationDelegate: -
– draggingDestinationDelegate -
– setDropIndex:dropOperation: -
– indexAtLocationOfDroppedItem -
– setAllowsDroppingOnItems: -
– allowsDroppingOnItems -
– dropOperation
Core Animation Layer Integration
QuickLook Support
Getting Columns and Rows Information
Instance Methods
allowsDroppingOnItems
Returns whether the user can drop on items.
Return Value
YES if the user is able to drop on items, otherwise NO.
Discussion
The default is NO.
Availability
- Available in OS X v10.6 and later.
Declared In
IKImageBrowserView.hallowsEmptySelection
Returns whether an empty selection is allowed.
Return Value
YES if the receiver allows an empty selection; NO otherwise.
Availability
- Available in OS X v10.5 and later.
See Also
Declared In
IKImageBrowserView.hallowsMultipleSelection
Returns whether multiple selections are allowed.
Return Value
YES if the receiver allows the user to select more than one cell at a time; NO otherwise.
Availability
- Available in OS X v10.5 and later.
See Also
Declared In
IKImageBrowserView.hallowsReordering
Returns whether the user can reorder items.
Return Value
YES if the user can reorder items; NO otherwise.
Availability
- Available in OS X v10.5 and later.
See Also
Declared In
IKImageBrowserView.hanimates
Returns whether the receiver animates reordering and changes of the data source.
Return Value
YES if the receiver animates reordering and changes of the data source; NO otherwise.
Availability
- Available in OS X v10.5 and later.
See Also
Declared In
IKImageBrowserView.hbackgroundLayer
Returns the foreground Core Animation layer
Return Value
A CALayer instance.
Availability
- Available in OS X v10.6 and later.
See Also
Declared In
IKImageBrowserView.hcanControlQuickLookPanel
Returns whether the view can automatically take control of the QuickLook panel.
Return Value
YES, if the view can display the Quick Look panel, otherwise NO.
Availability
- Available in OS X v10.6 and later.
See Also
Declared In
IKImageBrowserView.hcellForItemAtIndex:
Returns the browser cell for the item at the specified index.
Parameters
- index
The index.
Return Value
The browser cell at the specified index.
Discussion
Subclasses must not override this method.
Availability
- Available in OS X v10.6 and later.
Declared In
IKImageBrowserView.hcellSize
Returns the cell size.
Return Value
The current size for the cells in the image browser view.
Availability
- Available in OS X v10.5 and later.
See Also
Declared In
IKImageBrowserView.hcellsStyleMask
Returns the appearance style mask for the cell.
Return Value
The appearance style mask for the cell.
Availability
- Available in OS X v10.5 and later.
See Also
Declared In
IKImageBrowserView.hcollapseGroupAtIndex:
Collapses a group at the specified index.
Parameters
- index
The index of the group you want to collapse.
Availability
- Available in OS X v10.5 and later.
Declared In
IKImageBrowserView.hcolumnIndexesInRect:
Returns the column indexes in the specified rectangle.
Parameters
- rect
The rectangle in the view’s coordinate system.
Return Value
An index set containing the cell indexes.
Availability
- Available in OS X v10.6 and later.
Declared In
IKImageBrowserView.hconstrainsToOriginalSize
Returns whether the receiver constrains the cell's image to its original size.
Return Value
NO if the image is not constrained; otherwise YES.
Availability
- Available in OS X v10.5 and later.
See Also
Declared In
IKImageBrowserView.hcontentResizingMask
Returns the receiver’s content resizing mask, which determines how its content is resized while zooming.
Return Value
The content resizing mask.
Availability
- Available in OS X v10.5 and later.
See Also
Declared In
IKImageBrowserView.hdataSource
Returns the data source of the receiver.
Return Value
The data source (IKImageBrowserDataSource). The data source is not retained by the receiver.
Availability
- Available in OS X v10.5 and later.
See Also
Declared In
IKImageBrowserView.hdelegate
Returns the delegate of the receiver.
Return Value
The delegate.
Availability
- Available in OS X v10.5 and later.
See Also
Declared In
IKImageBrowserView.hdraggingDestinationDelegate
Returns the dragging destination delegate of the receiver.
Return Value
The receiver's dragging destination delegate.
Availability
- Available in OS X v10.5 and later.
See Also
Declared In
IKImageBrowserView.hdropOperation
Returns the current drop operation.
Return Value
IKImageBrowserDropOn if the drop occurs on an item, otherwise IKImageBrowserDropBefore.
Discussion
The returned value is valid when a drop occurred and until next drop.
For example, given a browser with N cells , a cell of N-1 and operation of IKImageBrowserDropOn would specify a drop on the last cell. To specify a drop after the last cell, one would use an index of N and IKImageBrowserDropBefore for the operation.
Availability
- Available in OS X v10.6 and later.
Declared In
IKImageBrowserView.hexpandGroupAtIndex:
Expands a group at the specified index.
Parameters
- index
The index of the group you want to expand.
Availability
- Available in OS X v10.5 and later.
Declared In
IKImageBrowserView.hforegroundLayer
Returns the foreground Core Animation layer
Return Value
A CALayer instance.
Availability
- Available in OS X v10.6 and later.
See Also
Declared In
IKImageBrowserView.hindexAtLocationOfDroppedItem
Returns the index of the cell where the drop operation occurred.
Return Value
The index of the cell where the drop operation occurred.
Discussion
The returned index is valid until the next drop occurs.
Availability
- Available in OS X v10.5 and later.
Declared In
IKImageBrowserView.hindexOfItemAtPoint:
Returns the index of the item at the specified location.
Parameters
- point
The location of the item.
Return Value
The index of the item or NSNotFound if no item at this location.
Availability
- Available in OS X v10.5 and later.
Declared In
IKImageBrowserView.hinitWithFrame:
Initializes a newly allocated image browser view with the provided frame rectangle.
Parameters
- frame
The rectangle for the image browser.
Return Value
The initialized object.
Availability
- Available in OS X v10.5 and later.
Declared In
IKImageBrowserView.hintercellSpacing
Returns the spacing between cells in the view.
Return Value
The vertical and horizontal spacing between cells.
Availability
- Available in OS X v10.6 and later.
Declared In
IKImageBrowserView.hisGroupExpandedAtIndex:
Returns whether the group at the provided index is expanded.
Parameters
- index
The index you want to check.
Return Value
YES if the group is expanded; NO otherwise.
Availability
- Available in OS X v10.5 and later.
Declared In
IKImageBrowserView.hitemFrameAtIndex:
Returns the frame rectangle for the item located at the specified index.
Parameters
- index
The index of the item whose frame rectangle you want to obtain.
Return Value
The frame rectangle of the item.
Availability
- Available in OS X v10.5 and later.
Declared In
IKImageBrowserView.hnewCellForRepresentedItem:
Returns the cell to use for the specified item.
Parameters
- anItem
The item that the returned cell will represent.
Return Value
A new cell.
Discussion
Subclasses can override this method to customize the appearance of the cell that will represent anItem.
Availability
- Available in OS X v10.6 and later.
Declared In
IKImageBrowserView.hnumberOfColumns
Returns the current number of columns.
Return Value
The number of columns.
Availability
- Available in OS X v10.6 and later.
Declared In
IKImageBrowserView.hnumberOfRows
Returns the current number of rows.
Return Value
The number of rows.
Availability
- Available in OS X v10.6 and later.
Declared In
IKImageBrowserView.hrectOfColumn:
Returns the rectangle containing the specified column.
Parameters
- columnIndex
The column index.
Return Value
A rectangle containing the column. Specified in the view’s coordinate system.
Availability
- Available in OS X v10.6 and later.
Declared In
IKImageBrowserView.hrectOfRow:
Returns the rectangle containing the specified row.
Parameters
- rowIndex
The row index.
Return Value
A rectangle containing the column. Specified in the view’s coordinate system.
Availability
- Available in OS X v10.6 and later.
Declared In
IKImageBrowserView.hreloadData
Marks the receiver as needing its data reloaded.
Availability
- Available in OS X v10.5 and later.
Declared In
IKImageBrowserView.hrowIndexesInRect:
Returns the row indexes in the specified rectangle.
Parameters
- rect
A rectangle in the view’s coordinate system.
Return Value
An index set containing the item indexes.
Availability
- Available in OS X v10.6 and later.
Declared In
IKImageBrowserView.hscrollIndexToVisible:
Scrolls the receiver to the item at the specified index.
Parameters
- index
The index of the item to scroll to.
Availability
- Available in OS X v10.5 and later.
Declared In
IKImageBrowserView.hselectionIndexes
Returns the indexes of the selected cells.
Return Value
The indexes of the selected cells.
Availability
- Available in OS X v10.5 and later.
Declared In
IKImageBrowserView.hsetAllowsDroppingOnItems:
Specifies whether the user can drop on items.
Parameters
- flag
YESif the user is able to drop on items, otherwiseNO.
Discussion
The default is NO.
Availability
- Available in OS X v10.6 and later.
Declared In
IKImageBrowserView.hsetAllowsEmptySelection:
Controls whether an empty selection is allowed.
Parameters
- flag
A
BOOLvalue that specifies whether to allow an empty selection.
Availability
- Available in OS X v10.5 and later.
See Also
Declared In
IKImageBrowserView.hsetAllowsMultipleSelection:
Controls whether the user can select more than one cell at a time.
Parameters
- flag
A
BOOLvalue that specifies whether to allow multiple selections.
Availability
- Available in OS X v10.5 and later.
See Also
Declared In
IKImageBrowserView.hsetAllowsReordering:
Controls whether the user can reorder items.
Parameters
- flag
A
BOOLvalue that specifies whether the user can reorder items.
Availability
- Available in OS X v10.5 and later.
See Also
Declared In
IKImageBrowserView.hsetAnimates:
Controls whether the receiver animates reordering and changes of the data source.
Parameters
- flag
A
BOOLvalue that specifies whether the receiver animates reordering and changes of the data source.
Availability
- Available in OS X v10.5 and later.
See Also
Declared In
IKImageBrowserView.hsetBackgroundLayer:
The Core Animation layer used as the view’s background.
Parameters
- aLayer
A
CALayerinstance.
Discussion
The background layer can have sublayers. Additionally, the layers can also contain animations.
The layer is optional.
Availability
- Available in OS X v10.6 and later.
See Also
Declared In
IKImageBrowserView.hsetCanControlQuickLookPanel:
Specifies whether the view can automatically take control of the QuickLook panel.
Parameters
- flag
YES, if the view can display the QuickLook panel, otherwiseNO.
Discussion
When the browser view displays the QuickLook panel it sets itself as the QuickLook datasource. If the browser cells returned by the datasource return items that are URLs or paths, then the QuickLook panel will display the image at that location. Otherwise, the browser cell must implement the QLPreviewItem protocol and return the requested URL for the custom cell.
Availability
- Available in OS X v10.6 and later.
See Also
Declared In
IKImageBrowserView.hsetCellSize:
Sets the cell size.
Parameters
- size
The size to set.
Discussion
You must use setCellSize or setZoomValue:, but not both. Setting the zoom value changes the cell size, and vice versa.
Availability
- Available in OS X v10.5 and later.
See Also
Declared In
IKImageBrowserView.hsetCellsStyleMask:
Defines the appearance style of the cells.
Parameters
- mask
An integer bit mask. A mask can be specified by combining any of the options described in
“Cell Appearance Style Masks”using the C bitwiseORoperator.
Availability
- Available in OS X v10.5 and later.
See Also
Declared In
IKImageBrowserView.hsetConstrainsToOriginalSize:
Sets whether the receiver constrains the cell’s image to its original size.
Parameters
- flag
A flag that specifies whether to constrain the image. The default value is
NO.
Availability
- Available in OS X v10.5 and later.
See Also
Declared In
IKImageBrowserView.hsetContentResizingMask:
Determines how the receiver resizes its content when zooming.
Parameters
- mask
A resizing mask. You specify a mask by combining any of the following options using the C bitwise
ORoperator:NSViewWidthSizable,NSViewHeightSizable. Other values are ignored.
Availability
- Available in OS X v10.5 and later.
See Also
Declared In
IKImageBrowserView.hsetDataSource:
Sets the data source of the receiver.
Parameters
- source
A data source (
IKImageBrowserDataSource).
Availability
- Available in OS X v10.5 and later.
See Also
Declared In
IKImageBrowserView.hsetDelegate:
Sets the delegate of the receiver.
Parameters
- aDelegate
The delegate must implement the
IKImageBrowserDelegateinformal protocol.
Availability
- Available in OS X v10.5 and later.
See Also
Declared In
IKImageBrowserView.hsetDraggingDestinationDelegate:
Sets the dragging destination delegate of the receiver.
Parameters
- delegate
The delegate (
NSDraggingDestination) to set.
Availability
- Available in OS X v10.5 and later.
See Also
Declared In
IKImageBrowserView.hsetDropIndex:dropOperation:
Allows the class to retarget the drop action.
Parameters
- index
The requested drop index.
- operation
The requested drop operation. The possible values are described in
IKImageBrowserDropOperation.
Discussion
For example, To specify a drop on the second item, one would specify index as 1, and operation as IKImageBrowserDropOn. To specify a drop after the last item, one would specify index as the number of items and operation as IKImageBrowserDropBefore.
Passing a value of –1 for index, and IKImageBrowserDropOn as the operation causes the entire browser view to be highlighted rather than a specific item. This is useful if the data displayed by the receiver does not allow the user to drop items at a specific item location
.
Availability
- Available in OS X v10.6 and later.
Declared In
IKImageBrowserView.hsetForegroundLayer:
The Core Animation layer used as the foreground overlay.
Parameters
- aLayer
A
CALayerinstance.
Discussion
The foreground overlay layer can have sublayers. Additionally, the layers can also contain animations.
The foreground layer is an overlay that is applied to the view. It can be used to provide information such as loading progress or for pure cosmetic purposes, such as dark gradients on top and bottom of the browser view.
This layer is optional.
Availability
- Available in OS X v10.6 and later.
See Also
Declared In
IKImageBrowserView.hsetIntercellSpacing:
Sets the spacing between cells in the view.
Parameters
- aSize
The vertical and horizontal spacing between cells.
Discussion
By default, both values are 10.0 in the receiver’s coordinate system.
Availability
- Available in OS X v10.6 and later.
Declared In
IKImageBrowserView.hsetSelectionIndexes:byExtendingSelection:
Selects cells at the specified indexes.
Parameters
- indexes
The indexes of the cells you want to select.
- extendSelection
A
BOOLvalue that specifies whether to extend the current selection. PassYESto extends the selection;NOreplaces the current selection.
Availability
- Available in OS X v10.5 and later.
See Also
Declared In
IKImageBrowserView.hsetZoomValue:
Sets the zoom value.
Parameters
- aValue
The zoom value. This value should be greater or equal to zero and less or equal than one. A zoom value of zero corresponds to the minimum size (40x40 pixels). A zoom value of one means images fits the browser bounds. Other values are interpolated.
Discussion
You must use setZoomValue or setCellSize:, but not both. Setting the zoom value changes the cell size, and vice versa.
Availability
- Available in OS X v10.5 and later.
See Also
Declared In
IKImageBrowserView.hvisibleItemIndexes
Returns the indexes of the view’s currently visible items.
Return Value
A set containing the indexes.
Availability
- Available in OS X v10.6 and later.
Declared In
IKImageBrowserView.hConstants
Cell Appearance Style Masks
Masks for the appearance style bit field.
enum{
IKCellsStyleNone =0,
IKCellsStyleShadowed =1,
IKCellsStyleOutlined =2,
IKCellsStyleTitled =4,
IKCellsStyleSubtitled =8
};
Constants
IKCellsStyleNoneNo style.
Available in OS X v10.5 and later.
Declared in
IKImageBrowserView.h.IKCellsStyleShadowedCells use shadows.
Available in OS X v10.5 and later.
Declared in
IKImageBrowserView.h.IKCellsStyleOutlinedCells are outlined.
Available in OS X v10.5 and later.
Declared in
IKImageBrowserView.h.IKCellsStyleTitledCells display a title.
Available in OS X v10.5 and later.
Declared in
IKImageBrowserView.h.IKCellsStyleSubtitledCells display a subtitle.
Available in OS X v10.5 and later.
Declared in
IKImageBrowserView.h.
Declared In
IKImageBrowserView.hGroup Style Attributes
Attributes for the group style. Used by the
enum{
IKGroupBezelStyle,
IKGroupDisclosureStyle,
};
Constants
IKGroupBezelStyleA bezel style.
Available in OS X v10.5 and later.
Declared in
IKImageBrowserView.h.IKGroupDisclosureStyleA disclosure triangle.
Available in OS X v10.5 and later.
Declared in
IKImageBrowserView.h.
Discussion
These constants affect the appearance of a group.
Declared In
IKImageBrowserView.hView Options Keys
Keys for image browser view options. You set and retrieve values for these keys by sending the view setValue:forKey and valueForKey: messages.
NSString * const IKImageBrowserBackgroundColorKey; NSString * const IKImageBrowserSelectionColorKey; NSString * const IKImageBrowserCellsOutlineColorKey; NSString * const IKImageBrowserCellsTitleAttributesKey; NSString * const IKImageBrowserCellsHighlightedTitleAttributesKey; NSString * const IKImageBrowserCellsSubtitleAttributesKey;
Constants
IKImageBrowserBackgroundColorKeyA key for the background color of the image browser view. The associated value is an
NSColorobject.Available in OS X v10.5 and later.
Declared in
IKImageBrowserView.h.IKImageBrowserSelectionColorKeyA key for the color that indicates a selection. The associated value is an
NSColorobject.Available in OS X v10.5 and later.
Declared in
IKImageBrowserView.h.IKImageBrowserCellsOutlineColorKeyA key for the outline color for an item in the image browser view. The associated value is an
NSColorobject.Available in OS X v10.5 and later.
Declared in
IKImageBrowserView.h.IKImageBrowserCellsTitleAttributesKeyA key for title attribute of an item in the image browser view. The associated value is an
NSDictionaryobject.Available in OS X v10.5 and later.
Declared in
IKImageBrowserView.h.IKImageBrowserCellsHighlightedTitleAttributesKeyA key for the highlighted title attribute for an item in the image browser view. The associated value is an
NSDictionaryobject.Available in OS X v10.5 and later.
Declared in
IKImageBrowserView.h.IKImageBrowserCellsSubtitleAttributesKeyA key for a subtitle attribute for an item in the image browser view. The associated value is an
NSDictionaryobject.Available in OS X v10.5 and later.
Declared in
IKImageBrowserView.h.
Discussion
Declared In
IKImageBrowserView.hGroup Keys
Keys for group attributes.
NSString * const IKImageBrowserGroupRangeKey; NSString * const IKImageBrowserGroupBackgroundColorKey; NSString * const IKImageBrowserGroupTitleKey; NSString * const IKImageBrowserGroupStyleKey; NSString * const IKImageBrowserGroupHeaderLayer; NSString * const IKImageBrowserGroupFooterLayer;
Constants
IKImageBrowserGroupRangeKeyA key for the range of a group. The associated value is an
NSValueobject. This is required if the view uses groupingAvailable in OS X v10.5 and later.
Declared in
IKImageBrowserView.h.IKImageBrowserGroupBackgroundColorKeyA key for the background color of a group. The associated value is an
NSColorobject. This color is used only for the bezel style.Available in OS X v10.5 and later.
Declared in
IKImageBrowserView.h.IKImageBrowserGroupTitleKeyA key for the title of a group. The associated value is an
NSStringobject. This string is used for the disclosure style only.Available in OS X v10.5 and later.
Declared in
IKImageBrowserView.h.IKImageBrowserGroupStyleKeyA key for the style of a group. The associated value is one of the constants defined in
“Group Style Attributes”.Available in OS X v10.5 and later.
Declared in
IKImageBrowserView.h.IKImageBrowserGroupHeaderLayerA key for the header layer of the group. The associated value is a
CALayer.Available in OS X v10.6 and later.
Declared in
IKImageBrowserView.h.IKImageBrowserGroupFooterLayerA key for the header layer of the group. The associated value is a
CALayer.Available in OS X v10.6 and later.
Declared in
IKImageBrowserView.h.
Declared In
IKImageBrowserView.hIKImageBrowserDropOperation
These constants specify the locations for dropping items onto the browser view. Used by the method setDropIndex:dropOperation:.
typedef enum
{
IKImageBrowserDropOn=0,
IKImageBrowserDropBefore=1,
}IKImageBrowserDropOperation;
Constants
IKImageBrowserDropOnDrop the item on the cell.
Available in OS X v10.6 and later.
Declared in
IKImageBrowserView.h.IKImageBrowserDropBeforeDrop the item before the cell.
Available in OS X v10.6 and later.
Declared in
IKImageBrowserView.h.
Availability
- Available in OS X v10.6 and later.
Declared In
IKImageBrowserView.h© 2010 Apple Inc. All Rights Reserved. (Last updated: 2010-03-24)