Inherits from | |
Conforms to | |
Framework | /System/Library/Frameworks/Quartz.framework/ImageKit.framework |
Availability | Available in Mac OS X v10.5 and later. |
Declared in | IKImageBrowserView.h |
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. It receives notification of changes in selection, as well as mouse events in the cells.
– setCellsStyleMask:
– cellsStyleMask
– setConstrainsToOriginalSize:
– constrainsToOriginalSize
– setIntercellSpacing:
– intercellSpacing
– selectionIndexes
– setSelectionIndexes:byExtendingSelection:
– setAllowsMultipleSelection:
– allowsMultipleSelection
– setAllowsEmptySelection:
– allowsEmptySelection
– setAllowsReordering:
– allowsReordering
– setAnimates:
– animates
– expandGroupAtIndex:
– collapseGroupAtIndex:
– isGroupExpandedAtIndex:
– setDraggingDestinationDelegate:
– draggingDestinationDelegate
– setDropIndex:dropOperation:
– indexAtLocationOfDroppedItem
– setAllowsDroppingOnItems:
– allowsDroppingOnItems
– dropOperation
Returns whether the user can drop on items.
- (BOOL)allowsDroppingOnItems
YES
if the user is able to drop on items, otherwise NO
.
The default is NO
.
IKImageBrowserView.h
Returns whether an empty selection is allowed.
- (BOOL)allowsEmptySelection
YES
if the receiver allows an empty selection; NO
otherwise.
IKImageBrowserView.h
Returns whether multiple selections are allowed.
- (BOOL)allowsMultipleSelection
YES
if the receiver allows the user to select more than one cell at a time; NO
otherwise.
IKImageBrowserView.h
Returns whether the user can reorder items.
- (BOOL)allowsReordering
YES
if the user can reorder items; NO
otherwise.
IKImageBrowserView.h
Returns whether the receiver animates reordering and changes of the data source.
- (BOOL)animates
YES
if the receiver animates reordering and changes of the data source; NO
otherwise.
IKImageBrowserView.h
Returns the foreground Core Animation layer
- (CALayer *)backgroundLayer
A CALayer
instance.
IKImageBrowserView.h
Returns whether the view can automatically take control of the QuickLook panel.
- (BOOL)canControlQuickLookPanel
YES
, if the view can display the Quick Look panel, otherwise NO
.
IKImageBrowserView.h
Returns the browser cell for the item at the specified index.
- (IKImageBrowserCell *)cellForItemAtIndex:(NSUInteger)index
The index.
The browser cell at the specified index.
Subclasses must not override this method.
IKImageBrowserView.h
Returns the cell size.
- (NSSize)cellSize
The current size for the cells in the image browser view.
IKImageBrowserView.h
Returns the appearance style mask for the cell.
- (NSUInteger)cellsStyleMask
The appearance style mask for the cell.
IKImageBrowserView.h
Collapses a group at the specified index.
- (void)collapseGroupAtIndex:(NSUInteger)index
The index of the group you want to collapse.
IKImageBrowserView.h
Returns the column indexes in the specified rectangle.
- (NSIndexSet *)columnIndexesInRect:(NSRect)rect
The rectangle in the view’s coordinate system.
An index set containing the cell indexes.
IKImageBrowserView.h
Returns whether the receiver constrains the cell's image to its original size.
- (BOOL)constrainsToOriginalSize
NO
if the image is not constrained; otherwise YES
.
IKImageBrowserView.h
Returns the receiver’s content resizing mask, which determines how its content is resized while zooming.
- (NSUInteger)contentResizingMask
The content resizing mask.
IKImageBrowserView.h
Returns the data source of the receiver.
- (id)dataSource
The data source (IKImageBrowserDataSource
). The data source is not retained by the receiver.
IKImageBrowserView.h
Returns the delegate of the receiver.
- (id)delegate
The delegate.
IKImageBrowserView.h
Returns the dragging destination delegate of the receiver.
- (id)draggingDestinationDelegate
The receiver's dragging destination delegate.
IKImageBrowserView.h
Returns the current drop operation.
- (IKImageBrowserDropOperation)dropOperation
IKImageBrowserDropOn
if the drop occurs on an item, otherwise IKImageBrowserDropBefore
.
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.
IKImageBrowserView.h
Expands a group at the specified index.
- (void)expandGroupAtIndex:(NSUInteger)index
The index of the group you want to expand.
IKImageBrowserView.h
Returns the foreground Core Animation layer
- (CALayer *)foregroundLayer
A CALayer
instance.
IKImageBrowserView.h
Returns the index of the cell where the drop operation occurred.
- (NSUInteger)indexAtLocationOfDroppedItem
The index of the cell where the drop operation occurred.
The returned index is valid until the next drop occurs.
IKImageBrowserView.h
Returns the index of the item at the specified location.
- (NSInteger)indexOfItemAtPoint:(NSPoint)point
The location of the item.
The index of the item or NSNotFound
if no item at this location.
IKImageBrowserView.h
Initializes a newly allocated image browser view with the provided frame rectangle.
- (id)initWithFrame:(NSRect)frame
The rectangle for the image browser.
The initialized object.
IKImageBrowserView.h
Returns the spacing between cells in the view.
- (NSSize)intercellSpacing
The vertical and horizontal spacing between cells.
IKImageBrowserView.h
Returns whether the group at the provided index is expanded.
- (BOOL)isGroupExpandedAtIndex:(NSUInteger)index
The index you want to check.
YES
if the group is expanded; NO
otherwise.
IKImageBrowserView.h
Returns the frame rectangle for the item located at the specified index.
- (NSRect)itemFrameAtIndex:(NSInteger)index
The index of the item whose frame rectangle you want to obtain.
The frame rectangle of the item.
IKImageBrowserView.h
Returns the cell to use for the specified item.
- (IKImageBrowserCell *)newCellForRepresentedItem:(id)anItem
The item that the returned cell will represent.
A new cell. The cell should not be return as autoreleased.
Subclasses can override this method to customize the appearance of the cell that will represent anItem.
IKImageBrowserView.h
Returns the current number of columns.
- (NSUInteger)numberOfColumns
The number of columns.
IKImageBrowserView.h
Returns the current number of rows.
- (NSUInteger)numberOfRows
The number of rows.
IKImageBrowserView.h
Returns the rectangle containing the specified column.
- (NSRect)rectOfColumn:(NSUInteger)columnIndex
The column index.
A rectangle containing the column. Specified in the view’s coordinate system.
IKImageBrowserView.h
Returns the rectangle containing the specified row.
- (NSRect)rectOfRow:(NSUInteger)rowIndex
The row index.
A rectangle containing the column. Specified in the view’s coordinate system.
IKImageBrowserView.h
Marks the receiver as needing its data reloaded.
- (void)reloadData
IKImageBrowserView.h
Returns the row indexes in the specified rectangle.
- (NSIndexSet *)rowIndexesInRect:(NSRect)rect
A rectangle in the view’s coordinate system.
An index set containing the item indexes.
IKImageBrowserView.h
Scrolls the receiver to the item at the specified index.
- (void)scrollIndexToVisible:(NSInteger)index
The index of the item to scroll to.
IKImageBrowserView.h
Returns the indexes of the selected cells.
- (NSIndexSet *)selectionIndexes
The indexes of the selected cells.
IKImageBrowserView.h
Specifies whether the user can drop on items.
- (void)setAllowsDroppingOnItems:(BOOL)flag
YES
if the user is able to drop on items, otherwise NO
.
The default is NO
.
IKImageBrowserView.h
Controls whether an empty selection is allowed.
- (void)setAllowsEmptySelection:(BOOL)flag
A BOOL
value that specifies whether to allow an empty selection.
IKImageBrowserView.h
Controls whether the user can select more than one cell at a time.
- (void)setAllowsMultipleSelection:(BOOL)flag
A BOOL
value that specifies whether to allow multiple selections.
IKImageBrowserView.h
Controls whether the user can reorder items.
- (void)setAllowsReordering:(BOOL)flag
A BOOL
value that specifies whether the user can reorder items.
IKImageBrowserView.h
Controls whether the receiver animates reordering and changes of the data source.
- (void)setAnimates:(BOOL)flag
A BOOL
value that specifies whether the receiver animates reordering and changes of the data source.
IKImageBrowserView.h
The Core Animation layer used as the view’s background.
- (void)setBackgroundLayer:(CALayer *)aLayer
A CALayer
instance.
The background layer can have sublayers. Additionally, the layers can also contain animations.
The layer is optional.
IKImageBrowserView.h
Specifies whether the view can automatically take control of the QuickLook panel.
- (void)setCanControlQuickLookPanel:(BOOL)flag
YES
, if the view can display the QuickLook panel, otherwise NO
.
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.
IKImageBrowserView.h
Sets the cell size.
- (void)setCellSize:(NSSize)size
The size to set.
You must use setCellSize
or setZoomValue:
, but not both. Setting the zoom value changes the cell size, and vice versa.
IKImageBrowserView.h
Defines the appearance style of the cells.
- (void)setCellsStyleMask:(NSUInteger)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 bitwise OR
operator.
IKImageBrowserView.h
Sets whether the receiver constrains the cell’s image to its original size.
- (void)setConstrainsToOriginalSize:(BOOL)flag
A flag that specifies whether to constrain the image. The default value is NO
.
IKImageBrowserView.h
Determines how the receiver resizes its content when zooming.
- (void)setContentResizingMask:(NSUInteger)mask
A resizing mask. You specify a mask by combining any of the following options using the C bitwise OR
operator: NSViewWidthSizable
, NSViewHeightSizable
. Other values are ignored.
IKImageBrowserView.h
Sets the data source of the receiver.
- (void)setDataSource:(id)source
A data source (IKImageBrowserDataSource
).
IKImageBrowserView.h
Sets the delegate of the receiver.
- (void)setDelegate:(id)aDelegate
The delegate must implement the IKImageBrowserDelegate
informal protocol.
IKImageBrowserView.h
Sets the dragging destination delegate of the receiver.
- (void)setDraggingDestinationDelegate:(id)delegate
The delegate (NSDraggingDestination
) to set.
IKImageBrowserView.h
Allows the class to retarget the drop action.
- (void)setDropIndex:(NSInteger)index dropOperation:(IKImageBrowserDropOperation)operation
The requested drop index.
The requested drop operation. The possible values are described in IKImageBrowserDropOperation
.
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
.
IKImageBrowserView.h
The Core Animation layer used as the foreground overlay.
- (void)setForegroundLayer:(CALayer *)aLayer
A CALayer
instance.
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.
IKImageBrowserView.h
Sets the spacing between cells in the view.
- (void)setIntercellSpacing:(NSSize)aSize
The vertical and horizontal spacing between cells.
By default, both values are 10.0
in the receiver’s coordinate system.
IKImageBrowserView.h
Selects cells at the specified indexes.
- (void)setSelectionIndexes:(NSIndexSet *)indexes byExtendingSelection:(BOOL)extendSelection
The indexes of the cells you want to select.
A BOOL
value that specifies whether to extend the current selection. Pass YES
to extends the selection; NO
replaces the current selection.
IKImageBrowserView.h
Sets the zoom value.
- (void)setZoomValue:(float)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.
You must use setZoomValue
or setCellSize:
, but not both. Setting the zoom value changes the cell size, and vice versa.
IKImageBrowserView.h
Returns the indexes of the view’s currently visible items.
- (NSIndexSet *)visibleItemIndexes
A set containing the indexes.
IKImageBrowserView.h
Masks for the appearance style bit field.
enum{ IKCellsStyleNone =0, IKCellsStyleShadowed =1, IKCellsStyleOutlined =2, IKCellsStyleTitled =4, IKCellsStyleSubtitled =8 };
IKCellsStyleNone
No style.
Available in Mac OS X v10.5 and later.
Declared in IKImageBrowserView.h
.
IKCellsStyleShadowed
Cells use shadows.
Available in Mac OS X v10.5 and later.
Declared in IKImageBrowserView.h
.
IKCellsStyleOutlined
Cells are outlined.
Available in Mac OS X v10.5 and later.
Declared in IKImageBrowserView.h
.
IKCellsStyleTitled
Cells display a title.
Available in Mac OS X v10.5 and later.
Declared in IKImageBrowserView.h
.
IKCellsStyleSubtitled
Cells display a subtitle.
Available in Mac OS X v10.5 and later.
Declared in IKImageBrowserView.h
.
IKImageBrowserView.h
Attributes for the group style. Used by the
enum{ IKGroupBezelStyle, IKGroupDisclosureStyle, };
IKGroupBezelStyle
A bezel style.
Available in Mac OS X v10.5 and later.
Declared in IKImageBrowserView.h
.
IKGroupDisclosureStyle
A disclosure triangle.
Available in Mac OS X v10.5 and later.
Declared in IKImageBrowserView.h
.
These constants affect the appearance of a group.
IKImageBrowserView.h
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;
IKImageBrowserBackgroundColorKey
A key for the background color of the image browser view. The associated value is an NSColor
object.
Available in Mac OS X v10.5 and later.
Declared in IKImageBrowserView.h
.
IKImageBrowserSelectionColorKey
A key for the color that indicates a selection. The associated value is an NSColor
object.
Available in Mac OS X v10.5 and later.
Declared in IKImageBrowserView.h
.
IKImageBrowserCellsOutlineColorKey
A key for the outline color for an item in the image browser view. The associated value is an NSColor
object.
Available in Mac OS X v10.5 and later.
Declared in IKImageBrowserView.h
.
IKImageBrowserCellsTitleAttributesKey
A key for title attribute of an item in the image browser view. The associated value is an NSDictionary
object.
Available in Mac OS X v10.5 and later.
Declared in IKImageBrowserView.h
.
IKImageBrowserCellsHighlightedTitleAttributesKey
A key for the highlighted title attribute for an item in the image browser view. The associated value is an NSDictionary
object.
Available in Mac OS X v10.5 and later.
Declared in IKImageBrowserView.h
.
IKImageBrowserCellsSubtitleAttributesKey
A key for a subtitle attribute for an item in the image browser view. The associated value is an NSDictionary
object.
Available in Mac OS X v10.5 and later.
Declared in IKImageBrowserView.h
.
IKImageBrowserView.h
Keys for group attributes.
NSString * const IKImageBrowserGroupRangeKey; NSString * const IKImageBrowserGroupBackgroundColorKey; NSString * const IKImageBrowserGroupTitleKey; NSString * const IKImageBrowserGroupStyleKey; NSString * const IKImageBrowserGroupHeaderLayer; NSString * const IKImageBrowserGroupFooterLayer;
IKImageBrowserGroupRangeKey
A key for the range of a group. The associated value is an NSValue
object. This is required if the view uses grouping
Available in Mac OS X v10.5 and later.
Declared in IKImageBrowserView.h
.
IKImageBrowserGroupBackgroundColorKey
A key for the background color of a group. The associated value is an NSColor
object. This color is used only for the bezel style.
Available in Mac OS X v10.5 and later.
Declared in IKImageBrowserView.h
.
IKImageBrowserGroupTitleKey
A key for the title of a group. The associated value is an NSString
object. This string is used for the disclosure style only.
Available in Mac OS X v10.5 and later.
Declared in IKImageBrowserView.h
.
IKImageBrowserGroupStyleKey
A key for the style of a group. The associated value is one of the constants defined in “Group Style Attributes”
.
Available in Mac OS X v10.5 and later.
Declared in IKImageBrowserView.h
.
IKImageBrowserGroupHeaderLayer
A key for the header layer of the group. The associated value is a CALayer
.
Available in Mac OS X v10.6 and later.
Declared in IKImageBrowserView.h
.
IKImageBrowserGroupFooterLayer
A key for the header layer of the group. The associated value is a CALayer
.
Available in Mac OS X v10.6 and later.
Declared in IKImageBrowserView.h
.
IKImageBrowserView.h
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;
IKImageBrowserDropOn
Drop the item on the cell.
Available in Mac OS X v10.6 and later.
Declared in IKImageBrowserView.h
.
IKImageBrowserDropBefore
Drop the item before the cell.
Available in Mac OS X v10.6 and later.
Declared in IKImageBrowserView.h
.
IKImageBrowserView.h
Last updated: 2010-03-24