Framework | Carbon/Carbon.h |
Declared in | HIDataBrowser.h |
The data browser application programming interface (API) provides a convenient way to present data for browsing and to create easily customized lists whose columns can be sorted, moved, and resized. It supports two presentation styles, each of which is derived from an abstract table-view base class:
List view, which lets you present items in multiple columns with the option to create hierarchical lists whose contents can be disclosed by the user
Column view, which provides in-place browsing using fixed navigation columns
The data browser programming interface has some routines that apply to both views while others are unique to one view. For functions that can be called for either, there may be differences in how the functions operate. Such differences are noted in the documentation for individual functions.
These terms are essential to understanding the reference:
An item in a data browser refers to the data displayed at a particular row and column intersection. In list view, two values identify each item—an item ID and a property ID. In column view, one value—the item ID—uniquely identifies an item.
An item ID is a unique 32-bit ID number that your application uses to refer to data. When you ask the data browser to display one or more items, you provide an item ID for each data item. You can store the actual data in memory, on disk, or across a network. Item IDs must be greater than 0
, which is used internally by the data browser. Item IDs can be values such as pointer values, data file offsets, and 32-bit TCP/IP host addresses.
A Property ID is a non-zero, 32-bit unsigned integer value that uniquely identifies a list view column. Property IDs do not need to be ordered or sequential, but they cannot be values 0 through 1023 because those values are reserved by Apple. A property ID is typically defined as a four-character sequence. For example, a column that displays dates could be assigned the property ID DATE
.
Columns in column view don’t use application-defined property IDs. Instead, columns in column view have the predefined property kDataBrowserItemSelfIdentityProperty
.
After you’ve created, formatted, and configured a data browser, most of the work of keeping the data browser updated and responsive to user interaction happens through callbacks you provide. For example, all of the functions that get and set item data are called from within an item-data callback provided by your application. Your application has a wide latitude in what it can choose to handle through callbacks and the tasks it lets the system perform. At the very least, your application must provide an item-data callback. Otherwise no data will ever be written to the data browser user interface. Depending on the nature of your application, you may also want to provide callbacks to handle drag-and-drop behavior, to support contextual menus, and to perform custom drawing or some other custom behavior.
The data browser is available with CarbonLib 1.1 and later and in Mac OS X.
For conceptual information and instructions on how to write code that uses a data browser to display data, see Data Browser Programming Guide.
GetDataBrowserUserState
SetDataBrowserUserState
SetDataBrowserActiveItems
GetDataBrowserActiveItems
SetDataBrowserScrollBarInset
GetDataBrowserScrollBarInset
SetDataBrowserTarget
GetDataBrowserTarget
SetDataBrowserSortOrder
GetDataBrowserSortOrder
SetDataBrowserScrollPosition
GetDataBrowserScrollPosition
SetDataBrowserHasScrollBars
GetDataBrowserHasScrollBars
SetDataBrowserSortProperty
GetDataBrowserSortProperty
SetDataBrowserSelectionFlags
GetDataBrowserSelectionFlags
SetDataBrowserPropertyFlags
GetDataBrowserPropertyFlags
SetDataBrowserEditText
CopyDataBrowserEditText
GetDataBrowserEditText
SetDataBrowserEditItem
GetDataBrowserEditItem
GetDataBrowserItemPartBounds
InitDataBrowserCallbacks
SetDataBrowserCallbacks
GetDataBrowserCallbacks
InitDataBrowserCustomCallbacks
SetDataBrowserCustomCallbacks
GetDataBrowserCustomCallbacks
Table view is a base class from which list and column views are derived. Some functions in this group can be used with both list and column views, while others are useful only in list view.
RemoveDataBrowserTableViewColumn
GetDataBrowserTableViewColumnCount
SetDataBrowserTableViewHiliteStyle
GetDataBrowserTableViewHiliteStyle
SetDataBrowserTableViewRowHeight
GetDataBrowserTableViewRowHeight
SetDataBrowserTableViewColumnWidth
GetDataBrowserTableViewColumnWidth
SetDataBrowserTableViewItemRowHeight
GetDataBrowserTableViewItemRowHeight
SetDataBrowserTableViewNamedColumnWidth
GetDataBrowserTableViewNamedColumnWidth
SetDataBrowserTableViewGeometry
GetDataBrowserTableViewGeometry
GetDataBrowserTableViewItemID
SetDataBrowserTableViewItemRow
GetDataBrowserTableViewItemRow
SetDataBrowserTableViewColumnPosition
GetDataBrowserTableViewColumnPosition
GetDataBrowserTableViewColumnProperty
AutoSizeDataBrowserListViewColumns
AddDataBrowserListViewColumn
GetDataBrowserListViewHeaderDesc
SetDataBrowserListViewHeaderDesc
SetDataBrowserListViewHeaderBtnHeight
GetDataBrowserListViewHeaderBtnHeight
SetDataBrowserListViewUsePlainBackground
GetDataBrowserListViewUsePlainBackground
SetDataBrowserListViewDisclosureColumn
GetDataBrowserListViewDisclosureColumn
SetDataBrowserColumnViewPath
GetDataBrowserColumnViewPath
GetDataBrowserColumnViewPathLength
SetDataBrowserColumnViewDisplayType
GetDataBrowserColumnViewDisplayType
EnableDataBrowserEditCommand
ExecuteDataBrowserEditCommand
GetDataBrowserSelectionAnchor
MoveDataBrowserSelectionAnchor
SetDataBrowserSelectedItems
The functions in this section are called from within an item-data callback routine (DataBrowserItemDataProcPtr
) provided by your application. The data browser invokes your item-data callback each time your application needs to provide data for the display. Your callback responds by calling the appropriate function from this section.
SetDataBrowserItemDataIcon
GetDataBrowserItemDataIcon
SetDataBrowserItemDataText
GetDataBrowserItemDataText
SetDataBrowserItemDataValue
GetDataBrowserItemDataValue
SetDataBrowserItemDataMinimum
GetDataBrowserItemDataMinimum
SetDataBrowserItemDataMaximum
GetDataBrowserItemDataMaximum
SetDataBrowserItemDataBooleanValue
GetDataBrowserItemDataBooleanValue
SetDataBrowserItemDataMenuRef
GetDataBrowserItemDataMenuRef
SetDataBrowserItemDataRGBColor
GetDataBrowserItemDataRGBColor
SetDataBrowserItemDataDrawState
GetDataBrowserItemDataDrawState
SetDataBrowserItemDataButtonValue
GetDataBrowserItemDataButtonValue
SetDataBrowserItemDataIconTransform
GetDataBrowserItemDataIconTransform
SetDataBrowserItemDataDateTime
GetDataBrowserItemDataDateTime
SetDataBrowserItemDataLongDateTime
GetDataBrowserItemDataLongDateTime
SetDataBrowserItemDataItemID
GetDataBrowserItemDataItemID
GetDataBrowserItemDataProperty
The functions in this section create and dispose of universal procedure pointers (UPPs) to the callbacks you provide to the data browser. For each callback, there is a New, Dispose, and Invoke function. You don’t need to use an Invoke function, because the data browser invokes callbacks for you.
The documentation for the UPP functions in this section is boilerplate text—quite repetitive and you can likely skip over it. The more interesting documentation is for the callbacks themselves, which you can find in the section “Data Browser Callbacks.”
NewDataBrowserItemUPP
InvokeDataBrowserItemUPP
DisposeDataBrowserItemUPP
NewDataBrowserItemDataUPP
InvokeDataBrowserItemDataUPP
DisposeDataBrowserItemDataUPP
NewDataBrowserItemCompareUPP
InvokeDataBrowserItemCompareUPP
DisposeDataBrowserItemCompareUPP
NewDataBrowserItemNotificationUPP
InvokeDataBrowserItemNotificationUPP
DisposeDataBrowserItemNotificationUPP
NewDataBrowserItemNotificationWithItemUPP
InvokeDataBrowserItemNotificationWithItemUPP
DisposeDataBrowserItemNotificationWithItemUPP
NewDataBrowserAddDragItemUPP
InvokeDataBrowserAddDragItemUPP
DisposeDataBrowserAddDragItemUPP
NewDataBrowserAcceptDragUPP
InvokeDataBrowserAcceptDragUPP
DisposeDataBrowserAcceptDragUPP
NewDataBrowserReceiveDragUPP
InvokeDataBrowserReceiveDragUPP
DisposeDataBrowserReceiveDragUPP
NewDataBrowserPostProcessDragUPP
InvokeDataBrowserPostProcessDragUPP
DisposeDataBrowserPostProcessDragUPP
NewDataBrowserGetContextualMenuUPP
InvokeDataBrowserGetContextualMenuUPP
DisposeDataBrowserGetContextualMenuUPP
NewDataBrowserSelectContextualMenuUPP
InvokeDataBrowserSelectContextualMenuUPP
DisposeDataBrowserSelectContextualMenuUPP
NewDataBrowserItemHelpContentUPP
InvokeDataBrowserItemHelpContentUPP
DisposeDataBrowserItemHelpContentUPP
NewDataBrowserDrawItemUPP
InvokeDataBrowserDrawItemUPP
DisposeDataBrowserDrawItemUPP
NewDataBrowserEditItemUPP
InvokeDataBrowserEditItemUPP
DisposeDataBrowserEditItemUPP
NewDataBrowserHitTestUPP
InvokeDataBrowserHitTestUPP
DisposeDataBrowserHitTestUPP
NewDataBrowserTrackingUPP
InvokeDataBrowserTrackingUPP
DisposeDataBrowserTrackingUPP
NewDataBrowserItemDragRgnUPP
InvokeDataBrowserItemDragRgnUPP
DisposeDataBrowserItemDragRgnUPP
NewDataBrowserItemAcceptDragUPP
InvokeDataBrowserItemAcceptDragUPP
DisposeDataBrowserItemAcceptDragUPP
NewDataBrowserItemReceiveDragUPP
InvokeDataBrowserItemReceiveDragUPP
DisposeDataBrowserItemReceiveDragUPP
Adds one or more items to a data browser.
OSStatus AddDataBrowserItems ( ControlRef browser, DataBrowserItemID container, ItemCount numItems, const DataBrowserItemID *items, DataBrowserPropertyID preSortProperty );
A data browser.
An item ID or the constant kDataBrowserNoItem
. Pass the item ID that uniquely identifies the container to which you want to add items. Adding one or more items to an existing container opens the container. If you a pass kDataBrowserNoItem
, the items are added to the root container.
The number of items in the array pointed to by the items
parameter.
A pointer to an array of item ID values for the items you want to add to the data browser. You supply item ID values based on your own identification scheme. If you pass NULL
, each time you call AddDataBrowserItems
the data browser generates item ID values starting at 1
. Calling the function in this way clears whatever items are in the container. Because of this clearing behavior, passing NULL
is not recommended unless your application uses a data browser to display a simple list that is populated only once with data.
The property ID of the column whose sorting order matches the sorting order of the items
array. A property ID is a four-character sequence that you assign to represent a column in list view. Pass kDataBrowserItemNoProperty
if the items
array is not sorted or if you don’t know the sorting order of your data. You’ll get the best performance from this function if you provide a sorting order.
A result code. If the item ID specified by the container
parameter is not classified as a container, returns errDataBrowserItemNotAdded
if you attempt to add subitems to it. See “Data Browser Result Codes.”
Hierarchical lists are constructed in a top-down fashion. Your application must install all the top-level, or parent, item IDs in the data browser before it associates a list of item ID values as subitems. You can add items to a parent item only after the parent item is classified as a container. A container is an item for which the property kDataBrowserItemIsContainerProperty
is set to true
.
HIDataBrowser.h
Adds a column to a data browser that uses list view.
OSStatus AddDataBrowserListViewColumn ( ControlRef browser, DataBrowserListViewColumnDesc *columnDesc, DataBrowserTableViewColumnIndex position );
A data browser.
A pointer to the list view column description data structure that you have filled out with data that specifies the column property and display information for the column heading.
The position, among the columns already installed in the data browser, to insert this column. To insert this column to the right of all other columns, pass kDataBrowserListViewAppendColumn
. The value 0
means the leftmost column.
A result code; paramErr
is returned if the columnDesc
parameter is not properly initialized. See “Data Browser Result Codes.”
Typically you use the function AddDataBrowserListViewColumn
in these cases:
When you create a data browser programmatically. If you use Interface Builder to design and lay out the data browser, you do not need to call the function AddDataBrowserListViewColumn
. Interface Builder lets you position a column graphically and then specify the column description in the column pane of the Info window.
When you switch from column view to list view. Regardless of how you first create a data browser, if your application allows the user to switch between views, you need to add list view columns each time the view switches from column to list view.
HIDataBrowser.h
Adjusts the size of columns displayed in list view to take best advantage of the available space.
OSStatus AutoSizeDataBrowserListViewColumns ( ControlRef browser );
A data browser.
A result code. See “Data Browser Result Codes.”
When you call the function AutoSizeDataBrowserListViewColumns
, it first calculates whether there is extra space or not enough space in the data browser. Then, the columns are resized using the following rules:
If there is extra space, the data browser gives as much of the extra space as possible to the first column (that is, the leftmost column) without exceeding the maximum width for the column. If there is still space available, the data browser gives as much of the remaining space as possible to the second column without exceeding the maximum width for the column. The data browser continues to disburse space in this manner until there is no more extra space. Thus, it is possible for the first column to get all the extra space.
If space is needed to fit all the columns, the data browser takes as much of the needed space as possible from the rightmost column (that is, the last column) without letting the column width fall below the minimum width for the column. If more space is needed, the data browser takes as much of the needed space as possible from the next-to-the-last column without letting the column width fall below the minimum width for the column. The data browser continues to adjust space in this manner until all the columns fit within the data browser.
The function AutoSizeDataBrowserListViewColumns
resizes only if the horizontal scroll bar is turned off. Your application can call the function SetDataBrowserHasScrollBars
to turn off the horizontal scroll bar.
HIDataBrowser.h
Creates an AXUIElementRef
that represents some part of a data browser accessibility hierarchy.
AXUIElementRef AXUIElementCreateWithDataBrowserAndItemInfo ( ControlRef inDataBrowser, const DataBrowserAccessibilityItemInfo *inInfo );
A data browser.
A DataBrowserAccessibilityItemInfo
structure describing the part of the data browser for which you want to create an AXUIElementRef
.
An AXUIElementRef
representing the part, or NULL
if an AXUIElementRef
cannot be created to represent the part you specified.
HIDataBrowser.h
Obtains a description of the part of a data browser represented by an AXUIElementRef
.
OSStatus AXUIElementGetDataBrowserItemInfo ( AXUIElementRef inElement, ControlRef inDataBrowser, UInt32 inDesiredInfoVersion, DataBrowserAccessibilityItemInfo *outInfo );
An AXUIElementRef
representing part of a data browser.
A data browser.
The version of DataBrowserAccessibilityItemInfo
structure you want to get. Currently, the only supported version is zero, so you must pass 0
or 1
as the value of this parameter.
On input, a pointer to a DataBrowserAccessibilityItemInfo
structure. On return, the structure is filled in with a description of the part of the data browser that the AXUIElementRef
specified by inElement
represents.
A result code. See “Data Browser Result Codes.” The function returns noErr
if it was able to generate a description of the AXUIElementRef
. If the AXUIElementRef
does not represent the data browser you passed in, the function returns paramErr
. If the AXUIElementRef
represents some non-item part of the data browser, the function returns errDataBrowserItemNotFound
.
HIDataBrowser.h
Closes a data browser container.
OSStatus CloseDataBrowserContainer ( ControlRef browser, DataBrowserItemID container );
A data browser.
The item ID of the container you want to close.
A result code. See “Data Browser Result Codes.”
Normally the user navigates through a data hierarchy by clicking the disclosure triangle next to a container item in list view, or the container item (such as a folder icon) in column view. In either of these cases, the system automatically opens or closes the container. Under some circumstances your application may need to open or close a container programmatically, such as when you are restoring a display to its last known state. In such cases, you can call the function OpenDataBrowserContainer
to disclose items in a container or the function CloseDataBrowserContainer
to hide items in a container.
HIDataBrowser.h
Copies the text being edited by the user.
OSStatus CopyDataBrowserEditText ( ControlRef browser, CFStringRef *text );
A data browser.
On input, a CFStringRef
variable initialized to anything other than NULL
. See the Special Considerations for details. On return, a CFString object that contains a copy of the text edited by the user. You are responsible for releasing the string when you no longer need it.
A result code. See “Data Browser Result Codes.”
This function is useful only if an edit session is in progress for an item. You can check whether an edit session is open by calling the function GetDataBrowserEditItem
.
For versions of Mac OS X prior to v10.4, the text
parameter must be set to any value other than NULL
. Do not allocate the CFStringRef, otherwise your application will leak memory. Instead provide code similar to the following to initialize the variable:
CFStringRef myText = 0XFFFFFFFF;
HIDataBrowser.h
Creates a data browser programmatically.
OSStatus CreateDataBrowserControl ( WindowRef window, const Rect *boundsRect, DataBrowserViewStyle style, ControlRef *outControl );
The window in which to place the data browser.
A pointer to a rectangle that specifies the location where you want the control to appear in the window.
The view style to use. Pass the constant kDataBrowserListView
to draw the data browser using list view or kDataBrowserColumnView
draw the data browser using column view. See “View Styles” for more information on these constants.
On input, a pointer to a control reference. On return, this is set to the newly created data browser. When you no longer need the data browser, call the Control Manager function DisposeControl
to release it. When you dispose of the control, deallocate any universal procedure pointers you allocated for use with the control.
A result code. See “Data Browser Result Codes.”
This function creates a data browser programmatically. If you create a data browser using Interface Builder, you don’t need to call CreateDataBrowserControl
. Instead, you call the function GetControlByID
to obtain a control reference that points to your data browser.
After you create a data browser by calling CreateDataBrowserControl
, you can set such attributes as sorting order, scroll bars, and scroll position. See “Manipulating Data Browser Attributes” for the functions you can use to set data browser attributes.
You need to set up the display characteristics of the data browser by calling the appropriate functions. See “Formatting Table View,” “Formatting List View,” and “Formatting Column View” for information on the formatting functions you can call.
You need to call the functions InitDataBrowserCallbacks
and SetDataBrowserCallbacks
to install the callbacks needed for your data browser. At the very least, you must provide an item-data callback to add or change data items; you must do so regardless of the content your data browser displays—noncustom or custom. Otherwise, your data browser will be empty. See DataBrowserItemDataProcPtr
for more information. If you present hierarchical data in list view, or use column view for browsing data, you must provide a callback to handle item notifications. See DataBrowserItemNotificationProcPtr
and DataBrowserItemNotificationWithItemProcPtr
.
You can optionally provide callbacks to:
Perform sorting. See DataBrowserItemCompareProcPtr
.
Handle drag-and-drop behavior. See DataBrowserAddDragItemProcPtr
, DataBrowserAcceptDragProcPtr
, DataBrowserReceiveDragProcPtr
, and DataBrowserPostProcessDragProcPtr
.
Provide contextual menus. See DataBrowserGetContextualMenuProcPtr
and DataBrowserSelectContextualMenuProcPtr
.
Display help tags. See DataBrowserItemHelpContentProcPtr
.
If your data browser uses a list whose columns require custom drawing or behavior, you must also provide callbacks to handle the custom tasks. See InitDataBrowserCustomCallbacks
and SetDataBrowserCustomCallbacks
for more information on initializing and installing callbacks for custom behavior. The custom tasks you can handle in list view include:
Drawing custom content. See DataBrowserDrawItemProcPtr
.
Supporting editing of custom content. See DataBrowserEditItemProcPtr
. Note that editing is built-in for noncustom content.
Performing hit-testing and tracking. See DataBrowserHitTestProcPtr
and DataBrowserTrackingProcPtr
.
Handling drag-and-drop behavior. See DataBrowserItemDragRgnProcPtr
, DataBrowserItemAcceptDragProcPtr
, and DataBrowserItemReceiveDragProcPtr
.
HIDataBrowser.h
Sets the attributes for a data browser.
OSStatus DataBrowserChangeAttributes ( ControlRef inDataBrowser, OptionBits inAttributesToSet, OptionBits inAttributesToClear );
A data browser.
The attributes to set. For possible values, see “Data Browser Attributes.”
The attributes to clear. For possible values, see “Data Browser Attributes.”
A result code. See “Data Browser Result Codes.”
HIDataBrowser.h
Gets the attributes of a data browser.
OSStatus DataBrowserGetAttributes ( ControlRef inDataBrowser, OptionBits *outAttributes );
A data browser.
The attributes to get. This parameter cannot be NULL
. For possible values, see “Data Browser Attributes.”
A result code. See “Data Browser Result Codes.”
HIDataBrowser.h
Gets the value of a specified data browser metric.
OSStatus DataBrowserGetMetric ( ControlRef inDataBrowser, DataBrowserMetric inMetric, Boolean *outUsingDefaultValue, CGFloat *outValue );
A data browser.
The data browser metric value to get. For possible values, see“Data Browser Metric Values.”
On return, a Boolean whose value indicates whether the metric’s value is determined by the data browser’s default values. Pass NULL
if you don’t want this information.
On return, the value of the metric.
A result code. See “Data Browser Result Codes.” If the inDataBrowser
is not an instance of a data browser or if the value specified by inMetric
is not known, DataBrowserGetMetric
returns paramErr
.
HIDataBrowser.h
Sets the value of a specified data browser metric.
OSStatus DataBrowserSetMetric ( ControlRef inDataBrowser, DataBrowserMetric inMetric, Boolean inUseDefaultValue, CGFloat inValue );
A data browser.
The data browser metric whose value is to be set. For possible values, see “Data Browser Metric Values.”
A Boolean whose value indicates whether you want the data browser to revert to the default value for the metric. If you pass true
, inValue
is ignored and a suitable default value is used. If you pass false
, inValue
is set as the value of the metric.
The value to set for the metric (if the value of inUsingDefaultValue
is false
).
A result code. See “Data Browser Result Codes.” If the inDataBrowser
is not an instance of a data browser or if the value specified by inMetric
is not known, DataBrowserSetMetric
returns paramErr
.
HIDataBrowser.h
Disposes of a universal procedure pointer to an accept-drag callback function.
void DisposeDataBrowserAcceptDragUPP ( DataBrowserAcceptDragUPP userUPP );
The universal procedure pointer to dispose of.
See the DataBrowserAcceptDragProcPtr
callback function.
HIDataBrowser.h
Disposes of a universal procedure pointer to an add-drag-item callback function.
void DisposeDataBrowserAddDragItemUPP ( DataBrowserAddDragItemUPP userUPP );
The universal procedure pointer to dispose of.
See the DataBrowserAddDragItemProcPtr
callback function.
HIDataBrowser.h
Disposes of a universal procedure pointer to a draw-item callback function.
void DisposeDataBrowserDrawItemUPP ( DataBrowserDrawItemUPP userUPP );
The universal procedure pointer to dispose of.
See the DataBrowserDrawItemProcPtr
callback function.
HIDataBrowser.h
Disposes of a universal procedure pointer to an edit-item callback function.
void DisposeDataBrowserEditItemUPP ( DataBrowserEditItemUPP userUPP );
The universal procedure pointer to dispose of.
See the DataBrowserEditItemProcPtr
callback function.
HIDataBrowser.h
Disposes of a universal procedure pointer to a get-contextual-menu callback function.
void DisposeDataBrowserGetContextualMenuUPP ( DataBrowserGetContextualMenuUPP userUPP );
The universal procedure pointer to dispose of.
See the DataBrowserGetContextualMenuProcPtr
callback function.
HIDataBrowser.h
Disposes of a universal procedure pointer to a hit-test callback function.
void DisposeDataBrowserHitTestUPP ( DataBrowserHitTestUPP userUPP );
The universal procedure pointer to dispose of.
See the DataBrowserHitTestProcPtr
callback function.
HIDataBrowser.h
Disposes of a universal procedure pointer to an item-accept-drag callback function.
void DisposeDataBrowserItemAcceptDragUPP ( DataBrowserItemAcceptDragUPP userUPP );
The universal procedure pointer to dispose of.
See the DataBrowserItemAcceptDragProcPtr
callback function.
HIDataBrowser.h
Disposes of a universal procedure pointer to an item-comparison callback function.
void DisposeDataBrowserItemCompareUPP ( DataBrowserItemCompareUPP userUPP );
The universal procedure pointer to dispose of.
See the DataBrowserItemCompareProcPtr
callback function.
HIDataBrowser.h
Disposes of a universal procedure pointer to an item-data callback function.
void DisposeDataBrowserItemDataUPP ( DataBrowserItemDataUPP userUPP );
The universal procedure pointer to dispose of.
See the DataBrowserItemDataProcPtr
callback function.
HIDataBrowser.h
Disposes of a universal procedure pointer to an item-drag-region callback function.
void DisposeDataBrowserItemDragRgnUPP ( DataBrowserItemDragRgnUPP userUPP );
The universal procedure pointer to dispose of.
See the DataBrowserItemDragRgnProcPtr
callback function.
HIDataBrowser.h
Disposes of a universal procedure pointer to an item-help-content callback function.
void DisposeDataBrowserItemHelpContentUPP ( DataBrowserItemHelpContentUPP userUPP );
The universal procedure pointer to dispose of.
See the DataBrowserItemHelpContentProcPtr
callback function.
HIDataBrowser.h
Disposes of a universal procedure pointer to an item-notification callback function.
void DisposeDataBrowserItemNotificationUPP ( DataBrowserItemNotificationUPP userUPP );
The universal procedure pointer to dispose of.
See the DataBrowserItemNotificationProcPtr
callback function.
HIDataBrowser.h
Disposes of a universal procedure pointer to an item-notification-with-data callback function.
void DisposeDataBrowserItemNotificationWithItemUPP ( DataBrowserItemNotificationWithItemUPP userUPP );
The universal procedure pointer to dispose of.
See the DataBrowserItemNotificationWithItemProcPtr
callback function.
HIDataBrowser.h
Disposes of a universal procedure pointer to an item-receive-drag callback function.
void DisposeDataBrowserItemReceiveDragUPP ( DataBrowserItemReceiveDragUPP userUPP );
The universal procedure pointer to dispose of.
See the DataBrowserItemReceiveDragProcPtr
callback function.
HIDataBrowser.h
Disposes of a universal procedure pointer to an item-iterator callback function.
void DisposeDataBrowserItemUPP ( DataBrowserItemUPP userUPP );
The universal procedure pointer to dispose of.
See the DataBrowserItemProcPtr
callback function.
HIDataBrowser.h
Disposes of a universal procedure pointer to a postprocess-drag callback function.
void DisposeDataBrowserPostProcessDragUPP ( DataBrowserPostProcessDragUPP userUPP );
The universal procedure pointer to dispose of.
See the DataBrowserPostProcessDragProcPtr
callback function.
HIDataBrowser.h
Disposes of a universal procedure pointer to a receive-drag callback function.
void DisposeDataBrowserReceiveDragUPP ( DataBrowserReceiveDragUPP userUPP );
The universal procedure pointer to dispose of.
See the DataBrowserReceiveDragProcPtr
callback function.
HIDataBrowser.h
Disposes of a universal procedure pointer to a select-contextual-menu callback function.
void DisposeDataBrowserSelectContextualMenuUPP ( DataBrowserSelectContextualMenuUPP userUPP );
The universal procedure pointer to dispose of.
See the DataBrowserSelectContextualMenuProcPtr
callback function.
HIDataBrowser.h
Disposes of a universal procedure pointer to a tracking callback function.
void DisposeDataBrowserTrackingUPP ( DataBrowserTrackingUPP userUPP );
The universal procedure pointer to dispose of.
See the DataBrowserTrackingProcPtr
callback function.
HIDataBrowser.h
Determines whether the data browser is currently able to process a given editing command.
Boolean EnableDataBrowserEditCommand ( ControlRef browser, DataBrowserEditCommand command );
A data browser.
The editing command you want to enable. You can pass any of the constants described in “Editing Commands.”
A value of true
if the requested editing command can be performed by the data browser at this time.
Editing commands (Cut, Paste, Copy, and so on) can be enabled for an editable text field that is open and selected and for which the data browser is currently able to process the given command. For example, the data browser can process a Paste command only if there is text available on the Clipboard.
Editing commands are also available for a custom display type when the callbacks you install for the custom display indicate editing is available. Your application can call the function EnableDataBrowserEditCommand
to discover if a specific editing command can be enabled. To execute an editing command, call the function ExecuteDataBrowserEditCommand
.
HIDataBrowser.h
Executes an editing command.
OSStatus ExecuteDataBrowserEditCommand ( ControlRef browser, DataBrowserEditCommand command );
A data browser.
The editing command you want to execute. You can pass any of the constants described in “Editing Commands.”
A result code. See “Data Browser Result Codes.”
Editing commands can be executed for an editable text field that is open and selected. Your application can check to see if the editing command is enabled by first calling the function EnableDataBrowserEditCommand
.
HIDataBrowser.h
Applies an item-iterator callback routine to each data item that meets the specified criteria.
OSStatus ForEachDataBrowserItem ( ControlRef browser, DataBrowserItemID container, Boolean recurse, DataBrowserItemState state, DataBrowserItemUPP callback, void *clientData );
A data browser.
An item ID or the constant kDataBrowserNoItem
. To iterate through items that are organized as subitems of a container item, pass the item ID for the container. To iterate through all items displayed at the root of the data browser, pass the constant kDataBrowserNoItem
.
A value that indicates whether or not to traverse the entire item hierarchy when applying the callback specified by the callback
parameter. Pass true
to apply the callback to all items in the hierarchy. Pass false
if you want to apply the callback only to those items at the top level of the container or data browser.
A value that specifies the state of the items to which to apply the callback. Pass 0
if you want to apply the callback to all items, regardless of state. Otherwise, pass one of the constants described in “Item States.”
A universal procedure pointer to your item-iterator callback routine. This routine is called for every item ID that matches the specified criteria. See DataBrowserItemProcPtr
for more information on the callback routine to supply.
A pointer to a buffer, local variable, or other storage location created and disposed of by your application and needed by your callback routine.
A result code. See “Data Browser Result Codes.”
The function ForEachDataBrowserItem
is useful for enumerating and performing an operation on a set of item IDs.
HIDataBrowser.h
Obtains what determines the active state of the items in a data browser.
OSStatus GetDataBrowserActiveItems ( ControlRef browser, Boolean *active );
A data browser.
On input, a pointer to a Boolean variable. On return, the variable is set to true
if the active state of each item in the list is determined by the item property kDataBrowserItemIsActiveProperty
. Otherwise, the variable is set to false
to indicate that all items are inactive.
A result code. See “Data Browser Result Codes.”
HIDataBrowser.h
Obtains the callback routines installed for notifying your application of changes to a data browser and for providing the data to be displayed by the data browser.
OSStatus GetDataBrowserCallbacks ( ControlRef browser, DataBrowserCallbacks *callbacks );
The data browser whose callback routines you want to obtain.
On input, a pointer to a DataBrowserCallbacks
structure. On return, the structure contains universal procedure pointers to the callback routines installed for the data browser.
A result code. See “Data Browser Result Codes.”
When GetDataBrowserCallacks
is used in conjunction with the function SetDataBrowserCallbacks
, your application can override or replace one or more callbacks used by a data browser to notify your application of changes.
HIDataBrowser.h
Obtains the display type for a column view.
OSStatus GetDataBrowserColumnViewDisplayType ( ControlRef browser, DataBrowserPropertyType *propertyType );
A data browser.
On input, a pointer to a display type variable. On return, the variable is set to the data type or control that is displayed in the data browser. No display types other than kDataBrowserIconAndTextType
are currently supported in column view. See “Display Types” for more information.
A result code. See “Data Browser Result Codes.”
HIDataBrowser.h
Obtains the current path for a selection in column view.
OSStatus GetDataBrowserColumnViewPath ( ControlRef browser, Handle path );
A data browser.
On input, a handle. On return, the handle contains an array of item ID values that specify the current path. Array element 0
is the root; array element N-1
is the target. You must allocate the handle before calling this function, and you are responsible for disposing of it.
A result code. See “Data Browser Result Codes.”
HIDataBrowser.h
Obtains the length of the current path for a column view.
OSStatus GetDataBrowserColumnViewPathLength ( ControlRef browser, UInt32 *pathLength );
A data browser.
On input, a pointer to an unsigned 32-bit integer. On return, this value is set to the number of levels in the path for the currently selected item.
A result code. See “Data Browser Result Codes.”
HIDataBrowser.h
Obtains the callbacks installed to implement custom drawing and behavior for the content in a data browser.
OSStatus GetDataBrowserCustomCallbacks ( ControlRef browser, DataBrowserCustomCallbacks *callbacks );
A data browser.
On input, a pointer to a DataBrowserCustomCallbacks
structure. On return, the structure contains universal procedure pointers to the custom callback routines installed for the data browser.
A result code. See “Data Browser Result Codes.”
When GetDataBrowserCustomCallbacks
is used in conjunction with the function SetDataBrowserCustomCallbacks
, your application can temporarily override or replace one or more callbacks used by a data browser to support custom drawing and custom behavior.
HIDataBrowser.h
Obtains the item ID and property ID values of the current editing session.
OSStatus GetDataBrowserEditItem ( ControlRef browser, DataBrowserItemID *item, DataBrowserPropertyID *property );
A data browser.
On input, a pointer to an item ID variable. On return, the variable is set to the item ID of the item that is being edited. If there is no editing session in progress, this parameter is set to kDataBrowserNoItem
.
On input, a pointer to a property ID variable. On return, the variable is set to the property ID of the item that is being edited. If there is no editing session in progress, this parameter is set to 0
.
A result code. See “Data Browser Result Codes.”
HIDataBrowser.h
Obtains the text being edited by the user.
Not Recommended
OSStatus GetDataBrowserEditText ( ControlRef browser, CFMutableStringRef text );
A data browser.
On return, the CFMutableString object is set to the text being edited by the user. Your application must allocate this object and pass it to the data browser. The data browser sets its contents to the current contents of the edit session text field. You must release this object when you no longer need it.
A result code. See “Data Browser Result Codes.”
This function does not work. Instead use CopyDataBrowserEditText
.
HIDataBrowser.h
Obtains the display state of horizontal and vertical scroll bars for a list view data browser.
OSStatus GetDataBrowserHasScrollBars ( ControlRef browser, Boolean *horiz, Boolean *vert );
A list view data browser.
On input, a pointer to a Boolean variable. On return, the variable is set to true
if the browser control has a horizontal scroll bar.
On input, a pointer to a Boolean variable. On return, the variable is set to true
if the browser control has a vertical scroll bar.
A result code. See “Data Browser Result Codes.”
The function GetDataBrowserHasScrollBars
is useful for determining if the browser control currently has scroll bars. For example, you would call the function AutoSizeDataBrowserListViewColumns
only after you have determined the data browser does not have a horizontal scroll bar.
HIDataBrowser.h
Obtains the number of items whose state matches the specified state.
OSStatus GetDataBrowserItemCount ( ControlRef browser, DataBrowserItemID container, Boolean recurse, DataBrowserItemState state, ItemCount *numItems );
A data browser.
An item ID or the constant kDataBrowserNoItem
. To obtain the number of items that are organized as subitems of a container item, pass the item ID for the container. To obtain the number of items displayed at the root of the data browser, provide the constant kDataBrowserNoItem
.
A value that indicates whether or not to traverse the entire item hierarchy when counting. Pass true
to obtain a count for all items in the hierarchy. Pass false
if you want to count only those items at the top level of the container or data browser.
A value that specifies the state of the items to obtain. Only items that have this state are counted. Pass kDataBrowserItemAnyState
if you want to count all items regardless of state. Otherwise, pass one of the constants described in “Item States”
.
On input, a pointer to an unsigned 32-bit integer. On return, this value is set to the number of items in the container that have the specified state.
A result code. See “Data Browser Result Codes.”
HIDataBrowser.h
Obtains the Boolean value for an item.
OSStatus GetDataBrowserItemDataBooleanValue ( DataBrowserItemDataRef itemData, Boolean *theData );
The item data reference for the item whose Boolean value you want to obtain. The item data reference is passed to the callback routine from which you are calling the function GetDataBrowserItemDataBooleanValue
.
On input, a pointer to a Boolean variable. On return, the variable is set to the Boolean value.
A result code. See “Data Browser Result Codes.”
You can obtain Boolean values for the following properties:
kDataBrowserItemIsActiveProperty
kDataBrowserItemIsSelectableProperty
kDataBrowserItemIsEditableProperty
kDataBrowserItemIsContainerProperty
kDataBrowserItemIsOpenableProperty
kDataBrowserItemIsClosableProperty
kDataBrowserItemIsSortableProperty
HIDataBrowser.h
Obtains the value for a checkbox.
OSStatus GetDataBrowserItemDataButtonValue ( DataBrowserItemDataRef itemData, ThemeButtonValue *theData );
The item data reference for the item whose checkbox setting you want to obtain. The item data reference is passed to the callback routine from which you are calling the function GetDataBrowserItemDataButtonValue
.
On input, a pointer to a theme button value variable. On return, the variable is set to the checkbox setting. The value can be one of the following theme button value constants defined by the Appearance Manager,:
kThemeButtonOff
indicates a checkbox that is not selected.
kThemeButtonOn
indicates a checkbox that is selected.
kThemeButtonMixed
draws a checkbox that in a mixed state, indicating that a setting is on for some items in a selection and off for others.
See Appearance Manager Reference for more information.
A result code. See “Data Browser Result Codes.”
Your item-data callback calls this function in response to a set-data request for items that have the display type kDataBrowserCheckboxType.
HIDataBrowser.h
Obtains, as a 32-bit value, the date and time value displayed.
OSStatus GetDataBrowserItemDataDateTime ( DataBrowserItemDataRef itemData, SInt32 *theData );
The item data reference for the item whose date and time value you want to obtain. The item data reference is passed to the callback routine from which you are calling the function GetDataBrowserItemDataDateTime
.
On input, a 32-bit value. On return, the value is set to the number of elapsed seconds since midnight, January 1, 1904. For more information about date and time encodings used in the Mac OS, see Date, Time, and Measurement Utilities Reference in Carbon Text & International Documentation.
A result code. See “Data Browser Result Codes.”
This function works only with items that have the property kDataBrowserDateTimeType
. If the column has the property kDataBrowserRelativeDateTime
, the date is displayed relative to the current time for the computer. For example, a time 24 hours prior to the current time is displayed as “Yesterday.” Other examples of relative date and time values are “Today, 1:45 PM” and “Yesterday, 7:30 AM.”
HIDataBrowser.h
Determines whether a checkbox is in the active or inactive state.
OSStatus GetDataBrowserItemDataDrawState ( DataBrowserItemDataRef itemData, ThemeDrawState *theData );
The item data reference for the checkbox whose drawing state you want to obtain. This value is passed to the callback routine from which you are calling the function GetDataBrowserItemDataDrawState
.
On input, a pointer to a theme draw state variable. On return, the variable is set to the drawing state for the item, either kThemeStateInactive
or kThemeStateActive
. See Appearance Manager Reference for more information on these constants.
A result code. See “Data Browser Result Codes.”
Your item-data callback calls this function in response to a get-data request for items that have display type kDataBrowserCheckboxType
.
HIDataBrowser.h
Obtains the icon drawn for an item.
OSStatus GetDataBrowserItemDataIcon ( DataBrowserItemDataRef itemData, IconRef *theData );
The item data reference for the item whose icon you want to obtain. This value is passed to the callback routine from which you are calling the function GetDataBrowserItemDataIcon
.
On input, a pointer to an IconRef
variable. On return, the variable is set to the icon that is displayed. You are responsible for disposing of the IconRef
.
A result code. See “Data Browser Result Codes.”
You call the function GetDataBrowserItemDataIcon
from within a DataBrowserItemDataProcPtr
callback routine to obtain the icon drawn in a column that has the kDataBrowserIconType
display type or the kDataBrowserIconAndTextType
display type.
HIDataBrowser.h
Obtains the transformation currently used to display an icon.
OSStatus GetDataBrowserItemDataIconTransform ( DataBrowserItemDataRef itemData, IconTransformType *theData );
The item data reference for the item whose icon transformation you want to obtain. This value is passed to the callback routine from which you are calling the function GetDataBrowserItemDataIconTransform
.
On input, an icon transformation type variable. On return, the variable is set to an icon transformation type. This value can be any of the icon transformation constants defined by Icon Services and Utilities. See Icon Services and Utilities Reference for more information.
A result code. See “Data Browser Result Codes.”
This function works only with items that have either the property kDataBrowserIconAndTextType
or kDataBrowserIconType
.
HIDataBrowser.h
Obtains the item ID for an item whose property is another item’s ID.
OSStatus GetDataBrowserItemDataItemID ( DataBrowserItemDataRef itemData, DataBrowserItemID *theData );
The item data reference passed to your item-data callback.
On input, a pointer to an item ID variable. On return, the variable is set to the item ID associated with the itemData
parameter.
A result code. See “Data Browser Result Codes.”
Typically you do not need to call this function. This function is used for item properties kDataBrowserParentContainerProperty
or kDataBrowserContainerAliasIDProperty
.
HIDataBrowser.h
Obtains, as a 64-bit value, the date and time value displayed.
OSStatus GetDataBrowserItemDataLongDateTime ( DataBrowserItemDataRef itemData, LongDateTime *theData );
The item data reference for the item whose long date and time value you want to obtain. The item data reference is passed to the callback routine from which you are calling the function GetDataBrowserItemDataLongDateTime
.
On input, a 64-bit value. On return, the value is set to the number of seconds elapsed since midnight, January 1, 1904. For more information about date and time encodings used in the Mac OS, see Date, Time, and Measurement Utilities Reference in Carbon Text & International Documentation.
A result code. See “Data Browser Result Codes.”
This function works only with items that have the property kDataBrowserDateTimeType
. If the column has the property kDataBrowserRelativeDateTime
, the date is displayed relative to the current time for the computer. For example, a time 24 hours prior to the current time is displayed as “Yesterday.” Other examples of relative date and time values are “Today, 1:45 PM” and “Yesterday, 7:30 AM.”
HIDataBrowser.h
Obtains the maximum integer value that can be displayed; useful for such display types as sliders, progress bars, relevance indicators, and pop-up menus.
OSStatus GetDataBrowserItemDataMaximum ( DataBrowserItemDataRef itemData, SInt32 *theData );
The item data reference for the item whose maximum value you want to obtain. The item data reference is passed to the callback routine from which you are calling the function GetDataBrowserItemDataMaximum
.
On input, a pointer to a signed 32-bit integer. On return, this value is set to the maximum value that can be displayed for the item.
A result code. See “Data Browser Result Codes.”
HIDataBrowser.h
Obtains the pop-up menu displayed.
OSStatus GetDataBrowserItemDataMenuRef ( DataBrowserItemDataRef itemData, MenuRef *theData );
The item data reference for the item whose pop-up menu you want to obtain. The item data reference is passed to the callback routine from which you are calling the function GetDataBrowserItemDataMenuRef
.
On input, a pointer to a menu reference. On return, this is set to the currently displayed pop-up menu. The system retains the menu reference that you pass; you must release it when you no longer need it.
A result code. See “Data Browser Result Codes.”
Your item-data callback calls this function in response to a get-data request for items that have the display type kDataBrowserPopupMenuType
.
HIDataBrowser.h
Obtains the minimum integer value that can be displayed for an item; useful for such display types as sliders, progress bars, relevance indicators, and pop-up menus.
OSStatus GetDataBrowserItemDataMinimum ( DataBrowserItemDataRef itemData, SInt32 *theData );
The item data reference for the item whose minimum value you want to obtain. The item data reference is passed to the callback routine from which you are calling the function GetDataBrowserItemDataMinimum
.
On input, a pointer to a signed 32-bit integer. On return, this value is set to the minimum value that can be displayed for the item.
A result code. See “Data Browser Result Codes.”
HIDataBrowser.h
Obtains the column property ID for the column in which an item resides.
OSStatus GetDataBrowserItemDataProperty ( DataBrowserItemDataRef itemData, DataBrowserPropertyID *theData );
The item data reference for the item whose property ID you want to obtain. This value is passed to the callback routine from which you are calling the function GetDataBrowserItemDataProperty
.
On input, a pointer to a property ID variable. On return, the variable is set to the property ID for the item.
A result code. See “Data Browser Result Codes.”
When your item-data callback is invoked for an item that has the property kDataBrowserItemIsEditableProperty
, you call the function GetDataBrowserItemDataProperty
to obtain the column property ID. Then, your callback can use the column property ID to determine whether the item is in a column whose data can be edited.
For example, consider a list view data browser whose columns are titled “Name” and “Date Modified.” Let’s say Name can be modified by the user, but the Date Modified column cannot. If the user clicks an item in one of the columns, your item-data callback is called to find out whether the clicked column is editable. Your callback needs to find out which column the “is editable” request is being made for by calling the function GetDataBrowserItemDataProperty
. In this example, after you obtain the property ID, you would check whether the column is the Date Modified column or the Name column. You’d allow editing only if the item is in the Name column.
HIDataBrowser.h
Obtains the color used to draw an item.
OSStatus GetDataBrowserItemDataRGBColor ( DataBrowserItemDataRef itemData, RGBColor *theData );
The item data reference for the item whose color you want to obtain. This value is passed to the callback routine from which you are calling the function GetDataBrowserItemDataRGBColor
.
On input, an RGB color variable. On return, the variable is set to the RGB values that specify the color of the item.
A result code. See “Data Browser Result Codes.”
Your item-data callback calls this function in response to a get-data request for items that have the display type kDataBrowserIconType
or kDataBrowserIconAndTextType
.
As of Mac OS X 10.3, this function does nothing.
HIDataBrowser.h
Obtains the text entered by the user.
OSStatus GetDataBrowserItemDataText ( DataBrowserItemDataRef itemData, CFStringRef *theData );
The item data reference for the item whose text you want to obtain. This value is passed to the callback routine from which you are calling the function GetDataBrowserItemDataText
.
On input, a CFStringRef
variable. On return, a CFString object that contains the text. Your application must release the CFString object when it is no longer needed.
A result code. See “Data Browser Result Codes.”
You can call the function GetDataBrowserItemDataText
from inside an item-data callback routine when the callback’s setValue
parameter is true
. A value of true
indicates that the displayed text has been modified by the user. In that case, your application calls GetDataBrowserItemDataText
to retrieve the modified text.
Note that a column is editable only if the kDataBrowserPropertyIsEditable
flag is set for the column.
HIDataBrowser.h
Obtains the value of an item; useful for such display types as sliders, progress bars, relevance indicators, and pop-up menus.
OSStatus GetDataBrowserItemDataValue ( DataBrowserItemDataRef itemData, SInt32 *theData );
The item data reference for the item whose integer value you want to obtain. The item data reference is passed to the callback routine from which you are calling the function GetDataBrowserItemDataValue
.
On input, a pointer to a signed 32-bit integer. On return, it is set to the displayed value.
A result code. See “Data Browser Result Codes.”
Your application calls the function GetDataBrowserItemDataValue
to obtain a new value for a display type when your item-data callback routine is called with the setValue
parameter set to true
.
HIDataBrowser.h
Obtains the bounds of a visual part of an item.
OSStatus GetDataBrowserItemPartBounds ( ControlRef browser, DataBrowserItemID item, DataBrowserPropertyID property, DataBrowserPropertyPart part, Rect *bounds );
A data browser.
The item ID that identifies the row.
The property ID that identifies the column.
The part for which you want to obtain information. The information requested depends on the type of information displayed in the column. It is up to your application to ensure it requests the appropriate information. See “Property Parts” for a list of the constants you can provide in this parameter.
On input, a pointer to a rectangle. On return, the rectangle contains the bounds for the specified part.
A result code. If the item is not visible (scrolled off the screen), returns the result ItemNotFound
. See “Data Browser Result Codes.”
HIDataBrowser.h
Obtains a list of the items that match a specified state; operates on items in the root container or traverses items in the data hierarchy.
OSStatus GetDataBrowserItems ( ControlRef browser, DataBrowserItemID container, Boolean recurse, DataBrowserItemState state, Handle items );
A data browser.
An item ID or the constant kDataBrowserNoItem
. To obtain a list of items that are organized as subitems of a container, pass the item ID of the container item. To obtain a list of items displayed in the root container, pass the constant kDataBrowserNoItem
.
A value that indicates whether or not to traverse the entire item hierarchy when obtaining item IDs. Pass true
to obtain item IDs for all items in the hierarchy. Pass false
if you want to count only those item IDs at the top level of the container. If you pass true
, you obtain a flattened list of item IDs. The list reflects the hierarchy maintained internally by the data browser and might not reflect the order of the items as they appear onscreen to the user.
The state of the items to obtain. Only items that have this state are returned in the items
parameter. Pass 0
if you want to obtain all items regardless of state. Otherwise, pass one of the constants described in “Item States.”
On return, the contents of the handle contain an array of item ID values for the matching items. You must allocate and dispose of the handle. To determine the number of items in the array, call the function GetHandleSize
and divide by the size of DataBrowserItemID
. Note that the handle contents are completely replaced by the returned array.
A result code. See “Data Browser Result Codes.”
The function GetDataBrowserItems
is a powerful routine for gathering information about the items displayed in a data browser. For example, to obtain a list of all the items the user has selected in a list, call the function with the state
parameter set to kDataBrowserItemIsSelected
. If your application is interested only in determining the number of items in a selection (and not the item IDs of those items), call the function GetDataBrowserItemCount
.
HIDataBrowser.h
Obtains the state of an item.
OSStatus GetDataBrowserItemState ( ControlRef browser, DataBrowserItemID item, DataBrowserItemState *state );
A data browser.
The item ID of the item whose state you want to check.
On input, a pointer to an item state variable. On return, the variable is set to a value that specifies the state of the item. See “Item States” for a description of the values that can be returned.
A result code. See “Data Browser Result Codes.”
HIDataBrowser.h
Obtains the property ID of the column whose items can display a disclosure triangle, and tells whether a disclosed item expands the row or adds rows.
OSStatus GetDataBrowserListViewDisclosureColumn ( ControlRef browser, DataBrowserTableViewColumnID *column, Boolean *expandableRows );
A data browser.
On input, a pointer to a column ID variable. On return, the variable is set to the property ID of the currently selected column. If there is no disclosure column, the variable is set to kDataBrowserItemNoProperty
. The DataBrowserTableViewColumnID
data type is the same as the DataBrowserPropertyID
data type.
On input, a pointer to a Boolean variable. On return, the variable specifies how a disclosed row behaves. The value true
means that a container opens as a single row with an expanded height. The value false
means a container opens to expose individual rows. See the Discussion for more details on expandable rows.
A result code. See “Data Browser Result Codes.”
When the expandableRows
variable is set to true
:
Disclosure triangles are drawn top-justified in the row.
Custom row height, if any, for that row is respected only while the row is disclosed. At other times, the default row height is used.
When the expandableRows
variable is set to false
:
Disclosure triangles are centered vertically in the row.
Custom row height, if any, for that row is always respected.
HIDataBrowser.h
Obtains the height of the rectangular area where the column title appears.
OSStatus GetDataBrowserListViewHeaderBtnHeight ( ControlRef browser, UInt16 *height );
A data browser.
On input, a pointer to an unsigned 16-bit integer. On return, this value is set to the height of the rectangular area where the column title appears. You can save this value if you plan to call the function SetDataBrowserListViewHeaderBtnHeight
to turn off header button display. You can then use the value later to turn on header button display.
A result code. See “Data Browser Result Codes.”
HIDataBrowser.h
Obtains a header description for a column in list view.
OSStatus GetDataBrowserListViewHeaderDesc ( ControlRef browser, DataBrowserTableViewColumnID column, DataBrowserListViewHeaderDesc *desc );
A data browser.
The property ID for the column whose list view header description you want to obtain. The DataBrowserTableViewColumnID
data type is the same as the DataBrowserPropertyID
data type.
On input, a pointer to a list view header description data structure. On return, the structure contains the header description for the specified column in list view.
A result code. See “Data Browser Result Codes.”
If your application allows the user to switch between column and list views, you can call this function to obtain the current header description and then save the description before you switch from list to column view. When you switch from column to list view, you can restore the list view header information by calling the function SetDataBrowserListViewHeaderDesc
passing the header information you saved.
HIDataBrowser.h
Determines whether list view is set to use a plain white background.
OSStatus GetDataBrowserListViewUsePlainBackground ( ControlRef browser, Boolean *usePlainBackground );
A data browser.
On input, a pointer to a Boolean variable. On return, the variable is true
if list view is set to use a plain white background. Regardless of the value that is returned, Mac OS X supports only a plain white background. Mac OS 9 supports a plain white background as well as a shaded background.
A result code. See “Data Browser Result Codes.”
HIDataBrowser.h
Obtains the appearance and behavior attributes for a column.
OSStatus GetDataBrowserPropertyFlags ( ControlRef browser, DataBrowserPropertyID property, DataBrowserPropertyFlags *flags );
A data browser.
The property ID of the column whose properties you want to obtain.
On input, a data browser property flags variable. On return, the variable is set to the property flags that specify the appearance and behavior attributes for a column. A DataBrowserPropertyFlags
value is a 32-bit value that is divided into four parts as follows:
Bits 0–7 specify properties applied to the data browser as a whole—see “Property Flags: Universal”
Bits 8–15 modify display behavior—see “Property Flags: Modifiers”
Bits 16–23 are properties specific to list view—see “Property Flags: Offset and Mask for List View Properties” and “Property Flags: List View Column Behavior”
Bits 24–31 can be defined by your application—see “Property Flags: Offset and Mask for Client-Defined Properties”
A result code. See “Data Browser Result Codes.”
HIDataBrowser.h
Obtains the inset rectangle used by a data browser to position the scroll bar.
OSStatus GetDataBrowserScrollBarInset ( ControlRef browser, Rect *insetRect );
A data browser.
On input, a pointer to a rectangle structure. On return, the rectangle contains the current inset settings for the data browser scroll bars. The left
and right
fields contain the horizontal inset values for the horizontal scroll bar, and the top
and bottom
fields contain the vertical inset values for the vertical scroll bar.
A result code. See “Data Browser Result Codes.”
Your application can call the functions GetDataBrowserScrollBarInset
and SetDataBrowserScrollBarInset
if you want to place placards or controls beside the horizontal scroll bars or above the vertical ones. To do so, first call GetDataBrowserScrollBarInset
to obtain the current settings. After modifying the current inset settings to provide space for the placard or control, call SetDataBrowserScrollBarInset
with the new values.
HIDataBrowser.h
Obtains the scrolling position of a list.
OSStatus GetDataBrowserScrollPosition ( ControlRef browser, UInt32 *top, UInt32 *left );
A data browser.
On input, a pointer to an unsigned 32-bit integer. On return, this value is set to the current vertical scrolling position.
On input, a pointer to an unsigned 32-bit integer. On return, this value is set to the current horizontal scrolling position.
A result code. See “Data Browser Result Codes.”
Normally, you use the function GetDataBrowserScrollPosition
in conjunction with SetDataBrowserScrollPosition
to save and restore the scrolling position of a list to the user’s last scrolling position. These functions should not be used to scroll particular cells into the view. For that, call the function RevealDataBrowserItem
.
HIDataBrowser.h
Obtains the first and last items in a selection.
OSStatus GetDataBrowserSelectionAnchor ( ControlRef browser, DataBrowserItemID *first, DataBrowserItemID *last );
A data browser.
On input, a pointer to an item ID variable. On return, the variable is set to the item ID of the first item in the selection.
On input, a pointer to an item ID variable. On return, the variable is set to the item ID of the last item in the selection.
A result code. See “Data Browser Result Codes.”
HIDataBrowser.h
Obtains the current selection behavior for a data browser.
OSStatus GetDataBrowserSelectionFlags ( ControlRef browser, DataBrowserSelectionFlags *selectionFlags );
A data browser.
On input, a data browser selection flags variable. On return, the variable is set to the current selection flags. See “User Selection Flags” for a list of the flags that can be returned.
A result code. See “Data Browser Result Codes.”
Selection flags specify the selection behavior available to the user, such as whether the user can select discontinuous items.
HIDataBrowser.h
Gets the sorting order of the list view column that’s currently set for sorting.
OSStatus GetDataBrowserSortOrder ( ControlRef browser, DataBrowserSortOrder *order );
A data browser.
On input, a pointer to a sorting order variable. On return, the variable is set to the sorting order of the current sort column in list view. See “Sorting Orders” for a list of the values that can be returned.
A result code. See “Data Browser Result Codes.”
HIDataBrowser.h
Obtains the property ID of the column currently used for sorting in list view.
OSStatus GetDataBrowserSortProperty ( ControlRef browser, DataBrowserPropertyID *property );
A data browser.
On input, a pointer to a property ID variable. On return, the variable is set to the property ID of the column used for sorting.
A result code. See “Data Browser Result Codes.”
You can call the function GetDataBrowserSortProperty
to discover the property ID of the column currently used for sorting. To designate another column for the sorting operation, call the function SetDataBrowserSortProperty
.
HIDataBrowser.h
Obtains the number of columns in a data browser.
OSStatus GetDataBrowserTableViewColumnCount ( ControlRef browser, UInt32 *numColumns );
A data browser.
On input, a pointer to an unsigned 32-bit integer. On return, this value is set to the number of columns in the data browser.
A result code. See “Data Browser Result Codes.”
HIDataBrowser.h
Obtains the column position for an item in a data browser.
OSStatus GetDataBrowserTableViewColumnPosition ( ControlRef browser, DataBrowserTableViewColumnID column, DataBrowserTableViewColumnIndex *position );
A data browser.
The property ID for the list view column for which you want to obtain the position. The DataBrowserTableViewColumnID
data type is the same as the DataBrowserPropertyID
data type.
On input, a pointer to a column index variable. On return, the variable is set to the column index for the item; 0
is the leftmost column.
A result code. See “Data Browser Result Codes.”
HIDataBrowser.h
Obtains the property ID for a column in a data browser.
OSStatus GetDataBrowserTableViewColumnProperty ( ControlRef browser, DataBrowserTableViewColumnIndex column, DataBrowserTableViewColumnID *property );
A data browser.
The column index of the column whose property ID you want to obtain.
On input, a pointer to a column ID variable. On return, the variable is set to the property ID for the column. The DataBrowserTableViewColumnID
data type is the same as the DataBrowserPropertyID
data type.
A result code. See “Data Browser Result Codes.”
HIDataBrowser.h
Obtains the default column width used for all columns in a data browser.
OSStatus GetDataBrowserTableViewColumnWidth ( ControlRef browser, UInt16 *width );
A data browser.
On input, a pointer to an unsigned 16-bit integer. On return, this value is set to the column width, in pixels.
A result code. See “Data Browser Result Codes.”
HIDataBrowser.h
Determines whether columns and rows are set to have variable widths.
OSStatus GetDataBrowserTableViewGeometry ( ControlRef browser, Boolean *variableWidthColumns, Boolean *variableHeightRows );
A data browser.
On input, a pointer to a Boolean variable. On return, the variable is set to true
if column widths can be changed or false
if they cannot be changed.
On input, a pointer to a Boolean variable. On return, the variable is set to true
if row heights can be changed or false
if they cannot be changed.
A result code. See “Data Browser Result Codes.”
HIDataBrowser.h
Obtains the highlighting style used for a list view data browser.
OSStatus GetDataBrowserTableViewHiliteStyle ( ControlRef browser, DataBrowserTableViewHiliteStyle *hiliteStyle );
A list view data browser.
On input, a pointer to a highlighting style variable. On return, the variable is set to the highlighting style in use. See “Table View Highlighting Styles” for a description of the values that can be returned.
A result code. See “Data Browser Result Codes.”
HIDataBrowser.h
Obtains the item ID for the item displayed in the specified row.
OSStatus GetDataBrowserTableViewItemID ( ControlRef browser, DataBrowserTableViewRowIndex row, DataBrowserItemID *item );
A data browser.
The row index for the item. The row index is the visual order of rows in the table onscreen. Rows are numbered starting at the top of the table, with the value 0
, and proceeding sequentially to the bottom of the table.
On input, a pointer to an item ID variable. On return, the variable is set to the item ID of the data displayed in the row.
A result code. See “Data Browser Result Codes.”
This function is useful only in edge case situations for which you need to know what item ID is displayed in a particular row. For example, if you are performing some fairly involved and complex custom hit-testing, you might need to call this function.
HIDataBrowser.h
Obtains the visual position for the specified item in list view.
OSStatus GetDataBrowserTableViewItemRow ( ControlRef browser, DataBrowserItemID item, DataBrowserTableViewRowIndex *row );
A data browser.
The item ID for the item whose row index you want to obtain.
On input, a pointer to a row index variable. On return, the variable is set to the row index for the item.
A result code. See “Data Browser Result Codes.”
You can use this function for items in list view. It is the inverse of the function GetDataBrowserTableViewItemID
.
HIDataBrowser.h
Obtains the row height for a single row in a list view data browser.
OSStatus GetDataBrowserTableViewItemRowHeight ( ControlRef browser, DataBrowserItemID item, UInt16 *height );
A data browser.
The item ID of the item whose row height you want to obtain.
On input, a pointer to an unsigned 16-bit integer. On return, this value is set to the row height, in pixels.
A result code. See “Data Browser Result Codes.”
HIDataBrowser.h
Obtains the column width for a single column in a data browser.
OSStatus GetDataBrowserTableViewNamedColumnWidth ( ControlRef browser, DataBrowserTableViewColumnID column, UInt16 *width );
A data browser.
The property ID for the list view column whose width you want to obtain. The DataBrowserTableViewColumnID
data type is the same as the DataBrowserPropertyID
data type.
On input, a pointer to an unsigned 16-bit integer. On return, this value is set to the width of the column, in pixels.
A result code. See “Data Browser Result Codes.”
HIDataBrowser.h
Obtains the default row height used for all rows in a data browser.
OSStatus GetDataBrowserTableViewRowHeight ( ControlRef browser, UInt16 *height );
A data browser.
On input, a pointer to an unsigned 16-bit integer. On return, this value is set to the row height, in pixels.
A result code. See “Data Browser Result Codes.”
HIDataBrowser.h
Obtains the target for the data browser
OSStatus GetDataBrowserTarget ( ControlRef browser, DataBrowserItemID *target );
A data browser.
On input, a pointer to an item ID variable. On return, the variable is set to the item ID for the currently assigned target.
A result code. See “Data Browser Result Codes.”
In column view, the target is the rightmost column. In list view, the target can be thought of as the root container.
Your application can call the function SetDataBrowserTarget
to set an item ID to use as a target if you do not want to use the default target set by the data browser.
HIDataBrowser.h
Obtains the current view style settings for a list view.
OSStatus GetDataBrowserUserState ( ControlRef browser, CFDictionaryRef *stateInfo );
A data browser.
On input, a pointer to a CFDictionaryRef
. On return, a CFDictionary object that contains the current view style settings. You must release the object when you no longer need it by calling the function CFRelease
. Note that although this parameter is typed as a CFData object, you must treat the result as a CFDictionary object because that is what the system fills out and returns to you.
A result code. See “Data Browser Result Codes.”
You typically use this function to obtain the current user settings for the data browser so that you can save the settings to a preferences file. User settings include data such as sorting order, sorting column, and column widths. Later, you can restore the settings by calling the function SetDataBrowserUserState
.
If you want to save the user settings to disk, you need to determine the length of the user-settings data in bytes. The following code shows how to calculate this length. First you need to convert the CFDictionary object you obtain from the function GetDataBrowserUserState
to a property list. Then you can call the function CFDataGetLength
to obtain the length, in bytes, of the property list.
CFDataRef myUserState = NULL; |
OSStatus status; |
ControlRef browser = GetDataBrowserFromWindow (window); |
status = GetDataBrowserUserState (browser, &myUserState); |
if (noErr == status) |
{ |
CFDataRef myTempDataRef = NULL; |
CFIndex index; |
if (myUserState != NULL) |
{ |
// Convert the user state dictionary to a property list. |
myTempDataRef = CFPropertyListCreateXMLData (NULL, |
(CFPropertyListRef) myUserState); |
if (myTempDataRef != NULL) |
{ |
// Get the length, in bytes |
index = CFDataGetLength (myTempDataRef); |
// Call your function to save the data |
// You need to release the CFDataRef you created |
CFRelease (myTempDataRef); |
} |
} |
CFRelease (myUserState); |
} |
HIDataBrowser.h
Obtains the current view style for the specified data browser.
OSStatus GetDataBrowserViewStyle ( ControlRef browser, DataBrowserViewStyle *style );
A data browser.
On input, a pointer to a view style variable. On return, the variable is set to the current view style for the specified data browser; can be either list view (kDataBrowserListView
) or column view (kDataBrowserColumnView
). See “View Styles” for more information on these constants.
A result code. See “Data Browser Result Codes.”
HIDataBrowser.h
Initializes a data browser callback structure in preparation for adding your own callbacks to the structure.
OSStatus InitDataBrowserCallbacks ( DataBrowserCallbacks *callbacks );
A pointer to a DataBrowserCallbacks
structure. Before calling the function InitDataBrowserCallbacks
, set the version
field of this structure to kDataBrowserLatestCallbacks
. On return, the fields in this structure are set to NULL
.
A result code. See “Data Browser Result Codes.”
After you call this function, set the appropriate fields in the DataBrowserCallbacks
structure to your callbacks. The DataBrowserCallbacks
structure contains fields for the following:
DataBrowserItemNotificationProcPtr
or DataBrowserItemNotificationWithItemProcPtr
(Mac OS X only)
After you assign your callbacks to the appropriate field, call the function SetDataBrowserCallbacks
.
Note that this is a different set of callbacks from those that are assigned to fields in the DataBrowserCustomCallbacks
data structure.
HIDataBrowser.h
Initializes the data browser custom callback structure in preparation for adding your own callbacks for custom drawing or custom behavior to the structure.
OSStatus InitDataBrowserCustomCallbacks ( DataBrowserCustomCallbacks *callbacks );
A pointer to a DataBrowserCustomCallbacks
structure. Before calling the function InitDataBrowserCustomCallbacks
, set the version
field of this structure to kDataBrowserLatestCustomCallbacks
. On return, the fields in this structure are set to NULL
.
A result code. See “Data Browser Result Codes.”
Custom callbacks refer to those callback routines that are used to implement custom drawing or custom behavior in your data browser. The data browser API supports a limited set of built-in display types: text, icon and text, checkboxes, and so forth. If you want to display something else, you install custom callbacks to perform drawing and handle user interaction.
After you call the function InitDataBrowserCustomCallbacks
, set the appropriate fields in the DataBrowserCustomCallbacks
structure to your callbacks. The DataBrowserCustomCallbacks
structure contains fields for the following:
After you assign your custom callbacks to the appropriate field, call the function SetDataBrowserCustomCallbacks
.
Note that this is a different set of callbacks from those that are assigned to fields in the DataBrowserCallbacks
data structure.
HIDataBrowser.h
Calls an accept-drag callback function.
Boolean InvokeDataBrowserAcceptDragUPP ( ControlRef browser, DragReference theDrag, DataBrowserItemID item, DataBrowserAcceptDragUPP userUPP );
In most cases you do not need to use this function, because the system invokes your callback function for you. See the DataBrowserAcceptDragProcPtr
callback function for more information and for a description of the parameters.
HIDataBrowser.h
Calls an add-drag-item callback function.
Boolean InvokeDataBrowserAddDragItemUPP ( ControlRef browser, DragReference theDrag, DataBrowserItemID item, ItemReference *itemRef, DataBrowserAddDragItemUPP userUPP );
In most cases you do not need to use this function, because the system invokes your callback function for you. See the DataBrowserAddDragItemProcPtr
callback function for more information and for a description of the parameters.
HIDataBrowser.h
Calls a draw-item callback function.
void InvokeDataBrowserDrawItemUPP ( ControlRef browser, DataBrowserItemID item, DataBrowserPropertyID property, DataBrowserItemState itemState, const Rect *theRect, SInt16 gdDepth, Boolean colorDevice, DataBrowserDrawItemUPP userUPP );
In most cases you do not need to use this function, because the system invokes your callback function for you. See the DataBrowserDrawItemProcPtr
callback function for more information and for a description of the parameters.
HIDataBrowser.h
Calls an edit-item callback function.
Boolean InvokeDataBrowserEditItemUPP ( ControlRef browser, DataBrowserItemID item, DataBrowserPropertyID property, CFStringRef theString, Rect *maxEditTextRect, Boolean *shrinkToFit, DataBrowserEditItemUPP userUPP );
In most cases you do not need to use this function, because the system invokes your callback function for you. See the DataBrowserEditItemProcPtr
callback function for more information and for a description of the parameters.
HIDataBrowser.h
Calls a get-contextual-menu callback function.
void InvokeDataBrowserGetContextualMenuUPP ( ControlRef browser, MenuRef *menu, UInt32 *helpType, CFStringRef *helpItemString, AEDesc *selection, DataBrowserGetContextualMenuUPP userUPP );
In most cases you do not need to use this function, because the system invokes your callback function for you. See the DataBrowserGetContextualMenuProcPtr
callback function for more information and for a description of the parameters.
HIDataBrowser.h
Calls a hit-test callback function.
Boolean InvokeDataBrowserHitTestUPP ( ControlRef browser, DataBrowserItemID itemID, DataBrowserPropertyID property, const Rect *theRect, const Rect *mouseRect, DataBrowserHitTestUPP userUPP );
In most cases you do not need to use this function, because the system invokes your callback function for you. See the DataBrowserHitTestProcPtr
callback function for more information and for a description of the parameters.
HIDataBrowser.h
Calls an item-accept-drag callback function.
DataBrowserDragFlags InvokeDataBrowserItemAcceptDragUPP ( ControlRef browser, DataBrowserItemID itemID, DataBrowserPropertyID property, const Rect *theRect, DragReference theDrag, DataBrowserItemAcceptDragUPP userUPP );
In most cases you do not need to use this function, because the system invokes your callback function for you. See the DataBrowserItemAcceptDragProcPtr
callback function for more information and for a description of the parameters.
HIDataBrowser.h
Calls an item-comparison callback function.
Boolean InvokeDataBrowserItemCompareUPP ( ControlRef browser, DataBrowserItemID itemOne, DataBrowserItemID itemTwo, DataBrowserPropertyID sortProperty, DataBrowserItemCompareUPP userUPP );
In most cases you do not need to use this function, because the system invokes your callback function for you. See the DataBrowserItemCompareProcPtr
callback function for more information and for a description of the parameters.
HIDataBrowser.h
Calls an item-data callback function.
OSStatus InvokeDataBrowserItemDataUPP ( ControlRef browser, DataBrowserItemID item, DataBrowserPropertyID property, DataBrowserItemDataRef itemData, Boolean setValue, DataBrowserItemDataUPP userUPP );
In most cases you do not need to use this function, because the system invokes your callback function for you. See the DataBrowserItemDataProcPtr
callback function for more information and for a description of the parameters.
HIDataBrowser.h
Calls an item-drag-region callback function.
void InvokeDataBrowserItemDragRgnUPP ( ControlRef browser, DataBrowserItemID itemID, DataBrowserPropertyID property, const Rect *theRect, RgnHandle dragRgn, DataBrowserItemDragRgnUPP userUPP );
In most cases you do not need to use this function, because the system invokes your callback function for you. See the DataBrowserItemDragRgnProcPtr
callback function for more information and for a description of the parameters.
HIDataBrowser.h
Calls an item-help-content callback function.
void InvokeDataBrowserItemHelpContentUPP ( ControlRef browser, DataBrowserItemID item, DataBrowserPropertyID property, HMContentRequest inRequest, HMContentProvidedType *outContentProvided, HMHelpContentRec *ioHelpContent, DataBrowserItemHelpContentUPP userUPP );
In most cases you do not need to use this function, because the system invokes your callback function for you. See the DataBrowserItemHelpContentProcPtr
callback function for more information and for a description of the parameters.
HIDataBrowser.h
Calls an item-notification callback function.
void InvokeDataBrowserItemNotificationUPP ( ControlRef browser, DataBrowserItemID item, DataBrowserItemNotification message, DataBrowserItemNotificationUPP userUPP );
In most cases you don’t need to use this function, because the system invokes your callback function for you. See the DataBrowserItemNotificationProcPtr
callback function for more information and for a description of the parameters.
HIDataBrowser.h
Calls an item-notification-with-data callback function.
void InvokeDataBrowserItemNotificationWithItemUPP ( ControlRef browser, DataBrowserItemID item, DataBrowserItemNotification message, DataBrowserItemDataRef itemData, DataBrowserItemNotificationWithItemUPP userUPP );
In most cases you don’t need to use this function, because the system invokes your callback function for you. See the DataBrowserItemNotificationWithItemProcPtr
callback function for more information and for a description of the parameters.
HIDataBrowser.h
Calls an item-receive-drag callback function.
Boolean InvokeDataBrowserItemReceiveDragUPP ( ControlRef browser, DataBrowserItemID itemID, DataBrowserPropertyID property, DataBrowserDragFlags dragFlags, DragReference theDrag, DataBrowserItemReceiveDragUPP userUPP );
In most cases you do not need to use this function, because the system invokes your callback function for you. See the DataBrowserItemReceiveDragProcPtr
callback function for more information and for a description of the parameters.
HIDataBrowser.h
Calls an item-iterator callback function.
void InvokeDataBrowserItemUPP ( DataBrowserItemID item, DataBrowserItemState state, void *clientData, DataBrowserItemUPP userUPP );
In most cases you do not need to use this function, because the system invokes your callback function for you. See the DataBrowserItemProcPtr
callback function for more information and for a description of the parameters.
HIDataBrowser.h
Calls a postprocess-drag callback function.
void InvokeDataBrowserPostProcessDragUPP ( ControlRef browser, DragReference theDrag, OSStatus trackDragResult, DataBrowserPostProcessDragUPP userUPP );
In most cases you do not need to use this function, because the system invokes your callback function for you. See the DataBrowserPostProcessDragProcPtr
callback function for more information and for a description of the parameters.
HIDataBrowser.h
Calls a receive-drag callback function.
Boolean InvokeDataBrowserReceiveDragUPP ( ControlRef browser, DragReference theDrag, DataBrowserItemID item, DataBrowserReceiveDragUPP userUPP );
In most cases you do not need to use this function, because the system invokes your callback function for you. See the DataBrowserReceiveDragProcPtr
callback function for more information and for a description of the parameters.
HIDataBrowser.h
Calls a select-contextual-menu callback function.
void InvokeDataBrowserSelectContextualMenuUPP ( ControlRef browser, MenuRef menu, UInt32 selectionType, SInt16 menuID, MenuItemIndex menuItem, DataBrowserSelectContextualMenuUPP userUPP );
In most cases you do not need to use this function, because the system invokes your callback function for you. See the DataBrowserSelectContextualMenuProcPtr
callback function for more information and for a description of the parameters.
HIDataBrowser.h
Calls a tracking callback function.
DataBrowserTrackingResult InvokeDataBrowserTrackingUPP ( ControlRef browser, DataBrowserItemID itemID, DataBrowserPropertyID property, const Rect *theRect, Point startPt, EventModifiers modifiers, DataBrowserTrackingUPP userUPP );
In most cases you do not need to use this function, because the system invokes your callback function for you. See the DataBrowserTrackingProcPtr
callback function for more information and for a description of the parameters.
HIDataBrowser.h
Checks to see if a data item is selected.
Boolean IsDataBrowserItemSelected ( ControlRef browser, DataBrowserItemID item );
A data browser.
The item ID of the item to check.
A value of true
if the item is a member of the current selection.
HIDataBrowser.h
Moves or extends the current selection.
OSStatus MoveDataBrowserSelectionAnchor ( ControlRef browser, DataBrowserSelectionAnchorDirection direction, Boolean extendSelection );
A data browser.
The direction to move or extend the current selection. You can pass any one of the constants described in “Selection Anchor Directions.”
On input, a value that specifies whether to extend the current selection (true
) or move the selection (false
).
A result code. See “Data Browser Result Codes.”
HIDataBrowser.h
Creates a universal procedure pointer to an accept-drag callback function.
DataBrowserAcceptDragUPP NewDataBrowserAcceptDragUPP ( DataBrowserAcceptDragProcPtr userRoutine );
A pointer to your accept-drag callback function.
The universal procedure pointer.
See the DataBrowserAcceptDragProcPtr
callback function.
HIDataBrowser.h
Creates a universal procedure pointer to an add-drag-item callback function.
DataBrowserAddDragItemUPP NewDataBrowserAddDragItemUPP ( DataBrowserAddDragItemProcPtr userRoutine );
A pointer to your add-drag-item callback function.
The universal procedure pointer.
See the DataBrowserAddDragItemProcPtr
callback function.
HIDataBrowser.h
Creates a universal procedure pointer to a draw-item callback function.
DataBrowserDrawItemUPP NewDataBrowserDrawItemUPP ( DataBrowserDrawItemProcPtr userRoutine );
A pointer to your draw-item callback function.
The universal procedure pointer.
See the DataBrowserDrawItemProcPtr
callback function.
HIDataBrowser.h
Creates a universal procedure pointer to an edit-item callback function.
DataBrowserEditItemUPP NewDataBrowserEditItemUPP ( DataBrowserEditItemProcPtr userRoutine );
A pointer to your edit-item callback function.
The universal procedure pointer.
See the DataBrowserEditItemProcPtr
callback function.
HIDataBrowser.h
Creates a universal procedure pointer to a get-contextual-menu callback function.
DataBrowserGetContextualMenuUPP NewDataBrowserGetContextualMenuUPP ( DataBrowserGetContextualMenuProcPtr userRoutine );
A pointer to your get-contextual-menu callback function.
The universal procedure pointer.
See the DataBrowserGetContextualMenuProcPtr
callback function.
HIDataBrowser.h
Creates a universal procedure pointer to a hit-test callback function.
DataBrowserHitTestUPP NewDataBrowserHitTestUPP ( DataBrowserHitTestProcPtr userRoutine );
A pointer to your hit-test callback function.
The universal procedure pointer.
See the DataBrowserHitTestProcPtr
callback function.
HIDataBrowser.h
Creates a universal procedure pointer to an item-accept-drag callback function.
DataBrowserItemAcceptDragUPP NewDataBrowserItemAcceptDragUPP ( DataBrowserItemAcceptDragProcPtr userRoutine );
A pointer to your item-accept-drag callback function.
The universal procedure pointer.
See the DataBrowserItemAcceptDragProcPtr
callback function.
HIDataBrowser.h
Creates a universal procedure pointer to an item-comparison callback function.
DataBrowserItemCompareUPP NewDataBrowserItemCompareUPP ( DataBrowserItemCompareProcPtr userRoutine );
A pointer to your item-comparison callback function.
The universal procedure pointer.
See the DataBrowserItemCompareProcPtr
callback function.
HIDataBrowser.h
Creates a universal procedure pointer to an item-data callback function.
DataBrowserItemDataUPP NewDataBrowserItemDataUPP ( DataBrowserItemDataProcPtr userRoutine );
A pointer to your item-data callback function.
The universal procedure pointer.
See the DataBrowserItemDataProcPtr
callback function.
HIDataBrowser.h
Creates a universal procedure pointer to an item-drag-region callback function.
DataBrowserItemDragRgnUPP NewDataBrowserItemDragRgnUPP ( DataBrowserItemDragRgnProcPtr userRoutine );
A pointer to your item-drag-region callback function.
The universal procedure pointer.
See the DataBrowserItemDragRgnProcPtr
callback function.
HIDataBrowser.h
Creates a universal procedure pointer to an item-help-content callback function.
DataBrowserItemHelpContentUPP NewDataBrowserItemHelpContentUPP ( DataBrowserItemHelpContentProcPtr userRoutine );
A pointer to your item-help-content callback function.
The universal procedure pointer.
See the DataBrowserItemHelpContentProcPtr
callback function.
HIDataBrowser.h
Creates a universal procedure pointer to an item-notification callback function.
DataBrowserItemNotificationUPP NewDataBrowserItemNotificationUPP ( DataBrowserItemNotificationProcPtr userRoutine );
A pointer to your item-notification callback function.
The universal procedure pointer.
See the DataBrowserItemNotificationProcPtr
callback function.
HIDataBrowser.h
Creates a universal procedure pointer to an item-notification-with-data callback function.
DataBrowserItemNotificationWithItemUPP NewDataBrowserItemNotificationWithItemUPP ( DataBrowserItemNotificationWithItemProcPtr userRoutine );
A pointer to your item-notification-with-data callback function.
The universal procedure pointer.
See the DataBrowserItemNotificationWithItemProcPtr
callback function.
HIDataBrowser.h
Creates a universal procedure pointer to an item-receive-drag callback function.
DataBrowserItemReceiveDragUPP NewDataBrowserItemReceiveDragUPP ( DataBrowserItemReceiveDragProcPtr userRoutine );
A pointer to your item-receive-drag callback function.
The universal procedure pointer.
See the DataBrowserItemReceiveDragProcPtr
callback function.
HIDataBrowser.h
Creates a universal procedure pointer to an item-iterator callback function.
DataBrowserItemUPP NewDataBrowserItemUPP ( DataBrowserItemProcPtr userRoutine );
A pointer to your item-iterator callback function.
The universal procedure pointer.
See the DataBrowserItemProcPtr
callback function.
HIDataBrowser.h
Creates a universal procedure pointer to a postprocess-drag callback function.
DataBrowserPostProcessDragUPP NewDataBrowserPostProcessDragUPP ( DataBrowserPostProcessDragProcPtr userRoutine );
A pointer to your postprocess-drag callback function.
The universal procedure pointer.
See the DataBrowserPostProcessDragProcPtr
callback function.
HIDataBrowser.h
Creates a universal procedure pointer to a receive-drag callback function.
DataBrowserReceiveDragUPP NewDataBrowserReceiveDragUPP ( DataBrowserReceiveDragProcPtr userRoutine );
A pointer to your receive-drag callback function.
The universal procedure pointer.
See the DataBrowserReceiveDragProcPtr
callback function.
HIDataBrowser.h
Creates a universal procedure pointer to a select-contextual-menu callback function.
DataBrowserSelectContextualMenuUPP NewDataBrowserSelectContextualMenuUPP ( DataBrowserSelectContextualMenuProcPtr userRoutine );
A pointer to your select-contextual-menu callback function.
The universal procedure pointer.
See the DataBrowserSelectContextualMenuProcPtr
callback function.
HIDataBrowser.h
Creates a universal procedure pointer to a tracking callback function.
DataBrowserTrackingUPP NewDataBrowserTrackingUPP ( DataBrowserTrackingProcPtr userRoutine );
A pointer to your tracking callback function.
The universal procedure pointer.
See the DataBrowserTrackingProcPtr
callback function.
HIDataBrowser.h
Opens a data browser container.
OSStatus OpenDataBrowserContainer ( ControlRef browser, DataBrowserItemID container );
A data browser.
The item ID of the container to open.
A result code. See “Data Browser Result Codes.”
Normally the user navigates through a data hierarchy by clicking the disclosure triangle next to a container item in list view, or the container item (such as a folder icon) in column view. In either of these cases, the system automatically opens or closes the container. Under some circumstances your application may need to open or close a container programmatically, such as when you are restoring a display to its last known state. In such cases, you can call the function OpenDataBrowserContainer
to disclose items in a container or the function CloseDataBrowserContainer
to hide items in a container.
HIDataBrowser.h
Removes one or more items from a data browser.
OSStatus RemoveDataBrowserItems ( ControlRef browser, DataBrowserItemID container, ItemCount numItems, const DataBrowserItemID *items, DataBrowserPropertyID preSortProperty );
A data browser.
An item ID or the constant kDataBrowserNoItem
. Pass the item ID that uniquely identifies the container from which you want to remove items. Pass kDataBrowserNoItem
to remove items from the root container.
The number of items in the array pointed to by the items
parameter. To remove all items pass 0
and also pass NULL
in the items parameter.
A pointer to an array of item ID values for the items you want to remove from the data browser. You can delete an arbitrary list of items from a container. To remove all items, pass NULL
, and also pass 0
in the numItems
parameter.
The property ID of the column whose sorting order is the same as the sorting order of the items
array. A property ID is a value that identifies a column independent of its position in a data browser. Pass kDataBrowserItemNoProperty
if the items
array is not sorted or if you don’t know the sorting order. You’ll get the best performance from this function if you provide a sorting order.
A result code. See “Data Browser Result Codes.”
HIDataBrowser.h
Removes a column from a list view data browser.
OSStatus RemoveDataBrowserTableViewColumn ( ControlRef browser, DataBrowserTableViewColumnID column );
A data browser.
The property ID for the list view column you want to remove. The DataBrowserTableViewColumnID
data type is the same as the DataBrowserPropertyID
data type.
A result code. See “Data Browser Result Codes.”
This function works only for list view.
HIDataBrowser.h
Scrolls an item into view, optionally bringing a particular part of that item into view.
OSStatus RevealDataBrowserItem ( ControlRef browser, DataBrowserItemID item, DataBrowserPropertyID propertyID, DataBrowserRevealOptions options );
A data browser.
The item ID of the item to scroll into view.
The property ID of the column to scroll into view. A property ID is a four-character sequence that you assign to represent a column in list view. For column view, pass kDataBrowserNoItem
.
A value that specifies how to position the item in the data browser. See “Reveal Options” for a list of the constants you can supply.
A result code. See “Data Browser Result Codes.”
In most cases the system takes care of scrolling for you. However, this function is useful if your application supports type-select and you want to scroll a matching item into view.
HIDataBrowser.h
Sets what determines the active state of the items in a data browser.
OSStatus SetDataBrowserActiveItems ( ControlRef browser, Boolean active );
A data browser.
A value that specifies the new active state for the items displayed in the list. Pass true
to make the active state of each item determined by what your callback reports for each item’s kDataBrowserItemIsActiveProperty
property, or false
to make all items inactive. Inactive items appear dimmed.
A result code. See “Data Browser Result Codes.”
Passing true
for the active
parameter does not make all the items active. Instead it sets the active state of each individual item according to the value associated with the kDataBrowserItemIsActiveProperty
property for that item. This means if the active property for an item is set to false
, and you pass true
for the active
parameter, then the item is inactive.
HIDataBrowser.h
Sets the callback routines to use with a data browser, replacing any previously installed callbacks.
OSStatus SetDataBrowserCallbacks ( ControlRef browser, const DataBrowserCallbacks *callbacks );
A data browser.
A pointer to a DataBrowserCallbacks
structure that is filled out with universal procedure pointers (UPPs) to the callback routines your application provides. At a minimum, you need to provide a UPP to an item-data callback (DataBrowserItemDataProcPtr
).
A result code. See “Data Browser Result Codes.”
Before calling the function SetDataBrowserCallbacks
you must first call InitDataBrowserCallbacks
to initialize the data browser callback structure. Calling SetDataBrowserCallbacks
replaces any callback routines you installed previously by calling this function.
You can supply the following callbacks. If you don’t supply callbacks in cases for which it’s optional, you get the default behavior provided by the data browser API.
DataBrowserItemDataProcPtr
. You must provide this callback because communicates the text, icons, or other data to display in list view. It also communicates the metadata that defines how data is displayed, such as whether or not an item is a container or has a parent. If you set up your data browser to allow the user to edit, this callback informs your application when the user makes a change.
DataBrowserItemCompareProcPtr
. You must provide a sorting callback if you want users to be able to sort the items in a column. If you want containers in a hierarchical list to be sorted independently, then you must provide a sorting callback that handles the hierarchical lists appropriately.
DataBrowserItemNotificationProcPtr
. You must provide this (or the next) callback if you have hierarchical data in a list, or if you use column view.
DataBrowserItemNotificationWithItemProcPtr
(Mac OS X only)
DataBrowserAddDragItemProcPtr
. You can provide this callback to allow dragging out of your data browser.
DataBrowserAcceptDragProcPtr
. You can provide this callback to allow dragging into your data browser; use this to accept a drag item.
DataBrowserReceiveDragProcPtr
. You can provide this callback to allow dragging into your data browser; use this to receive a drag item.
DataBrowserPostProcessDragProcPtr
. If you provide callbacks to allow dragging into your data browser, you can optionally provide a postprocess-drag callback to perform cleanup tasks.
DataBrowserGetContextualMenuProcPtr
. You can optionally support a contextual menu. If so, you’ll need to provide the next callback too.
DataBrowserItemHelpContentProcPtr
. You can optionally provide help tags.
Note that this function sets a different set of callbacks from those that are set by calling the function SetDataBrowserCustomCallbacks
.
To replace a callback, you first need to get the current set of callbacks by calling the function GetDataBrowserCallbacks
. Set the appropriate fields in the DataBrowserCallbacks
structure to your callback. Then you call the function SetDataBrowserCallbacks
. Your application can set as many callbacks as appropriate.
The following code shows how to assign UPPs to the callbacks structure and then call the function SetDataBrowserCallbacks
. The code assumes you have already called the function InitDataBrowserCallbacks
to initialize the data browser callback structure.
myCallbacks.u.v1.itemNotificationCallback = |
NewDataBrowserItemNotificationUPP (MyItemNotificationCallback); |
myCallbacks.u.v1.acceptDragCallback = |
NewDataBrowserAcceptDragUPP (MyAcceptDragCallback); |
myCallbacks.u.v1.receiveDragCallback = |
NewDataBrowserReceiveDragUPP (MyReceiveDragCallback); |
myCallbacks.u.v1.addDragItemCallback = |
NewDataBrowserAddDragItemUPP (MyAddDragItemCallback); |
myCallbacks.u.v1.itemHelpContentCallback = |
NewDataBrowserItemHelpContentUPP (MyItemHelpContentCallback); |
myCallbacks.u.v1.getContextualMenuCallback = |
NewDataBrowserGetContextualMenuUPP (MyGetContextualMenuCallback); |
myCallbacks.u.v1.selectContextualMenuCallback = |
NewDataBrowserSelectContextualMenuUPP ( |
MySelectContextualMenuCallback); |
SetDataBrowserCallbacks (browser, &myCallbacks); |
HIDataBrowser.h
Sets the display type for a data browser in column view.
OSStatus SetDataBrowserColumnViewDisplayType ( ControlRef browser, DataBrowserPropertyType propertyType );
A data browser.
The data type to be displayed in the data browser. The default is kDataBrowserIconAndTextType
. Currently this is the only value you can supply for column view.
A result code. See “Data Browser Result Codes.”
This function is effectively not functional because no display types other than kDataBrowserIconAndTextType
are currently supported. Note that the rightmost column can have the attribute kDataBrowserColumnViewPreviewProperty
as long as you provide a callback to display the appropriate icon and text information in the preview column.
HIDataBrowser.h
Sets a path for a column view.
OSStatus SetDataBrowserColumnViewPath ( ControlRef browser, UInt32 length, const DataBrowserItemID *path );
A data browser.
The number of items in the array passed in the path
parameter.
The address to the first item in the array of item ID values that specifies the path. Array element 0
is the root; array element N - 1
is the target.
A result code. See “Data Browser Result Codes.”
HIDataBrowser.h
Sets the custom callback routines to use with a data browser, replacing any previously installed custom callbacks.
OSStatus SetDataBrowserCustomCallbacks ( ControlRef browser, const DataBrowserCustomCallbacks *callbacks );
A data browser.
A pointer to a DataBrowserCustomCallbacks
structure that is filled out with universal procedure pointers (UPPs) to the custom callback routines your application provides.
A result code. See “Data Browser Result Codes.”
Before calling the function SetDataBrowserCustomCallbacks
you must first call InitDataBrowserCustomCallbacks
to initialize the data browser custom callback structure. Calling SetDataBrowserCustomCallbacks
replaces any callback routines you installed previously by calling this function.
You can supply the following custom callback routines.
DataBrowserDrawItemProcPtr
. This callback is invoked by the data browser whenever your content needs to be drawn. You must supply this callback for data whose display type is kDataBrowserCustomType
.
DataBrowserEditItemProcPtr
. Supply this callback when you want to support editing of your content.
DataBrowserHitTestProcPtr
. You can provide this callback to determine if the pointer is over content that can be selected or dragged.
DataBrowserTrackingProcPtr
. This callback implements custom tracking behavior.
DataBrowserItemDragRgnProcPtr
. You can supply this callback when you need to determine which part of an item to use to create a transparent image for a dragged item.
DataBrowserItemAcceptDragProcPtr
. This callback determines if an item can accept a drag object.
DataBrowserItemReceiveDragProcPtr
. This callback receives a drop over an item.
Note that this is a different set of callbacks from those that are installed by calling the function SetDataBrowserCallbacks
.
To replace a callback, you first need to set the appropriate fields in the DataBrowserCustomCallbacks
structure to your callbacks. Then you call the function SetDataBrowserCustomCallbacks
. The following code shows how to set custom callbacks. It assumes you have already called the function InitDataBrowserCustomCallbacks
to initialize the data browser custom callback structure. Your application can set as many callbacks as appropriate.
myCustomCallbacks.u.v1.drawItemCallback = |
NewDataBrowserDrawItemUPP (MyDataBrowserDrawItemCallback); |
myCustomCallbacks.u.v1.editItemCallback = |
NewDataBrowserEditItemUPP (MyDataBrowserEditItemCallback); |
SetDataBrowserCustomCallbacks (browser,&myCustomCallbacks); |
HIDataBrowser.h
Programmatically starts or ends an editing session.
OSStatus SetDataBrowserEditItem ( ControlRef browser, DataBrowserItemID item, DataBrowserPropertyID property );
A data browser.
The item ID of the item to make editable.
The property ID of the item to make editable.
A result code. See “Data Browser Result Codes.”
You can call the function SetDataBrowserEditItem
to begin or end an editing session programmatically for a text item. To begin an editing session for a text item, specify its item ID and property ID. To end an editing session, provide the constant kDataBrowserNoItem
as the item ID number.
HIDataBrowser.h
Modifies the displayed contents of a text item while it is being edited.
OSStatus SetDataBrowserEditText ( ControlRef browser, CFStringRef text );
A data browser.
A CFString object that specifies the text to edit. The data browser makes its own copy of this object so it is safe to release your own reference after you call this function.
A result code. See “Data Browser Result Codes.”
You can use this function to programmatically change the text. For example, to paste data in response to a Paste command. This function is useful only if an edit session is in progress for an item. You can check whether can get session is open by calling the function GetDataBrowserEditItem
.
HIDataBrowser.h
Sets the display state of horizontal and vertical scroll bars for a list view data browser.
OSStatus SetDataBrowserHasScrollBars ( ControlRef browser, Boolean horiz, Boolean vert );
A list view data browser.
A value that specifies whether to display the browser control with (true
) or without (false
) a horizontal scroll bar.
A value that specifies whether to display the browser control with (true
) or without (false
) a vertical scroll bar.
A result code. See “Data Browser Result Codes.”
If the list your application displays is small and its coordinates do not extend beyond the bounds of the area used to display the list, then you can call SetDataBrowserHasScrollBars
to turn off the display of scroll bars.
HIDataBrowser.h
Specifies a Boolean value for an item.
OSStatus SetDataBrowserItemDataBooleanValue ( DataBrowserItemDataRef itemData, Boolean theData );
The item data reference for the item whose Boolean value you want to set. The item data reference is passed to the callback routine from which you are calling the function SetDataBrowserItemDataBooleanValue
.
The value to display.
A result code. See “Data Browser Result Codes.”
Your item-data callback calls this function in response to an inquiry for the following properties:
kDataBrowserItemIsActiveProperty
kDataBrowserItemIsSelectableProperty
kDataBrowserItemIsEditableProperty
kDataBrowserItemIsContainerProperty
kDataBrowserItemIsOpenableProperty
kDataBrowserItemIsClosableProperty
kDataBrowserItemIsSortableProperty
HIDataBrowser.h
Specifies a checkbox value.
OSStatus SetDataBrowserItemDataButtonValue ( DataBrowserItemDataRef itemData, ThemeButtonValue theData );
The item data reference for the item whose checkbox value you want to set. The item data reference is passed to the callback routine from which you are calling the function SetDataBrowserItemDataButtonValue
.
The checkbox setting. You can supply any of the following theme button value constants defined by the Appearance Manager:
kThemeButtonOff
draws a checkbox that is not selected.
kThemeButtonOn
draws a checkbox that is selected.
kThemeButtonMixed
draws a checkbox that in a mixed state, indicating that a setting is on for some items in a selection and off for others.
See Appearance Manager Reference for more information.
A result code. See “Data Browser Result Codes.”
Your item-data callback calls this function in response to a set-data request for items that have the display type kDataBrowserCheckboxType
.
HIDataBrowser.h
Specifies, as a 32-bit value, a date and time value to display.
OSStatus SetDataBrowserItemDataDateTime ( DataBrowserItemDataRef itemData, SInt32 theData );
The item data reference for the item whose date and time value you want to set. The item data reference is passed to the callback routine from which you are calling the function SetDataBrowserItemDataDateTime
.
A 32-bit value that represents the number of elapsed seconds since midnight, January 1, 1904. For more information about date and time encodings used in the Mac OS, see Date, Time, and Measurement Utilities Reference.
A result code. See “Data Browser Result Codes.”
This function works only with items that have the property kDataBrowserDateTimeType
. If the column has the property kDataBrowserRelativeDateTime
, the date is displayed relative to the current time for the computer. For example, a time 24 hours before the current time is displayed as “Yesterday.” Other examples of relative date and time values are “Today, 1:45 PM” and “Yesterday, 7:30 AM.”
HIDataBrowser.h
Specifies whether to draw a checkbox in the active or inactive state.
OSStatus SetDataBrowserItemDataDrawState ( DataBrowserItemDataRef itemData, ThemeDrawState theData );
The item data reference for the item whose drawing state you want to set. This value is passed to the callback routine from which you are calling the function SetDataBrowserItemDataDrawState
.
The drawing state to use for the checkbox item. You can supply the following theme drawing state constants:
kThemeStateInactive
draws the item in the inactive state.
kThemeStateActive
draws the item in the active state.
See Appearance Manager Reference for more information on these constants.
A result code. See “Data Browser Result Codes.”
Your item-data callback calls this function in response to a set-data request for items that have the display type kDataBrowserCheckboxType
.
HIDataBrowser.h
Specifies the icon to draw.
OSStatus SetDataBrowserItemDataIcon ( DataBrowserItemDataRef itemData, IconRef theData );
The item data reference for the item whose icon you want to set. This value is passed to the callback routine from which you are calling the function SetDataBrowserItemDataIcon
.
The icon to display. The data browser retains the icon, so you may release the IconRef
after the function returns.
A result code. See “Data Browser Result Codes.”
You call the function SetDataBrowserItemDataIcon
from within a DataBrowserItemDataProcPtr
callback routine to specify an icon to draw. You can specify an icon for any column that has the kDataBrowserIconType
display type or the kDataBrowserIconAndTextType
display type.
HIDataBrowser.h
Specifies a transformation to apply to an icon when it is drawn.
OSStatus SetDataBrowserItemDataIconTransform ( DataBrowserItemDataRef itemData, IconTransformType theData );
The item data reference for the item whose icon transformation you want to set. This value is passed to the callback routine from which you are calling the function SetDataBrowserItemDataIconTransform
.
An icon transformation type that specifies how to modify the appearance of the icon. You can pass any of the icon transformation constants defined by Icon Services and Utilities. See Icon Services and Utilities Reference for more information.
A result code. See “Data Browser Result Codes.”
This function works only with items that either have the property kDataBrowserIconAndTextType
or kDataBrowserIconType
.
HIDataBrowser.h
Communicates a property of an item when that property is another item’s ID.
OSStatus SetDataBrowserItemDataItemID ( DataBrowserItemDataRef itemData, DataBrowserItemID theData );
The item data reference passed to your item-data callback.
The item ID to set.
A result code. See “Data Browser Result Codes.”
To display hierarchical data correctly the data browser needs to know whether an item is a container and whether the item is in a container (has a parent). So it sends a get-data request for the properties kDataBrowserParentContainerProperty
and kDataBrowserContainerAliasIDProperty
to your item-data callback.
The property kDataBrowserContainerAliasIDProperty
is sent to your item-data callback to provide your application with a chance to follow an alias that the item might represent. If the incoming item is an alias to another item, you can call SetDataBrowserItemDataItemID
to inform the data browser which other item the incoming item points to.
The property kDataBrowserParentContainerProperty
is sent to your item-data callback to check whether an item has a parent. If it does, you call SetDataBrowserItemDataItemID
, supplying the item ID of the parent in the parameter theData
. If the item has no parent, set theData
to 0
.
HIDataBrowser.h
Specifies, as a 64-bit value, a date and time value to display.
OSStatus SetDataBrowserItemDataLongDateTime ( DataBrowserItemDataRef itemData, const LongDateTime *theData );
The item data reference for the item whose long date and time value you want to set. The item data reference is passed to the callback routine from which you are calling the function SetDataBrowserItemDataLongDateTime
.
A pointer to a 64-bit value that represents the time as the number of elapsed seconds since midnight, January 1, 1904. For more information about date and time encodings used in the Mac OS, see Date, Time, and Measurement Utilities Reference in Carbon Text & International Documentation.
A result code. See “Data Browser Result Codes.”
This function works only with items that have the property kDataBrowserDateTimeType
. If the column has the property kDataBrowserRelativeDateTime
, the date is displayed relative to the current time for the computer. For example, a time 24 hours before the current time is displayed as “Yesterday.” Other examples of relative date and time values are “Today, 1:45 PM” and “Yesterday, 7:30 AM.”
HIDataBrowser.h
Specifies the maximum integer value that can be displayed for an item; useful for such display types as sliders, progress bars, relevance indicators, and pop-up menus.
OSStatus SetDataBrowserItemDataMaximum ( DataBrowserItemDataRef itemData, SInt32 theData );
The item data reference for the item whose maximum value you want to set. The item data reference is passed to the callback routine from which you are calling the function SetDataBrowserItemDataMaximum
.
The maximum setting for content displayed for the item.
A result code. See “Data Browser Result Codes.”
HIDataBrowser.h
Sets the pop-up menu to display.
OSStatus SetDataBrowserItemDataMenuRef ( DataBrowserItemDataRef itemData, MenuRef theData );
The item data reference for the item whose pop-up menu value you want to set. The item data reference is passed to the callback routine from which you are calling the function SetDataBrowserItemDataMenuRef
.
The pop-up menu set to the value you want to display. The system retains the menu reference that you pass; you must release it when you no longer need it. Pass NULL
if you no longer want a menu.
A result code. See “Data Browser Result Codes.”
Your item-data callback calls this function in response to a set-data request for an item whose display type is kDataBrowserPopupMenuType
.
HIDataBrowser.h
Specifies the minimum integer value that can be displayed for an item; useful for such display types as sliders, progress bars, relevance indicators, and pop-up menus.
OSStatus SetDataBrowserItemDataMinimum ( DataBrowserItemDataRef itemData, SInt32 theData );
The item data reference for the item whose minimum value you want to set. The item data reference is passed to the callback routine from which you are calling the function SetDataBrowserItemDataMinimum
.
The minimum setting for the displayed content.
A result code. See “Data Browser Result Codes.”
HIDataBrowser.h
Specifies a color to use when drawing an item.
OSStatus SetDataBrowserItemDataRGBColor ( DataBrowserItemDataRef itemData, const RGBColor *theData );
The item data reference for the item whose color you want to set. This value is passed to the callback routine from which you are calling the function SetDataBrowserItemDataRGBColor
.
A pointer to the RGB values that specify the color to use.
A result code. See “Data Browser Result Codes.”
Typically this function is used to set the color for an item that is an icon type. Your item-data callback calls this function in response to a set-data request for items that have display type kDataBrowserIconType
or kDataBrowserIconAndTextType
.
HIDataBrowser.h
Specifies the text to draw.
OSStatus SetDataBrowserItemDataText ( DataBrowserItemDataRef itemData, CFStringRef theData );
The item data reference for the item whose text you want to set. This value is passed to the callback routine from which you are calling the function SetDataBrowserItemDataText
.
The CFString object that contains the text you want to draw. You are responsible for releasing the CFString object.
A result code. See “Data Browser Result Codes.”
You call the function SetDataBrowserItemDataText
from inside a data callback routine when the item being drawn is inside a column that has the kDataBrowserTextType
display type or the kDataBrowserIconAndTextType
display type.
HIDataBrowser.h
Sets the value of an item; useful for such display types as sliders, progress bars, relevance indicators, and pop-up menus.
OSStatus SetDataBrowserItemDataValue ( DataBrowserItemDataRef itemData, SInt32 theData );
The item data reference for the item whose integer value you want to set. The item data reference is passed to the callback routine from which you are calling the function SetDataBrowserItemDataValue
.
The value to display. The value must be between the minimum and maximum values specified by calling the functions SetDataBrowserItemDataMinimum
and SetDataBrowserItemDataMaximum
. Values displayed by a progress bar can vary between the minimum and maximum values, inclusive.
A result code. See “Data Browser Result Codes.”
Your application calls the function SetDataBrowserItemDataValue
to set a new value for a display type when your item-data callback routine is called with the setValue
parameter set to false
.
HIDataBrowser.h
Specifies whether there is a column that has disclosure triangles and, if so, which column.
OSStatus SetDataBrowserListViewDisclosureColumn ( ControlRef browser, DataBrowserTableViewColumnID column, Boolean expandableRows );
A data browser.
The property ID for the column for which you want to set as disclosure column. Only one column in list view can be designated as a disclosure column. Pass kDataBrowserNoItemProperty
if you do not want a disclosure column. The DataBrowserTableViewColumnID
data type is the same as the DataBrowserPropertyID
data type.
A value that specifies how a disclosed row behaves. Pass true
to have a container open as a single row with an expanded height. Pass false
to have a container opens to expose other rows. See the Discussion for more details on expandable rows.
A result code. See “Data Browser Result Codes.”
A disclosure triangle next to an item denotes the item is a container. You can use the expandableRows
parameter to specify whether an opened container displays its items in individual rows, as shown in the top of Figure 1 or increases its row height to accommodate the contained information, as shown in the bottom of the figure.
When the expandableRows
parameter is set to true
:
Disclosure triangles are drawn top-justified in the row.
Custom row height, if any, for that row is respected only while the row is disclosed. At other times, the default row height is used.
When the expandableRows
parameter is set to false
:
Disclosure triangles are centered vertically in the row.
Custom row height, if any, for that row is always respected.
When a disclosure triangle is clicked by the user, your application receives the same notifications regardless of whether expandableRows
is set to true
or false
. When your application receives a notification that an expandable row is toggled to open, call the function SetDataBrowserTableViewItemRowHeight
to set the row to the appropriate height.
HIDataBrowser.h
Sets the height of the rectangular area where the column title appears.
OSStatus SetDataBrowserListViewHeaderBtnHeight ( ControlRef browser, UInt16 height );
A data browser.
The height, in pixels, to use for the rectangular area where the column title appears. Pass 0
to turn off header button display. To turn on header button display, pass the value previously obtained from the function GetDataBrowserListViewHeaderBtnHeight
. The default height is currently 17 pixels.
A result code. See “Data Browser Result Codes.”
HIDataBrowser.h
Provides a description for a column title in list view.
OSStatus SetDataBrowserListViewHeaderDesc ( ControlRef browser, DataBrowserTableViewColumnID column, DataBrowserListViewHeaderDesc *desc );
A data browser.
The property ID for the column in list view whose title description you want to set. The DataBrowserTableViewColumnID
data type is the same as the DataBrowserPropertyID
data type.
The list view header description structure that you have filled out with data that describes the appearance of a column title in list view.
A result code. See “Data Browser Result Codes.”
This functions allows you to change the behavior or appearance of a column title. Typically you call this function if your application:
Supports switching between list and column views, and you need to restore previously saved list view title information.
Creates a list view data browser programmatically and the columns have titles.
HIDataBrowser.h
Specifies whether list view uses a plain white background.
OSStatus SetDataBrowserListViewUsePlainBackground ( ControlRef browser, Boolean usePlainBackground );
A data browser.
A value that specifies whether to use a plain background (true
) or not to use a plain background (false
). A plain background is an all-white background. In Mac OS X, passing false
currently does nothing, as Mac OS X supports only a plain white background. However, pass true
if you want a plain white background just in case the API changes in the future. In Mac OS 9, passing false
causes the data browser to use a shaded background.
A result code. See “Data Browser Result Codes.”
A list view that does not use a plain background can use colors or patterns to distinguish one column from another. For example, you could specify a color to designate a column as the sorted column.
HIDataBrowser.h
Sets the appearance and behavior attributes for a column in list view.
OSStatus SetDataBrowserPropertyFlags ( ControlRef browser, DataBrowserPropertyID property, DataBrowserPropertyFlags flags );
A data browser.
The property ID of the column whose appearance and behavior you want to set.
The property flags to apply. A DataBrowserPropertyFlags
value is a 32-bit value that is divided into four parts as follows:
Bits 0–7 specify properties applied to the data browser as a whole—see “Property Flags: Universal”
Bits 8–15 modify display behavior—see “Property Flags: Modifiers”
Bits 16–23 are properties specific to list view—see “Property Flags: Offset and Mask for List View Properties” and “Property Flags: List View Column Behavior”
Bits 24–31 can be defined by your application—see “Property Flags: Offset and Mask for Client-Defined Properties”
A result code. See “Data Browser Result Codes.”
HIDataBrowser.h
Sets the inset values to use for the scroll bars of a data browser.
OSStatus SetDataBrowserScrollBarInset ( ControlRef browser, Rect *insetRect );
A data browser.
A pointer to a rectangle that specifies the inset values you want the data browser to use. The left and right fields contain the horizontal inset values for the horizontal scroll bar, and the top and bottom fields contain the vertical inset values for the vertical scroll bar.
A result code. See “Data Browser Result Codes.”
Your application can call the functions GetDataBrowserScrollBarInset
and SetDataBrowserScrollBarInset
if you want to place placards or controls beside the horizontal scroll bars or above the vertical ones. To do so, first call GetDataBrowserScrollBarInset
to obtain the current settings. After modifying the current inset settings to provide space for the placard or control, call SetDataBrowserScrollBarInset
with the new values.
HIDataBrowser.h
Scrolls a list to the specified position.
OSStatus SetDataBrowserScrollPosition ( ControlRef browser, UInt32 top, UInt32 left );
A data browser.
The vertical scrolling position to use.
The horizontal scrolling position to use.
A result code. See “Data Browser Result Codes.”
The scrolling position (0,0)
represents the home position, and is located at the top left of the data browser. Horizontal and vertical units are relative to the home position.
You can call this function to scroll a list to any arbitrary scrolling position. Normally, you use the function GetDataBrowserScrollPosition
in conjunction with SetDataBrowserScrollPosition
to save and restore the scrolling position of a list to the user’s last scrolling position. These functions should not be used to scroll particular cells into the view. For that, call the function RevealDataBrowserItem
.
HIDataBrowser.h
Modifies the current selection by adding items, removing items, or toggling the selection state of items.
OSStatus SetDataBrowserSelectedItems ( ControlRef browser, ItemCount numItems, const DataBrowserItemID *items, DataBrowserSetOption operation );
A data browser.
The number of item ID values stored in the array pointed to by the items
parameter.
A pointer to an array of the item IDs to modify the selection with.
The operation you want to perform on the current selection. You can add, assign, toggle, or remove the items specified by the items
parameter. See “Selection State Options” for a list of the constants you can supply and a complete description of what each constant does.
A result code. See “Data Browser Result Codes.”
HIDataBrowser.h
Sets allowable selection behavior for a data browser.
OSStatus SetDataBrowserSelectionFlags ( ControlRef browser, DataBrowserSelectionFlags selectionFlags );
A data browser.
Flags that specify the selection behavior you want to allow in the data browser. The flags control such things as whether discontinuous selections are allowed by the user. See “User Selection Flags” for detailed descriptions of these flags.
A result code. See “Data Browser Result Codes.”
HIDataBrowser.h
Sets the sorting order for a list in list view.
OSStatus SetDataBrowserSortOrder ( ControlRef browser, DataBrowserSortOrder order );
A data browser.
The sorting order. See “Sorting Orders” for a list of the constants you can supply.
A result code. See “Data Browser Result Codes.”
List view tracks the sorting order by column. In Mac OS X, setting the sorting order only affects the sorting order of the column currently set for sorting.
HIDataBrowser.h
Designates the list view column to use for sorting.
OSStatus SetDataBrowserSortProperty ( ControlRef browser, DataBrowserPropertyID property );
A data browser.
The property ID of the column to use for sorting.
A result code. See “Data Browser Result Codes.”
If the list is not currently sorted, or if the list is currently sorted with a different column, then the list is sorted and redrawn. You can all the function GetDataBrowserSortProperty
to obtain the property ID of the column currently used for sorting.
HIDataBrowser.h
Changes the visual position of a column in list view.
OSStatus SetDataBrowserTableViewColumnPosition ( ControlRef browser, DataBrowserTableViewColumnID column, DataBrowserTableViewColumnIndex position );
A data browser.
The property ID for the list view column you want to move. The DataBrowserTableViewColumnID
data type is the same as the DataBrowserPropertyID
data type.
The position you want to move the column to.
A result code. See “Data Browser Result Codes.”
If you set your list to have the property kDataBrowserListViewMovableColumn
, the user can rearrange columns by dragging. The function SetDataBrowserTableViewColumnPosition
provides a way for your application to rearrange columns programmatically.
HIDataBrowser.h
Sets the default column width for all columns in a data browser.
OSStatus SetDataBrowserTableViewColumnWidth ( ControlRef browser, UInt16 width );
A data browser.
The column width, in pixels.
A result code. See “Data Browser Result Codes.”
You can override the default width for an individual list view column by calling the function SetDataBrowserTableViewNamedColumnWidth
.
HIDataBrowser.h
Sets whether columns and rows can have variable widths in list view.
OSStatus SetDataBrowserTableViewGeometry ( ControlRef browser, Boolean variableWidthColumns, Boolean variableHeightRows );
A data browser.
A Boolean value that specifies whether column widths can be variable (true
) or not (false
).
A Boolean value that specifies whether row heights can be variable (true
) or not (false
).
A result code. See “Data Browser Result Codes.”
After you call the function SetDataBrowserTableViewGeometry
to set up variable row heights or columns widths in list view, you can modify individual row heights or columns widths in list view by calling the appropriate function—either SetDataBrowserTableViewItemRowHeight
or SetDataBrowserTableViewNamedColumnWidth
.
HIDataBrowser.h
Sets the highlighting style to use for a list view data browser.
OSStatus SetDataBrowserTableViewHiliteStyle ( ControlRef browser, DataBrowserTableViewHiliteStyle hiliteStyle );
A list view data browser.
The highlighting style you want to use. See “Table View Highlighting Styles” for a description of the constants you can supply.
A result code. See “Data Browser Result Codes.”
HIDataBrowser.h
Changes the visual position for an item in a list view data browser.
OSStatus SetDataBrowserTableViewItemRow ( ControlRef browser, DataBrowserItemID item, DataBrowserTableViewRowIndex row );
A data browser.
The item ID for the item whose row you want to set.
The row index for the row you want to move the item to.
A result code. See “Data Browser Result Codes.”
HIDataBrowser.h
Sets the row height for a single row in a list view data browser.
OSStatus SetDataBrowserTableViewItemRowHeight ( ControlRef browser, DataBrowserItemID item, UInt16 height );
A data browser.
The item ID for the item whose row height you want to set.
The row height, in pixels.
A result code. See “Data Browser Result Codes.”
Before calling this function, you must call the function SetDataBrowserTableViewGeometry
to set up variable row heights.
HIDataBrowser.h
Sets the column width for a single column in a list view data browser.
OSStatus SetDataBrowserTableViewNamedColumnWidth ( ControlRef browser, DataBrowserTableViewColumnID column, UInt16 width );
A data browser.
The property ID for the list view column whose width you want to set. The DataBrowserTableViewColumnID
data type is the same as the DataBrowserPropertyID
data type.
The width of the column, in pixels.
A result code. See “Data Browser Result Codes.”
Before calling this function, you must call the function SetDataBrowserTableViewGeometry
to set up variable column widths.
HIDataBrowser.h
Sets the default row height for all rows in a data browser.
OSStatus SetDataBrowserTableViewRowHeight ( ControlRef browser, UInt16 height );
A data browser.
The row height, in pixels.
A result code. See “Data Browser Result Codes.”
This function sets the default row height for all rows. You override the default row height for an individual row by calling the function SetDataBrowserTableViewItemRowHeight
.
HIDataBrowser.h
Sets the target for a data browser.
OSStatus SetDataBrowserTarget ( ControlRef browser, DataBrowserItemID target );
A data browser.
The item ID to assign as the target for the browser control.
A result code. See “Data Browser Result Codes.”
Your application can set an item ID to use as a target if you do not want to use the default target set by the data browser. By default, the target is a container whose ID is kDataBrowserNoItem
. For the list view, the target can be thought of as the root container. For the column view, the target is the rightmost column. When an item is dragged over a data browser but not dropped over any particular item, the target becomes the destination.
SetDataBrowserTarget
changes the container that the data browser displays, thereby populating the data browser with items. If you use the function in column view, you must make sure your item-data callback responds to the property kDataBrowserItemParentContainerProperty
by providing the item ID of the target’s parent. This allows the function SetDataBrowserColumnViewPath
to process the data properly. The target is the leaf node item whose contents you want to display. However, unlike GetDataBrowserColumnViewPathLength
, the function SetDataBrowserTarget
doesn’t offer a way for you to communicate the item IDs of the rest of the column containers, so SetDataBrowserTarget
asks for them explicitly by requesting the item’s parent, then the parent of the item’s parent, and so on.
You can pass a noncontainer item to this function in either list or column views. If you do, you must also respond to the property kDataBrowserItemParentContainerProperty
. The data browser requests the parent of the target so it knows which container to display the contents of in the list view.
HIDataBrowser.h
Restores the view-style settings in list view to a previous state set by the user.
OSStatus SetDataBrowserUserState ( ControlRef browser, CFDictionaryRef stateInfo );
A data browser.
A CFDictionary object that specifies the view-style settings that you want to restore. Note that although this parameter is typed as a CFData object, you must supply a CFDictionary object because that is the form of the data the system expects.
A result code. See “Data Browser Result Codes.”
Typically you use this function to restore the user state you previously obtained by calling the function GetDataBrowserUserState
.
HIDataBrowser.h
Sets the view style of the specified data browser.
OSStatus SetDataBrowserViewStyle ( ControlRef browser, DataBrowserViewStyle style );
A data browser.
The view style to use. Pass the constant kDataBrowserListView
to draw the data browser using list view or kDataBrowserColumnView
to use column view. See “View Styles” for more information on these constants.
A result code. See “Data Browser Result Codes.”
Although you specify a view style when you call the function CreateDataBrowserControl
, you can call SetDataBrowserViewStyle
to change the style. Use SetDataBrowserViewStyle
when you provide users the option of changing between list and column views.
After calling SetDataBrowserViewStyle
, you need to perform the necessary tasks to configure the data browser for the view style you switched to. If you switch to list view, you need to set up list view header and column descriptions and call the function AddDataBrowserListViewColumn
. You might also need to call other functions such as SetDataBrowserListViewDisclosureColumn
(for hierarchical lists).
HIDataBrowser.h
Sorts a hierarchical list of items.
OSStatus SortDataBrowserContainer ( ControlRef browser, DataBrowserItemID container, Boolean sortChildren );
A data browser.
An item ID or the constant kDataBrowserNoItem
. To sort all of the items that are organized as subitems of a container item, pass the item ID for the container item. To sort all of the items displayed at the top level of the data browser, pass the constant kDataBrowserNoItem
.
A value that indicates whether to sort all items in the container hierarchy. Pass true
to sort all items in the container hierarchy and false
to sort just the immediate children of the container.
A result code. See “Data Browser Result Codes.”
HIDataBrowser.h
Requests a redraw of one or more items in a data browser.
OSStatus UpdateDataBrowserItems ( ControlRef browser, DataBrowserItemID container, ItemCount numItems, const DataBrowserItemID *items, DataBrowserPropertyID preSortProperty, DataBrowserPropertyID propertyID );
A data browser.
An item ID or the constant kDataBrowserNoItem
. Pass the item ID that uniquely identifies the container. If you are updating one or more items that are in the root container, pass kDataBrowserNoItem
.
The number of items in the array pointed to by the items
parameter.
A pointer to an array of item ID values for the items you want to update. If you pass NULL
or if the value kDataBrowserNoItem
is an element in this array, then all rows are updated.
The property ID of the column whose sorting order is the same as the sorting order of the items
array. A property ID is a four-character sequence that you assign to represent a column in list view. Pass kDataBrowserItemNoProperty
if the items
array is not sorted of if you don’t know the sorting order.
The property ID of the column that must be updated. To update all columns associated with the items in the items
array, pass kDataBrowserNoItem
.
A result code. See “Data Browser Result Codes.”
After your application makes changes to any of the data items in a data browser you must update the display by calling the function UpdateDataBrowserItems
. Calling this function also updates any internal caches allocated by the data browser.
HIDataBrowser.h
Defines a pointer to an accept-drag callback function that determines whether your application can accept a drag object in the specified location.
typedef Boolean (*DataBrowserAcceptDragProcPtr) ( ControlRef browser, DragRef theDrag, DataBrowserItemID item );
You would declare an accept-drag callback function named MyDataBrowserAcceptDragCallback
like this:
Boolean MyDataBrowserAcceptDragCallback ( ControlRef browser, DragRef theDrag, DataBrowserItemID item );
A data browser.
The drag reference provided by the data browser to your callback.
The item ID of the item the drag object is held over. If the drag object is over the data browser but not over any specific item, the item
parameter contains the item ID that represents one of the following:
In list view, the target. (See SetDataBrowserTarget
.)
In column view, the item ID of the column the drag object is over
Your callback returns true
if it is capable of accepting the drag object in the location designated by the item parameter. Otherwise, your callback returns false
.
The accept-drag callback is called by the data browser when your application needs to determine if it can accept a drag object in a particular location.
To provide a pointer to your accept-drag callback, you create a universal procedure pointer (UPP) of type DataBrowserAcceptDragUPP
, using the function NewDataBrowserAcceptDragUPP
. You can do so with code similar to the following:
DataBrowserAcceptDragUPP MyDataBrowserAcceptDragUPP; |
MyDataBrowserAcceptDragUPP = NewDataBrowserAcceptDragUPP |
(&MyDataBrowserAcceptDragCallback); |
You can then assign MyDataBrowserAcceptDragUPP
to the acceptDragCallback
field of the structure DataBrowserCallbacks
. You install your data browser callbacks using the function SetDataBrowserCallbacks
.
When you no longer need the UPP, remove it using the DisposeDataBrowserAcceptDragUPP
function.
HIDataBrowser.h
Defines a pointer to an add-drag-item callback function that adds an item to a drag reference.
typedef Boolean (*DataBrowserAddDragItemProcPtr) ( ControlRef browser, DragRef theDrag, DataBrowserItemID item, ItemReference *itemRef );
You would declare an add-drag-item callback function named MyDataBrowserAddDragItemCallback
like this:
Boolean MyDataBrowserAddDragItemCallback ( ControlRef browser, DragRef theDrag, DataBrowserItemID item, ItemRef *itemRef );
A data browser.
The drag reference provided by the data browser to your callback.
The item ID of the item to add to the drag object.
A pointer to a drag item reference variable. Your callback must set this to the DragItemRef
value that it passes to the Drag Manager function AddDragItemFlavor
.
Your callback returns true
to indicate the item should be or is part of the drag object. Your callback returns false
if the item isn’t part of the drag object.
The add-drag-item callback is called by the data browser when a drag operation needs to be started. The data browser iterates through the selected items, invoking your callback for each item. Your callback is called after the drag reference is created by the data browser but before the function TrackDrag
is called by the system.
Your callback adds an item to the drag reference calling the function AddDragItemFlavor
. When you call AddDragItemFlavor
, you must provide a unique drag item reference (DragItemRef
) for each data browser item that you add to the drag. You must also provide the data type of the added item (drag flavor type) and set the appropriate drag flavor flags.
The data browser handles imaging and adds transparency for you. As a result, you do not need to create or add your own transparency information to the drag reference.
To provide a pointer to your add-drag-item callback, you create a universal procedure pointer (UPP) of type DataBrowserAddDragItemUPP
, using the function NewDataBrowserAddDragItemUPP
. You can do so with code similar to the following:
DataBrowserAddDragItemUPP MyDataBrowserAddDragItemUPP; |
MyDataBrowserAddDragItemUPP = NewDataBrowserAddDragItemUPP |
(&MyDataBrowserAddDragItemCallback); |
You can then assign MyDataBrowserAddDragItemUPP
to the addDragItemCallback
field of the structure DataBrowserCallbacks
. You install your data browser callbacks using the function SetDataBrowserCallbacks
.
When you no longer need the UPP, remove it using the DisposeDataBrowserAddDragItemUPP
function.
HIDataBrowser.h
Defines a pointer to a draw-item callback function that draws a custom item.
typedef void (*DataBrowserDrawItemProcPtr) ( ControlRef browser, DataBrowserItemID item, DataBrowserPropertyID property, DataBrowserItemState itemState, const Rect *theRect, SInt16 gdDepth, Boolean colorDevice );
You would declare a draw-item callback function named MyDataBrowserDrawItemCallback
like this:
void MyDataBrowserDrawItemCallback ( ControlRef browser, DataBrowserItemID item, DataBrowserPropertyID property, DataBrowserItemState itemState, const Rect *theRect, SInt16 gdDepth, Boolean colorDevice );
A data browser.
The item ID for the item to draw.
The property ID for the item. In list view, this is the four-character sequence that you previously assigned to the column. In column view, this is the property kDataBrowserItemSelfIdentityProperty
.
The state to use when drawing the item. See “Item States” for a description of the constants that can be provided to your callback.
A pointer to the bounding rectangle (in local coordinates, relative to the port) that specifies where to draw the item. This rectangle is the content rectangle, not the enclosing rectangle.
The bit depth of the current QuickDraw graphics port. The data browser sets the current QuickDraw port to the port that you draw into. This may not always be the port of the data browser’s own window.
A value that specifies whether the current QuickDraw port is a color device (true
) or is not (false
).
The draw-item callback is called by the data browser when an item whose display type is kDataBrowserCustomType
needs to be drawn. Your application draws the item so it reflects the state specified by the itemState
parameter.
To provide a pointer to your draw-item callback, you create a universal procedure pointer (UPP) of type DataBrowserDrawItemUPP
, using the function NewDataBrowserDrawItemUPP
. You can do so with code similar to the following:
DataBrowserDrawItemUPP MyDataBrowserDrawItemUPP; |
MyDataBrowserDrawItemUPP = NewDataBrowserDrawItemUPP |
(&MyDataBrowserDrawItemCallback); |
You can then assign MyDataBrowserDrawItemUPP
to the drawItemCallback
field of the structure DataBrowserCustomCallbacks
. You install your data browser custom callbacks using the function SetDataBrowserCustomCallbacks
.
When you no longer need the UPP, remove it using the DisposeDataBrowserDrawItemUPP
function.
HIDataBrowser.h
Defines a pointer to an edit-item callback function that determines if the data browser should start an edit session for a custom item.
Not Recommended
typedef Boolean (*DataBrowserEditItemProcPtr) ( ControlRef browser, DataBrowserItemID item, DataBrowserPropertyID property, CFStringRef theString, Rect *maxEditTextRect, Boolean *shrinkToFit );
You would declare an edit-item callback function named MyDataBrowserEditItemCallback
like this:
Boolean MyDataBrowserEditItemCallback ( ControlRef browser, DataBrowserItemID item, DataBrowserPropertyID property, CFStringRef theString, Rect *maxEditTextRect, Boolean *shrinkToFit );
A data browser.
The item ID number for the item.
The property ID for the item. In list view, this is the four-character sequence that you previously assigned to the column. In column view, this is the property kDataBrowserItemSelfIdentityProperty
.
The string to be edited. See Special Considerations for more information.
On input, a pointer to a rectangle structure. On return, set the rectangle to the largest size the edit field can grow to. If the text grows beyond the size of the edit field, the text scrolls as the user types. This parameter is used only if the parameter shrinkToFit
is true
. Otherwise, the current size of the text editing field is used.
On input, a pointer to a Boolean variable. On return, set this variable to true
if you want the data browser to expand or shrink the text editing field to match the width of the text in the edit field. Note that this parameter is currently ignored; shrinkToFit
is always true
by default.
A value that indicates whether or not you want to start an edit operation for the given property of the item. If your application performs the editing operation, your callback returns true
. Otherwise, your callback returns false
.
The edit-item callback is called by the data browser for an item whose property is kDataBrowserCustomType
. Your callback must determine whether an editing session should be started and, if so, set the string to be edited, set the size of the edit rectangle, and specify whether the text editing field can adjust to match the width of the text in the edit field.
To provide a pointer to your edit-item callback, you create a universal procedure pointer (UPP) of type DataBrowserEditItemUPP
, using the function NewDataBrowserEditItemUPP
. You can do so with code similar to the following:
DataBrowserEditItemUPP MyDataBrowserEditItemUPP; |
MyDataBrowserEditItemUPP = NewDataBrowserEditItemUPP |
(&MyDataBrowserEditItemCallback); |
You can then assign MyDataBrowserEditItemUPP
to the editItemCallback
field of the structure DataBrowserCustomCallbacks
. You install your data browser custom callbacks using the function SetDataBrowserCustomCallbacks
.
When you no longer need the UPP, remove it using the DisposeDataBrowserEditItemUPP
function.
This callback does not work properly. The theString
parameter is an immutable sting, which means it is not possible for the callback to set the string to the text that is to be edited.
HIDataBrowser.h
Defines a pointer to a get-contextual-menu callback function that obtains a menu and information about the menu.
typedef void (*DataBrowserGetContextualMenuProcPtr) ( ControlRef browser, MenuRef *menu, UInt32 *helpType, CFStringRef *helpItemString, AEDesc *selection );
You would declare a get-contextual-menu callback function named MyDataBrowserGetContextualMenuCallback
like this:
void MyDataBrowserGetContextualMenuCallback ( ControlRef browser, MenuRef *menu, UInt32 *helpType, CFStringRef *helpItemString, AEDesc *selection );
A data browser.
On input, a pointer to a menu. Your callback must set the pointer to the menu that you want to have displayed for the given item. Your application is responsible for disposing of the menu; you typically perform this task in the callback DataBrowserSelectContextualMenuProcPtr
.
On input, a pointer to an unsigned 32-bit integer. On return, this value specifies the type of help available for this item. This value is then passed by the data browser to the Menu Manager function ContextualMenuSelect
. You can provide one of the following values:
kCMHelpItemNoHelp
if your application does not support help. The Menu Manager inserts an appropriate string into the menu and then disables the associated help item.
kCMHelpItemAppleGuide
if your application supports Apple Guide help. The Menu Manager inserts the name of the main Apple Guide file into the menu and enables the associated help item. You can pass this in Mac OS 9. Apple Guide is not supported in Mac OS X. In Mac OS X, this value is ignored; a generic, but inactive, help item is displayed.
kCMHelpItemOtherHelp
if your application supports some other form of help. In this case, your application must pass a valid string in the helpItemString
parameter. The Menu Manager inserts the string in the menu and enables the associated help item.
See Menu Manager Reference for more information about these constants.
On input, a CFStringRef
variable. On return, a CFString object that contains the name of the item to display in the contextual menu. This is the first item that appears in the contextual menu. If you pass NULL
, the default string (“Help”) is displayed. Data Browser does not retain the string; it releases it.
On input, a pointer to an empty AEDesc
data structure. On return, the structure contains the data supplied by your callback. The data browser passes this structure to the function ContextualMenuSelect
.
The get-contextual-menu callback is called by the data browser when the user Control-clicks in the data browser. You application provides a menu and information about help that is (or is not) available for the data browser. You can determine what to provide for the content of the menu and what information to put in the AEDesc
structure by calling the function GetDataBrowserItems
with the state
parameter set to kDataBrowserItemIsSelected
. This tells you what items are selected, which you can then use to choose the appropriate information to supply.
To provide a pointer to your get-contextual-menu callback, you create a universal procedure pointer (UPP) of type DataBrowserGetContextualMenuUPP
, using the function NewDataBrowserGetContextualMenuUPP
. You can do so with code similar to the following:
DataBrowserGetContextualMenuUPP MyDataBrowserGetContextualMenuUPP; |
MyDataBrowserGetContextualMenuUPP = NewDataBrowserGetContextualMenuUPP |
(&MyDataBrowserGetContextualMenuCallback); |
You can then assign MyDataBrowserGetContextualMenuUPP
to the getContextualMenuCallback
field of the structure DataBrowserCallbacks
. You install your data browser callbacks using the function SetDataBrowserCallbacks
.
When you no longer need the UPP, remove it using the DisposeDataBrowserGetContextualMenuUPP
function.
HIDataBrowser.h
Defines a pointer to a hit-test callback function that determines if the pointer is over content that can be selected or dragged.
typedef Boolean (*DataBrowserHitTestProcPtr) ( ControlRef browser, DataBrowserItemID itemID, DataBrowserPropertyID property, const Rect *theRect, const Rect *mouseRect );
You would declare a hit-test callback function named MyDataBrowserHitTestCallback
like this:
Boolean MyDataBrowserHitTestCallback ( ControlRef browser, DataBrowserItemID itemID, DataBrowserPropertyID property, const Rect *theRect, const Rect *mouseRect );
A data browser.
The item ID number for the item over which the pointer is located.
The property ID for the column in which the pointer is located. In list view, this is the four-character sequence that you previously assigned to the column. In column view, this is the property kDataBrowserItemSelfIdentityProperty
.
A pointer to the bounding rectangle, in local coordinates, of the item.
A pointer to a rectangle structure that contains the local coordinates of the selection. If the top-left and bottom-right coordinates of this rectangle are identical, then a single point is being tested. If they differ, then the data browser is testing to see whether your custom item is inside of the bounding rectangle of a selection.
Your application returns a true
value for either of the following conditions:
The pointer is located over the part of the item that can be selected or dragged.
The rectangle provided in the parameter mouseRect
intersects with the content area of the item that can be selected or dragged.
The hit-test callback is called by the data browser when the user hovers the pointer over, clicks the mouse within, or drags within an item whose display type is kDataBrowserCustomType
. Your callback can use the functions SetRect
or SectRgn
to determine if the selectable content of the custom item is part of the selection. Figure 2 illustrates a situation for which the selectable or draggable content area differs from the background area in which the item is displayed.
To provide a pointer to your hit-test callback, you create a universal procedure pointer (UPP) of type DataBrowserHitTestItemUPP
, using the function NewDataBrowserHitTestUPP
. You can do so with code similar to the following:
DataBrowserHitTestUPP MyDataBrowserHitTestUPP; |
MyDataBrowserHitTestUPP = NewDataBrowserHitTestUPP |
(&MyDataBrowserHitTestCallback); |
You can then assign MyDataBrowserHitTestUPP
to the hitTestCallback
field of the structure DataBrowserCustomCallbacks
. You install your data browser custom callbacks using the function SetDataBrowserCustomCallbacks
.
When you no longer need the UPP, remove it using the DisposeDataBrowserHitTestUPP
function.
HIDataBrowser.h
Defines a pointer to an item-accept-drag callback function that determines if a custom item can accept a drag object.
typedef DataBrowserDragFlags (*DataBrowserItemAcceptDragProcPtr) ( ControlRef browser, DataBrowserItemID itemID, DataBrowserPropertyID property, const Rect *theRect, DragRef theDrag );
You would declare an item-accept-drag callback function named MyDataBrowserItemAcceptDragCallback
like this:
DataBrowserDragFlags MyDataBrowserItemAcceptDragCallback ( ControlRef browser, DataBrowserItemID itemID, DataBrowserPropertyID property, const Rect *theRect, DragRef theDrag );
A data browser.
The item ID number for the item the drag object is held over. If the drag object is over the data browser but not over any specific item, the item
parameter contains the item ID that represents one of the following:
The target in list view. (See SetDataBrowserTarget
.)
The column the drag object is over in column view
The property ID of the column the dragged object is over. In list view, this is the four-character sequence that you previously assigned to the column. In column view, this is the property kDataBrowserItemSelfIdentityProperty
.
A pointer to the bounding rectangle of the item, in local coordinates relative to the current port.
The drag reference provided by the data browser to your callback.
If your callback determines the drag object can be accepted, return a nonzero value that has the bit kDataBrowserItemIsDragTarget
set. Otherwise return kDataBrowserItemNoState
. The return value is then passed to your item-receive-drag callback in the dragFlags
parameter.
The item-accept-drag callback is called by the data browser for an item whose display type is kDataBrowserCustomType
when a drag object is moved over the item. Your application determines whether or not the associated item can accept the drag object. If the item cannot accept the drag object, return 0
. Otherwise, if the item is an acceptable drop location for the drag object, return a nonzero value.
If the drag object was acceptable and the drop occurs over that same item ID and property ID pair, the DataBrowserDragFlags
values you returned from your item-accept-drag callback are passed in the dragFlags
parameter to your item-receive-drag callback. This allows you to generate state information during drag tracking that can be communicated to you at drop time.
Do not call the function SetOrigin
in this or any of the other drag processing callbacks.
To provide a pointer to your item-accept-drag callback, you create a universal procedure pointer (UPP) of type DataBrowserItemAcceptDragUPP
, using the function NewDataBrowserItemAcceptDragUPP
. You can do so with code similar to the following:
DataBrowserItemAcceptDragUPP MyDataBrowserItemAcceptDragUPP; |
MyDataBrowserItemAcceptDragUPP = NewDataBrowserItemAcceptDragUPP |
(&MyDataBrowserItemAcceptDragCallback); |
You can then assign MyDataBrowserItemAcceptDragUPP
to the itemAcceptDragCallback
field of the structure DataBrowserCustomCallbacks
. You install your data browser custom callbacks using the function SetDataBrowserCustomCallbacks
.
When you no longer need the UPP, remove it using the DisposeDataBrowserItemAcceptDragUPP
function.
HIDataBrowser.h
Defines a pointer to an item-comparison callback function that orders the values displayed in a column.
typedef Boolean (*DataBrowserItemCompareProcPtr) ( ControlRef browser, DataBrowserItemID itemOne, DataBrowserItemID itemTwo, DataBrowserPropertyID sortProperty );
You would declare an item-comparison callback function named MyDataBrowserItemCompareCallback
like this:
Boolean MyDataBrowserItemCompareCallback ( ControlRef browser, DataBrowserItemID itemOne, DataBrowserItemID itemTwo, DataBrowserPropertyID sortProperty );
A data browser.
The item ID of the first item to use in the comparison.
The item ID of the second item to use in the comparison.
The property ID for the column to sort. In list view, this is the four-character sequence that you previously assigned to the column. In column view, this is the property kDataBrowserItemSelfIdentityProperty
.
Your callback returns true
if the value of the data referenced by itemOne
is less than the value of the data referenced by itemTwo
. It returns false
if the value of the data referenced by itemOne
is greater than or equal to the value of the data referenced by itemTwo
.
The item-comparison callback is called by the data browser when it needs to order the values displayed in a column. Your callback determines the display type of the data, then carries out the appropriate comparison for that data.
If you want your callback to use secondary and tertiary sorting, your application must keep track of previous sorting operations. Then you must make sure that each time a user clicks a column, the column is sorted, but the associated sorting orders for secondary and tertiary items in the column are preserved.
To provide a pointer to your item-comparison callback, you create a universal procedure pointer (UPP) of type DataBrowserItemCompareUPP
, using the function NewDataBrowserItemCompareUPP
. You can do so with code similar to the following:
DataBrowserItemCompareUPP MyDataBrowserItemCompareUPP; |
MyDataBrowserItemCompareUPP = NewDataBrowserItemCompareUPP |
(&MyDataBrowserItemCompareCallback); |
You can then assign MyDataBrowserItemCompareUPP
to the itemCompareCallback
field of the structure DataBrowserCallbacks
. You install your data browser callbacks using the function SetDataBrowserCallbacks
.
When you no longer need the UPP, remove it using the DisposeDataBrowserItemCompareUPP
function.
HIDataBrowser.h
Defines a pointer to an item-data callback function that gets and sets properties for individual items in a data browser.
typedef OSStatus (*DataBrowserItemDataProcPtr) ( ControlRef browser, DataBrowserItemID item, DataBrowserPropertyID property, DataBrowserItemDataRef itemData, Boolean setValue );
You would declare an item-data callback function named MyDataBrowserItemDataCallback
like this:
OSStatus MyDataBrowserItemDataCallback ( ControlRef browser, DataBrowserItemID item, DataBrowserPropertyID property, DataBrowserItemDataRef itemData, Boolean setValue );
The data browser.
The item ID of the item whose data is set or obtained.
A property ID. This value can be any of the following:
A four-character sequence that you assign to represent a column in list view.
Any of the API-defined properties, such as kDataBrowserItemSelfIdentityProperty
for a column in column view or kDataBrowserItemIsContainerProperty
for an item in list or column view that has children. See “Properties” for a complete list and more information on the API-defined properties.
The data buffer that either contains the data to set or receives the data to obtain.
A value that indicates whether data is to be obtained or set. This value is false
if your application needs to set the value of the item by calling one of the set functions described in the section “Getting and Setting Item Data.” This value is true
if the value of the item has changed. In this case, you should call the appropriate get function, passing the item data reference provided to you in the itemData
parameter.
A result code. See “Data Browser Result Codes.”
The item-data callback communicates data between the data browser and your application. When the data browser needs to display a value for an item, it invokes your callback to request the data. If the user changes the value, the data browser invokes your callback with a new copy of the data that you can use to replace your application’s internal copy. Your application must supply an item-data callback; otherwise, your data browser will not contain any data.
Your callback determines the kind of data is associated with an item and whether data needs to be obtained or set. Then, your callback takes the appropriate action by calling one of the functions listed in “Getting and Setting Item Data.”
To provide a pointer to your item-data callback, you create a universal procedure pointer (UPP) of type DataBrowserItemDataUPP
, using the function NewDataBrowserItemDataUPP
. You can do so with code similar to the following:
DataBrowserItemDataUPP MyDataBrowserItemDataUPP; |
MyDataBrowserItemDataUPP = NewDataBrowserItemDataUPP |
(&MyDataBrowserItemDataCallback); |
You can then assign MyDataBrowserItemDataUPP
to the itemDataCallback
field of the structure DataBrowserCallbacks
. You install your data browser callbacks using the function SetDataBrowserCallbacks
.
When you no longer need the UPP, remove it using the DisposeDataBrowserItemDataUPP
function.
HIDataBrowser.h
Defines a pointer to an item-drag-region callback function that determines which part of the item rectangle to use when creating a transparent image for a dragged custom item.
typedef void (*DataBrowserItemDragRgnProcPtr) ( ControlRef browser, DataBrowserItemID itemID, DataBrowserPropertyID property, const Rect *theRect, RgnHandle dragRgn );
You would declare an item-drag-region callback function named MyDataBrowserItemDragRgnCallback
like this:
void MyDataBrowserItemDragRgnCallback ( ControlRef browser, DataBrowserItemID itemID, DataBrowserPropertyID property, const Rect *theRect, RgnHandle dragRgn );
A data browser.
The item ID number for the row for which the drag image is generated.
The property ID for the column for which the drag image is generated. In list view, this is the four-character sequence that you previously assigned to the column. In column view, this is the property kDataBrowserItemSelfIdentityProperty
.
A pointer to the bounding rectangle of the item, in local coordinates.
On return, the drag region set to the portion of the rectangle to use for the transparent drag image. Typically this is the boundary of the content area inside your custom item. This region is used as a mask when passed to your custom draw-item callback.
The item-drag-region callback is called by the data browser for an item whose display type is kDataBrowserCustomType
when a drag is about to begin. Your application determines which part of the item rectangle to use when creating the transparent image that appears during a drag operation. The data browser uses this area as a clipping region when it invokes your draw-item callback.
Do not call the function SetOrigin
in this or any of the other drag processing callbacks.
To provide a pointer to your item-drag-region callback, you create a universal procedure pointer (UPP) of type DataBrowserItemDragRgnUPP
, using the function NewDataBrowserItemDragRgnUPP
. You can do so with code similar to the following:
DataBrowserItemDragRgnUPP MyDataBrowserItemDragRgnUPP; |
MyDataBrowserItemDragRgnUPP = NewDataBrowserItemDragRgnUPP |
(&MyDataBrowserItemDragRgnCallback); |
You can then assign MyDataBrowserItemDragRgnUPP
to the itemDragRgnCallback
field of the structure DataBrowserCustomCallbacks
. You install your data browser custom callbacks using the function SetDataBrowserCustomCallbacks
.
When you no longer need the UPP, remove it using the DisposeDataBrowserItemDragRgnUPP
function.
HIDataBrowser.h
Defines a pointer to an item-help-content callback function that provides help tag content for an item.
typedef void (*DataBrowserItemHelpContentProcPtr) ( ControlRef browser, DataBrowserItemID item, DataBrowserPropertyID property, HMContentRequest inRequest, HMContentProvidedType *outContentProvided, HMHelpContentPtr ioHelpContent );
You would declare an item-help-content callback function named MyDataBrowserItemHelpContentCallback
like this:
void DataBrowserItemHelpContentCallback ( ControlRef browser, DataBrowserItemID item, DataBrowserPropertyID property, HMContentRequest inRequest, HMContentProvidedType *outContentProvided, HMHelpContentPtr ioHelpContent );
A data browser.
The item ID of the item to provide help for.
The property ID of the column to provide help for. In list view, this is the four-character sequence that you previously assigned to the column. In column view, this is the property kDataBrowserItemSelfIdentityProperty
.
On input, a value that indicates the nature of the help tag content request. Your callback is passed one of the following constants:
kHMSupplyContent
indicates your callback needs to supply help content.
kHMDisposeContent
indicates your callback must dispose of help content.
On input, a help-content-type variable. On return, the variable is set to one of the following constants that indicate whether your item-help callback was able to fulfill the request specified in the inRequest
parameter:
kHMContentProvided
indicates help content is provided in the ioHelpContent
parameter.
kHMContentNotProvided
indicates help content is not provided. When your callback returns this constant, the Carbon Help Manager consults other help content providers in the hierarchy until the request for help tag content is fulfilled, the top of the hierarchy is reached, or a help tag callback notifies the Carbon Help Manager to stop propagating the request.
kHMContentNotProvidedDontPropagate
indicates help content is not provided. When your callback returns this constant, the Carbon Help Manager assumes that there is no help content for the data browser item and does not propagate the request.
See Carbon Help Manager Reference for more information on these constants.
A help tag structure that describes the help tag for the item. On input, the data browser passes a value in the version field. If the value of the inRequest
parameter is kHMSupplyContent
, your callback must fill in the remaining fields of the structure or specify that it is unable to fulfill the help tag content request.
The item-help-content callback is called by the data browser when the user hovers the pointer over an item in a data browser for which you’ve registered a help tag callback. Your application fills in the help tag structure pointed to by the ioHelpContent
parameter.
When the help tag for the item is no longer needed, the data browser invokes your callback with a kHMDisposeContent
request. When you receive this request, free any memory allocated for the help tag content and perform any other cleanup tasks that are necessary.
To provide a pointer to your item-help-content callback, you create a universal procedure pointer (UPP) of type DataBrowserItemHelpContentUPP
, using the function NewDataBrowserItemHelpContentUPP
. You can do so with code similar to the following:
DataBrowserItemHelpContentUPP MyDataBrowserItemHelpContentUPP; |
MyDataBrowserItemHelpContentUPP = NewDataBrowserItemHelpContentUPP |
(&MyDataBrowserItemHelpContentCallback); |
You can then assign MyDataBrowserItemHelpContentUPP
to the itemHelpContentCallback
field of the structure DataBrowserCallbacks
. You install your data browser callbacks using the function SetDataBrowserCallbacks
.
When you no longer need the UPP, remove it using the DisposeDataBrowserItemHelpContentUPP
function.
HIDataBrowser.h
Defines a pointer to an item-notification callback function that notifies your application of changes in the data browser.
typedef void (*DataBrowserItemNotificationProcPtr) ( ControlRef browser, DataBrowserItemID item, DataBrowserItemNotification message );
You would declare an item-notification callback function named MyDataBrowserItemNotificationCallback
like this:
void MyDataBrowserItemNotificationCallback ( ControlRef browser, DataBrowserItemID item, DataBrowserItemNotification message );
A data browser.
The item ID of the item that generated the notification.
A notification. See “Item Notifications” for a description of the values that can be provided to your callback.
The item-notification callback is called by the data browser to notify your application of actions taken by the user (such as editing started, container opened, container closed) or any other condition that your application might choose to respond to. Your item-notification callback can evaluate the notification and take appropriate action.
To provide a pointer to your item-notification callback, you create a universal procedure pointer (UPP) of type DataBrowserItemNotificationUPP
, using the function NewDataBrowserItemNotificationUPP
. You can do so with code similar to the following:
DataBrowserItemNotificationUPP MyDataBrowserItemNotificationUPP; |
MyDataBrowserItemNotificationUPP = NewDataBrowserItemNotificationUPP |
(&MyDataBrowserItemNotificationCallback); |
You can then assign MyDataBrowserItemNotificationUPP
to the itemNotificationCallback
field of the structure DataBrowserCallbacks
. You install your data browser callbacks using the function SetDataBrowserCallbacks
.
When you no longer need the UPP, remove it using the DisposeDataBrowserItemNotificationUPP
function.
In CarbonLib the item-notification callback is invoked with the three parameters shown in DataBrowserItemNotificationProcPtr
. The four-parameter version—DataBrowserItemNotificationWithItemProcPtr
—does not provide valid data in the fourth parameter. Any attempt to use the invalid data in a CarbonLib application may result in a crash.
In Mac OS X, the item-notification callback is invoked with the four parameters shown in DataBrowserItemNotificationWithItemProcPtr
. In Mac OS X you have the option of using the DataBrowserItemNotificationProcPtr
or the DataBrowserItemNotificationWithItemProcPtr
. Which one you choose depends on whether your application needs to use the data passed to your callback in the fourth parameter (the itemData
parameter).
HIDataBrowser.h
Defines a pointer to an item-notification-with-data callback function that notifies your application of changes in the data browser and supplies any data associated with the changes.
typedef void (*DataBrowserItemNotificationWithItemProcPtr) ( ControlRef browser, DataBrowserItemID item, DataBrowserItemNotification message, DataBrowserItemDataRef itemData );
You would declare an item-notification-with-data callback function named MyDataBrowserItemNotificationWithItemCallback
like this:
void MyDataBrowserItemNotificationWithItemCallback ( ControlRef browser, DataBrowserItemID item, DataBrowserItemNotification message, DataBrowserItemDataRef itemData );
A data browser.
The item ID of the item that generated the notification.
A notification. See “Item Notifications” for a description of the values that can be provided to your callback.
The data associated with the changes in the data browser that caused this callback to be invoked. You pass this data to functions that get and set item data (such as SetDataBrowserItemDataIcon
, SetDataBrowserItemDataText
, GetDataBrowserItemDataIcon
, and GetDataBrowserItemDataText
). See “Getting and Setting Item Data” for a list of all the function that can use item data.
The item-notification-with-data callback is called by the data browser to notify your application of actions taken by the user (such as editing started, container opened, container closed) or any other condition that your application might choose to respond to. Your item-notification-with-data callback can evaluate the notification and take appropriate action. Unlike the callback DataBrowserItemNotificationProcPtr
, the callback DataBrowserItemNotificationWithItemProcPtr
provides a fourth parameter that contains any data associated with the item from which the notification is generated. This data is available only to Mac OS X applications. See Special Considerations for more details.
To provide a pointer to your item-notification-with-data callback, you create a universal procedure pointer (UPP) of type DataBrowserItemNotificationWithItemUPP
, using the function NewDataBrowserItemNotificationWithItemUPP
. You can do so with code similar to the following:
DataBrowserItemNotificationWithItemUPP |
MyDataBrowserItemNotificationWithItemUPP; |
MyDataBrowserItemNotificationWithItemUPP = |
NewDataBrowserItemNotificationWithItemUPP |
(&MyDataBrowserItemNotificationWithItemCallback); |
You can then assign MyDataBrowserItemNotificationWithItemUPP
to the itemNotificationCallback
field of the structure DataBrowserCallbacks
. You install your data browser callbacks using the function SetDataBrowserCallbacks
.
When you no longer need the UPP, remove it using the DisposeDataBrowserItemNotificationWithItemUPP
function.
In CarbonLib the item-notification callback is invoked with the three parameters shown in DataBrowserItemNotificationProcPtr
. The four-parameter version (DataBrowserItemNotificationWithItemProcPtr
) does not provide valid data in the fourth parameter. Any attempt to use the invalid data in a CarbonLib application may result in a crash.
In Mac OS X, the item-notification callback is invoked with the four parameters shown in DataBrowserItemNotificationWithItemProcPtr
. In Mac OS X you have the option of using the DataBrowserItemNotificationProcPtr
or the DataBrowserItemNotificationWithItemProcPtr
. Which one you choose depends on whether your application needs to use the data passed to your callback in the fourth parameter (itemData
).
HIDataBrowser.h
Defines a pointer to an item-iterator callback function that is applied by the function ForEachDataBrowserItem
to each item in a data browser.
typedef void (*DataBrowserItemProcPtr) ( DataBrowserItemID item, DataBrowserItemState state, void *clientData );
You would declare an item-iterator callback function named MyDataBrowserItemCallback
like this:
void MyDataBrowserItemCallback ( DataBrowserItemID item, DataBrowserItemState state, void *clientData );
The item ID of the item to operate on.
The state of the item. See “Item States” for a description of possible states. If the functionForEachDataBrowserItem
is set up to operate on items of a specified state, then the state passed to your callback includes the state specified as a parameter to ForEachDataBrowserItem
.
A pointer to a buffer, local variable, or other storage location created and disposed of by your application, and supplied to the data browser with a previous call to ForEachDataBrowserItem
.
An item-iterator callback is supplied as a parameter to the function ForEachDataBrowserItem
. The function applies your callback to each data item that meets the criteria specified by the function ForEachDataBrowserItem
.
To provide a pointer to your item-iterator callback, you create a universal procedure pointer (UPP) of type DataBrowserItemUPP
, using the function NewDataBrowserItemUPP
. You can do so with code similar to the following:
DataBrowserItemUPP MyDataBrowserItemUPP; |
MyDataBrowserItemUPP = NewDataBrowserItemUPP |
(&MyDataBrowserItemCallback); |
You can then pass MyDataBrowserItemUPP
in the callback
parameter of the function ForEachDataBrowserItem
. When you no longer need the UPP, remove it using the DisposeDataBrowserItemUPP
function.
HIDataBrowser.h
Defines a pointer to an item-receive-drag callback function that receives a drop over a custom item.
typedef Boolean (*DataBrowserItemReceiveDragProcPtr) ( ControlRef browser, DataBrowserItemID itemID, DataBrowserPropertyID property, DataBrowserDragFlags dragFlags, DragRef theDrag );
You would declare an item-receive-drag callback function named MyDataBrowserItemReceiveDragCallback
like this:
Boolean MyDataBrowserItemReceiveDragCallback ( ControlRef browser, DataBrowserItemID itemID, DataBrowserPropertyID property, DataBrowserDragFlags dragFlags, DragRef theDrag );
A data browser.
The item ID number for the item over which the drop occurred.
The property ID for the column in which the drop occurred. In list view, this is the four-character sequence that you previously assigned to the column. In column view, this is the property kDataBrowserItemSelfIdentityProperty
.
A drag flag. This value is kDataBrowserItemIsDragTarget
if your item-accept-drag callback determined the drag object can be accepted.
The drag reference provided by the data browser to your callback.
A value that indicates whether the drop is received. Your callback returns true
if it successfully receives the drag object. If it returns false
, zoom-back animation occurs.
After your item-accept-drag callback has determined that a location can accept a drag object and after a drop operation occurs, the data browser calls your item-receive-drag callback. Your application takes whatever actions necessary to add the dropped data to the data browser.
Do not call the function SetOrigin
in this or any of the drag processing callbacks.
To provide a pointer to your item-receive-drag callback, you create a universal procedure pointer (UPP) of type DataBrowserItemReceiveDragUPP
, using the function NewDataBrowserItemReceiveDragUPP
. You can do so with code similar to the following:
DataBrowserItemReceiveDragUPP MyDataBrowserItemReceiveDragUPP; |
MyDataBrowserItemReceiveDragUPP = NewDataBrowserItemReceiveDragUPP |
(&MyDataBrowserItemReceiveDragCallback); |
You can then assign MyDataBrowserItemReceiveDragUPP
to the itemReceiveDragCallback
field of the structure DataBrowserCustomCallbacks
. You install your data browser custom callbacks using the function SetDataBrowserCustomCallbacks
.
When you no longer need the UPP, remove it using the DisposeDataBrowserItemReceiveDragUPP
function.
HIDataBrowser.h
Defines a pointer to a postprocess-drag callback function that performs necessary cleanup tasks, such as deallocating resources that were allocated by your other drag processing callbacks.
typedef void (*DataBrowserPostProcessDragProcPtr) ( ControlRef browser, DragRef theDrag, OSStatus trackDragResult );
You would declare a postprocess-drag callback function named MyDataBrowserPostProcessDragCallback
like this:
void MyDataBrowserPostProcessDragCallback ( ControlRef browser, DragRef theDrag, OSStatus trackDragResult );
A data browser.
The drag reference provided by the data browser to your callback.
The result returned by the function TrackDrag
and passed to your callback by the data browser.
This callback is called after starting a drag from within the data browser. It is not called if the drag originated from somewhere else.
The postprocess-drag callback is called by the data browser after a drag process is complete and any drag processing callback routines you installed (add drag, accept drag, or receive drag callbacks) were called during the drag operation. Your postprocess-drag callback deallocates any resources that were allocated by your other drag-processing callbacks. Your postprocess-drag callback is called immediately before the drag reference is deallocated by the data browser so your application should not assume the drag reference exists after your callback completes.
To provide a pointer to your postprocess-drag callback, you create a universal procedure pointer (UPP) of type DataBrowserPostProcessDragUPP
, using the function NewDataBrowserPostProcessDragUPP
. You can do so with code similar to the following:
DataBrowserPostProcessDragUPP MyDataBrowserPostProcessDragUPP; |
MyDataBrowserPostProcessDragUPP = NewDataBrowserPostProcessDragUPP |
(&MyDataBrowserPostProcessDragCallback); |
You can then assign MyDataBrowserPostProcessDragUPP
to the postProcessDragCallback
field of the structure DataBrowserCallbacks
. You install your data browser callbacks using the function SetDataBrowserCallbacks
.
When you no longer need the UPP, remove it using the DisposeDataBrowserPostProcessDragUPP
function.
HIDataBrowser.h
Defines a pointer to a receive-drag callback function that extract items from a drag object and handles the drag item appropriately.
typedef Boolean (*DataBrowserReceiveDragProcPtr) ( ControlRef browser, DragRef theDrag, DataBrowserItemID item );
You would declare a receive-drag callback function named MyDataBrowserReceiveDragCallback
like this:
Boolean MyDataBrowserReceiveDragCallback ( ControlRef browser, DragRef theDrag, DataBrowserItemID item );
A data browser.
The drag reference provided by the data browser to your callback.
The item ID of the item over which the drop operation occurred. If the drag object is over the data browser, but not over any specific item, the item
parameter contains the item ID that represents one of the following:
In list view, the target. (See SetDataBrowserTarget
.)
In column view, the item ID that represents the column the drag object is over
Your callback returns true
if it successfully processes the information in the drag object. Otherwise, your callback returns false
to have zoom-back animation occur for the drag object, thereby indicating to the user that the drag operation was not successful.
The receive-drag callback is called by the data browser when your application needs to receive a drag object. Your application extracts the items it needs from the drag object and processes them appropriately.
To provide a pointer to your receive-drag callback, you create a universal procedure pointer (UPP) of type DataBrowserReceiveDragUPP
, using the function NewDataBrowserReceiveDragUPP
. You can do so with code similar to the following:
DataBrowserReceiveDragUPP MyDataBrowserReceiveDragUPP; |
MyDataBrowserReceiveDragUPP = NewDataBrowserReceiveDragUPP |
(&MyDataBrowserReceiveDragCallback); |
You can then assign MyDataBrowserReceiveDragUPP
to the receiveDragCallback
field of the structure DataBrowserCallbacks
. You install your data browser callbacks using the function SetDataBrowserCallbacks
.
When you no longer need the UPP, remove it using the DisposeDataBrowserReceiveDragUPP
function.
HIDataBrowser.h
Defines a pointer to a select-contextual-menu callback function that processes a contextual menu selection.
typedef void (*DataBrowserSelectContextualMenuProcPtr) ( ControlRef browser, MenuRef menu, UInt32 selectionType, SInt16 menuID, MenuItemIndex menuItem );
You would declare a select-contextual-menu callback function named MyDataBrowserSelectContextualMenuCallback
like this:
void MyDataBrowserSelectContextualMenuCallback ( ControlRef browser, MenuRef menu, UInt32 selectionType, SInt16 menuID, MenuItemIndex menuItem );
A data browser.
On input, the menu reference your application provided to the data browser in the callback DataBrowserGetContextualMenuProcPtr
.
On input, the selection type provided to the data browser from the Menu Manager function ContextualMenuSelect
.
On input, the menu ID of the menu selected. This value is 0
if no selection was made.
The menu item index of the item selected.
The select-contextual-menu callback is called by the data browser when the user finishes interacting with a contextual menu. Your callback needs to:
Check whether the user chose an item from the menu. If so, process the selection appropriately. Note that your callback is invoked even if the user does not choose an item from the menu.
Optionally dispose of the menu you allocated in your get-contextual-menu callback, and that is passed to your select-contextual-menu callback in the menu
parameter.
To provide a pointer to your select-contextual-menu callback, you create a universal procedure pointer (UPP) of type DataBrowserSelectContextualMenuUPP
, using the function NewDataBrowserSelectContextualMenuUPP
. You can do so with code similar to the following:
DataBrowserSelectContextualMenuUPP MyDataBrowserSelectContextualMenuUPP; |
MyDataBrowserSelectContextualMenuUPP = |
NewDataBrowserSelectContextualMenuUPP |
(&MyDataBrowserSelectContextualMenuCallback); |
You can then assign MyDataBrowserSelectContextualMenuUPP
to the selectContextualMenuCallback
field of the structure DataBrowserCallbacks
. You install your data browser callbacks using the function SetDataBrowserCallbacks
.
When you no longer need the UPP, remove it using the DisposeDataBrowserSelectContextualMenuUPP
function.
HIDataBrowser.h
Defines a pointer to a tracking callback function that implements tracking behavior for such tasks as highlighting a button or providing animation when the user clicks a custom item.
typedef DataBrowserTrackingResult (*DataBrowserTrackingProcPtr) ( ControlRef browser, DataBrowserItemID itemID, DataBrowserPropertyID property, const Rect *theRect, Point startPt, EventModifiers modifiers );
You would declare a tracking callback function named MyDataBrowserTrackingCallback
like this:
DataBrowserTrackingResult MyDataBrowserTrackingCallback ( ControlRef browser, DataBrowserItemID itemID, DataBrowserPropertyID property, const Rect *theRect, Point startPt, EventModifiers modifiers );
A data browser.
The item ID number for the item the user clicked.
The property ID for the column in which the pointer is located. In list view, this is the four-character sequence that you previously assigned to the column. In column view, this is the property kDataBrowserItemSelfIdentityProperty
.
A pointer to the bounding rectangle of the item, in local coordinates relative to the current port.
The location of the pointer at the start of the click.
The state of the modifier keys. See Carbon Event Manager Reference in Carbon Events & Other Input Documentation for a list of the constants that can be passed to your callback.
A tracking result that indicates whether further processing is required by the data browser. Your callback returns kDataBrowserStopTracking
, kDataBrowserContentHit
, or kDataBrowserNothingHit
. See the Discussion for more details.
The tracking callback is called by the data browser for an item whose display type is kDataBrowserCustomType
when a mouse click is inside the content area of the item. Your tracking callback is called only for mouse-down events and only after your DataBrowserHitTestProcPtr
callback returns true
. Your tracking callback performs one of following tasks:
Provides its own custom tracking behavior and animation and returns the result kDataBrowserStopTracking
. This result informs the data browser that your application handled the click and no further processing is required. The data browser does not attempt to display a contextual menu, start a drag operation, process a double-click, or draw a selection rectangle. You are responsible for all facets of click handling if you return kDataBrowserStopTracking
.
Returns the value kDataBrowserNothingHit
to indicate a negative hit and no further processing needs to take place. This result indicates that a nonselectable portion—whitespace—was hit. The data browser won’t select the item, but it could, for example, start a selection rectangle.
Returns the value kDataBrowserContentHit
to request that the data browser continues to process the click. This result indicates that a selectable portion of the item is hit. The data browser selects the item and takes other appropriate actions.
To provide a pointer to your tracking callback, you create a universal procedure pointer (UPP) of type DataBrowserTrackingUPP
, using the function NewDataBrowserTrackingUPP
. You can do so with code similar to the following:
DataBrowserTrackingUPP MyDataBrowserTrackingUPP; |
MyDataBrowserTrackingUPP = NewDataBrowserTrackingUPP |
(&MyDataBrowserTrackingCallback); |
You can then assign MyDataBrowserTrackingUPP
to the trackingCallback
field of the structure DataBrowserCustomCallbacks
. You install your data browser custom callbacks using the function SetDataBrowserCustomCallbacks
.
When you no longer need the UPP, remove it using the DisposeDataBrowserTrackingUPP
function.
HIDataBrowser.h
Contains a structure that describes data browser accessibility item information.
struct DataBrowserAccessibilityItemInfo { UInt32 version; union { DataBrowserAccessibilityItemInfoV0 v0; DataBrowserAccessibilityItemInfoV1 v1; } u; typedef struct DataBrowserAccessibilityItemInfoV0 v0; typedef struct DataBrowserAccessibilityItemInfoV1 v1;
version
Identifies how to interpret the following union. Set this field to 0
if you fill out the union’s data in the form of a DataBrowserAccessibilityItemInfoV0
structure. Set this field to 1
if you fill out the union’s data in the form of a DataBrowserAccessibilityItemInfoV1
structure.
u.v0
A DataBrowserAccessibilityItemInfoV0
structure.
u.v1
A DataBrowserAccessibilityItemInfoV1
structure.
Contains a description of data browser accessibility item information.
struct DataBrowserAccessibilityItemInfoV0 { DataBrowserItemID container; DataBrowserItemID item; DataBrowserPropertyID columnProperty; DataBrowserPropertyPart propertyPart; } typedef struct DataBrowserAccessibilityItemInfoV0 DataBrowserAccessibilityInfoV0;
container
The DataBrowserItemID
of the container the AXUIElementRef
represents or lives within. Even kDataBrowserNoItem
might be meaningful, since it is the root container ID if you haven’t overridden it via SetDataBrowserTarget
. In list view, the container helps narrow down the
AXUIElementRef
to either a disclosed child of another row, or the list as a whole. In column view, the container helps narrow down the AXUIElementRef
to a column. See also the description of the columnProperty
field.
item
The DataBrowserItemID
of the item the AXUIElementRef
represents or lives within. If item
is kDataBrowserNoItem
, the AXUIElementRef
represents just the container. In list view, item
helps narrow down the AXUIElementRef
to a row or the root container as a whole. In column view, item
helps narrow down the AXUIElementRef
to a cell or a column as a whole. See also the description of the columnProperty
field.
columnProperty
The DataBrowserPropertyID
of the column the AXUIElementRef
represents or lives within. If columnProperty
is kDataBrowserItemNoProperty
and item
is not kDataBrowserNoItem
, the AXUIElementRef
represents a whole row. In list view, this field helps narrow down the AXUIElementRef
to a cell or a row as a whole. In column view, columnProperty
must always be set to kDataBrowserItemNoProperty
unless the AXUIElementRef
represents the preview column. When the AXUIElementRef
represents the preview column, columnProperty
must always be set to kDataBrowserColumnViewPreviewProperty
and the other fields of this structure must be set to 0
or the equivalent constant.
propertyPart
The DataBrowserPropertyPart
of the sub-cell part the AXUIElementRef
represents. Examples include the disclosure triangle in a cell, the text in a cell, and the check box in a cell. If propertyPart
is kDataBrowserPropertyEnclosingPart
and columnProperty
is not kDataBrowserItemNoProperty
, the AXUIElementRef
represents the cell as a whole. In both list view and column view, this field helps narrow down the AXUIElementRef
to either a sub-cell part or a cell as a whole. For column view, see also the description of the columnProperty
field.
Contains a description of data browser accessibility item information that includes a row and a column index.
struct DataBrowserAccessibilityItemInfoV1 { DataBrowserItemID container; DataBrowserItemID item; DataBrowserPropertyID columnProperty; DataBrowserPropertyPart propertyPart; DataBrowserTableViewRowIndex rowIndex; DataBrowserTableViewColumnIndex columnIndex; } typedef struct DataBrowserAccessibilityItemInfoV1 DataBrowserAccessibilityInfoV1;
container
The DataBrowserItemID
of the container the AXUIElementRef
represents or lives within. Even kDataBrowserNoItem
might be meaningful, since it is the root container ID if you haven’t overridden it via SetDataBrowserTarget
. In list view, the container helps narrow down the
AXUIElementRef
to either a disclosed child of another row, or the list as a whole. In column view, the container helps narrow down the AXUIElementRef
to a column. See also the description of the columnProperty
field.
item
The DataBrowserItemID
of the item the AXUIElementRef
represents or lives within. If item
is kDataBrowserNoItem
, the AXUIElementRef
represents just the container. In list view, item
helps narrow down the AXUIElementRef
to a row or the root container as a whole. In column view, item
helps narrow down the AXUIElementRef
to a cell or a column as a whole. See also the description of the columnProperty
field.
columnProperty
The DataBrowserPropertyID
of the column the AXUIElementRef
represents or lives within. If columnProperty
is kDataBrowserItemNoProperty
and item
is not kDataBrowserNoItem
, the AXUIElementRef
represents a whole row. In list view, this field helps narrow down the AXUIElementRef
to a cell or a row as a whole. In column view, columnProperty
must always be set to kDataBrowserItemNoProperty
unless the AXUIElementRef
represents the preview column. When the AXUIElementRef
represents the preview column, columnProperty
must always be set to kDataBrowserColumnViewPreviewProperty
and the other fields of this structure must be set to 0
or the equivalent constant.
propertyPart
The DataBrowserPropertyPart
of the sub-cell part the AXUIElementRef
represents. Examples include the disclosure triangle in a cell, the text in a cell, and the check box in a cell. If propertyPart
is kDataBrowserPropertyEnclosingPart
and columnProperty
is not kDataBrowserItemNoProperty
, the AXUIElementRef
represents the cell as a whole. In both list view and column view, this field helps narrow down the AXUIElementRef
to either a sub-cell part or a cell as a whole. For column view, see also the description of the columnProperty
field.
rowIndex
The zero-based DataBrowserTableViewRowIndex
of the row specified by the other parts of this structure. If the other parts of this structure do not specify a row or a part thereof, this field must be set to 0. Because this field is zero based, you must test the other parts of this structure to see whether this field is meaningful. In list view, when the other parts of this structure specify an item or part thereof, this field must be set to the row index at which the specified item can be found. In column view, when the other parts of this structure specify a cell or part thereof, this field must be set to the row index at which the specified cell can be found.
propertyPart
The zero-based DataBrowserTableViewColumnIndex
of the column specified by the other parts of this structure. If the other parts of this structure do not specify a column or a part thereof, this field must be set to zero. Because this field is zero based, you must test the other parts this structure to see whether this field is meaningful. In list view, when the other parts of this structure specify a cell or part thereof, this field must be set to the column index at which the specified cell can be found. In column view, when the other parts of this structure specify a column or part thereof, this field must be set to the column index at which the specified cell can be found.
Contains property and display information for a list view column.
struct DataBrowserPropertyDesc { DataBrowserPropertyID propertyID; DataBrowserPropertyType propertyType; DataBrowserPropertyFlags propertyFlags; }; typedef struct DataBrowserPropertyDesc DataBrowserPropertyDesc;
propertyID
A four-character sequence that uniquely identifies the column. If you use Interface Builder to design the data browser, this is the unique value you enter in the Property ID field in the column paned of the Info window for a list view column. (For example, mTxt
or BLUE
). The four-character sequence must have at least one uppercase letter in it because sequences that are all lowercase are reserved for Apple.
propertyType
The data type or control type to be displayed in the column. See “Display Types” for a list of the possible values for this field.
propertyFlags
A value that contains property flags that control the display or interaction provided by the column. This is a 32-bit value that is divided into four parts as follows:
Bits 0–7 specify properties applied to the data browser as a whole—see “Property Flags: Universal”
Bits 8–15 modify display behavior—see “Property Flags: Modifiers”
Bits 16–23 are properties specific to list view—see “Property Flags: Offset and Mask for List View Properties” and “Property Flags: List View Column Behavior”
Bits 24–31 can be defined by your application—see “Property Flags: Offset and Mask for Client-Defined Properties”
HIDataBrowser.h
Contains universal procedure pointers (UPPs) to callback functions used to obtain information from your application or notify your application of changes to the data browser.
struct DataBrowserCallbacks { UInt32 version union { struct { DataBrowserItemDataUPP itemDataCallback; DataBrowserItemCompareUPP itemCompareCallback; DataBrowserItemNotificationUPP itemNotificationCallback; DataBrowserAddDragItemUPP addDragItemCallback; DataBrowserAcceptDragUPP acceptDragCallback; DataBrowserReceiveDragUPP receiveDragCallback; DataBrowserPostProcessDragUPP postProcessDragCallback; DataBrowserItemHelpContentUPP itemHelpContentCallback; DataBrowserGetContextualMenuUPP getContextualMenuCallback; DataBrowserSelectContextualMenuUPP selectContextualMenuCallback; } v1; } u; }; typedef struct DataBrowserCallbacks DataBrowserCallbacks;
version
The version of the custom callbacks structure. Set this field to the constant kDataBrowserLatestCallbacks
.
u.v1.itemDataCallback
A universal procedure pointer to an item-data callback.
u.v1.itemCompareCallback
A universal procedure pointer to an item-compare callback.
u.v1.itemNotificationCallback
A universal procedure pointer to an item-notification callback or item-notification-with-data callback.
u.v1.addDragItemCallback
A universal procedure pointer to an add-drag-item callback.
u.v1.acceptDragCallback
A universal procedure pointer to an accept-drag callback.
u.v1.receiveDragCallback
A universal procedure pointer to a receive-drag callback.
u.v1.postProcessDragCallback
A universal procedure pointer to a postprocess-drag callback.
u.v1.itemHelpContentCallback
A universal procedure pointer to an item-help-content callback.
u.v1.getContextualMenuCallback
A universal procedure pointer to a get-contextual-menu callback.
u.v1.selectContextualMenuCallback
A universal procedure pointer to a select-contextual-menu callback.
Your application does not need to fill out the entire data structure. It must provide a UPP to an item-data callback. You provide UPPs only for the other tasks your application wants to handle. For more information on installing callbacks, see the functions InitDataBrowserCallbacks
and SetDataBrowserCallbacks
.
HIDataBrowser.h
Contains universal procedure pointers (UPPs) to callback functions that implement custom drawing and user interaction for columns that have the display type kDataBrowserCustomType
.
struct DataBrowserCustomCallbacks { UInt32 version union { struct { DataBrowserDrawItemUPP drawItemCallback; DataBrowserEditItemUPP editTextCallback; DataBrowserHitTestUPP hitTestCallback; DataBrowserTrackingUPP trackingCallback; DataBrowserItemDragRgnUPP dragRegionCallback; DataBrowserItemAcceptDragUPP acceptDragCallback; DataBrowserItemReceiveDragUPP receiveDragCallback; } v1; } u; }; typedef struct DataBrowserCustomCallbacks DataBrowserCustomCallbacks;
version
The version of the custom callbacks structure. Use kDataBrowserLatestCustomCallbacks
.
u.v1.drawItemCallback
A universal procedure pointer to a draw-item callback.
u.v1.editTextCallback
A universal procedure pointer to an edit-text callback.
u.v1.hitTestCallback
A universal procedure pointer to a hit-test callback
u.v1.trackingCallback
A universal procedure pointer to a tracking callback.
u.v1.dragRegionCallback
A universal procedure pointer to an item-drag-region callback.
u.v1.acceptDragCallback
A universal procedure pointer to an item-accept-drag callback.
u.v1.receiveDragCallback
A universal procedure pointer to an item-receive-drag callback.
Your application can use the DataBrowserCustomCallbacks
structure to provide callbacks that control the presentation of user interface elements displayed inside a data browser. Your application does not need to fill out the entire data structure. You need to provide UPPs only for tasks your application wants to handle. For more information on installing callbacks, see the functions InitDataBrowserCustomCallbacks
and SetDataBrowserCustomCallbacks
.
HIDataBrowser.h
Defines a data type for values used in drag callbacks.
typedef unsigned long DataBrowserDragFlags;
This data type is used as a return value for the item-accept-drag callback (DataBrowserItemAcceptDragProcPtr
) and as a parameter to the item-receive-drag callback (DataBrowserItemReceiveDragProcPtr
). The values associated with this data type are kDataBrowserItemIsDragTarget
and kDataBrowserItemNoState
. See “Item States” for more information on these constants.
HIDataBrowser.h
Defines a data type for a pointer that specifies an item.
typedef void *DataBrowserItemDataRef;
Functions listed in “Getting and Setting Item Data” are called from within a data browser item-data callback routine (DataBrowserItemDataProcPtr
). Each of these functions use a DataBrowserItemDataRef
data type to specify the item to get or set data for.
HIDataBrowser.h
Defines a data type for a value that identifies an item independent of its position in a data browser.
typedef UInt32 DataBrowserItemID;
HIDataBrowser.h
Defines a data type for a value that specifies the behavior and look of a data browser.
typedef unsigned long DataBrowserPropertyFlags;
These constants in the following sections are DataBrowserPropertyFlags
data types:
“Property Flags: Universal.” Bits 0–7 modify the appearance or behavior of display properties.
“Property Flags: Modifiers.” Bits 8–15 specify how the data associated with a display type is displayed.
“Property Flags: Offset and Mask for List View Properties.” Specify an offset and mask for bits 16–23.
“Property Flags: List View Column Behavior.” Bits 16–23 specify behaviors for columns in list view.
“Property Flags: Offset and Mask for Client-Defined Properties.” Specify an offset and mask for bits 24–31.
HIDataBrowser.h
Defines a data type for a value that identifies a column independent of its position in a data browser.
typedef UInt32 DataBrowserPropertyID;
Typically, this is a four-character sequence that you assign to represent a column in list view. For example, a column that displays song titles could be assigned a property ID of SONG
and you’d assign it to a constant in your application using code similar to the following:
kSongColumn = SONG;
Then, each time call a function that requires a parameter of type DataBrowserPropertyID
, supply the appropriate application-defined constant.
HIDataBrowser.h
Defines a data type for a value that specifies a row position in a table view.
typedef UInt32 DataBrowserTableViewRowIndex;
Row indices are zero based.
HIDataBrowser.h
Defines a data type for a value that specifies column position in a table view.
typedef UInt32 DataBrowserTableViewColumnIndex;
This data type is typically used for table-view formatting. Column indices are zero based.
HIDataBrowser.h
Defines a data type for a value that identifies a column independent of its position in a data browser.
typedef DataBrowserPropertyID DataBrowserTableViewColumnID;
For details on using this data type, see DataBrowserPropertyID
.
HIDataBrowser.h
Defines a data type for a table view column description.
typedef DataBrowserPropertyDesc DataBrowserTableViewColumnDesc;
See the DataBrowserPropertyDesc
data structure for more information.
HIDataBrowser.h
Describes the appearance of a column title in list view.
struct DataBrowserListViewHeaderDesc { UInt32 version; UInt16 minimumWidth; UInt16 maximumWidth; SInt16 titleOffset; CFStringRef titleString; DataBrowserSortOrder initialOrder; ControlFontStyleRec btnFontStyle; ControlButtonContentInfo btnContentInfo; }; typedef struct DataBrowserListViewHeaderDesc DataBrowserListViewHeaderDesc;
version
The format of the structure. Set this field to the value kDataBrowserListViewLatestHeaderDesc
.
minimumWidth
For resizable columns, the smallest width to which the column can be resized. If the column is not resizable, set this to the same value as the maximumWidth
field.
maximumWidth
For resizable columns, the largest width to which the column can be resized. If the column is not resizable, set this to the same value as the minimumWidth
field.
titleOffset
An offset, in pixels, from the left side of the column that specifies where the title text will be drawn. The title alignment (set in the just
field of the btnFontStyle
parameter) and the titleOffset
values dictate the alignment and offset (inset by default) of the content of the column when displaying one of he predefined display types. Typically the title offset is set to 0
.
titleString
The text to use for the column title. Set the string to NULL
if you do not want to display a title.
initialOrder
The initial sorting order to use for the column when the column is the current sort column. After the data browser is visible, the user can change the sorting order. You can assign one of the following values:
kDataBrowserOrderIncreasing
means this column sorts in ascending order.
kDataBrowserOrderDecreasing
means this column sorts in descending order.
btnFontStyle
A structure that describes the contents of the column heading and how to draw them. This allows you to customize the font that the column title is drawn with, which is independent of the font used to draw the data in the column.
btnContentInfo
A structure that defines the icon, if any, to use for the column heading.
HIDataBrowser.h
Contains property information for a list view column and specifies display information for the column title.
struct DataBrowserListViewColumnDesc { DataBrowserTableViewColumnDesc propertyDesc; DataBrowserListViewHeaderDesc headerBtnDesc; }; typedef struct DataBrowserListViewColumnDesc DataBrowserListViewColumnDesc;
propertyDesc
A structure that contains property and display information for a column. See DataBrowserTableViewColumnDesc
for more information.
headerBtnDesc
A structure that contains display information for the column title. See DataBrowserListViewHeaderDesc
for more information.
HIDataBrowser.h
Defines the HIObject class ID for the HIDataBrowser class.
#define kHIDataBrowserClassID CFSTR("com.apple.HIDataBrowser");
Specifies the version of the latest standard callback data structure.
enum { kDataBrowserLatestCallbacks = 0 };
kDataBrowserLatestCallbacks
A convenience constant used in the DataBrowserCallbacks
data structure to specify the version of the structure.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
Define data-browser-specific tags for use with the Control Manager functions GetControlData
and SetControlData
.
enum { kControlDataBrowserIncludesFrameAndFocusTag = 'brdr', kControlDataBrowserKeyFilterTag = kControlEditTextKeyFilterTag, kControlDataBrowserEditTextKeyFilterTag = kControlDataBrowserKeyFilterTag, kControlDataBrowserEditTextValidationProcTag = kControlEditTextValidationProcTag };
kControlDataBrowserIncludesFrameAndFocusTag
Include the frame and user focus. The associated data is of type Boolean
.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kControlDataBrowserKeyFilterTag
Use a filter. The associated data is a universal procedure pointer to a ControlKeyFilterProcPtr
callback. This callback is invoked when the user edits an item.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kControlDataBrowserEditTextKeyFilterTag
Use a text filter. This is a duplicate of kControlDataBrowserKeyFilterTag
.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kControlDataBrowserEditTextValidationProcTag
Use a callback to validate the text. The associated data is a universal procedure pointer to a ControlEditTextValidataionProcPtr
callback. This callback is invoked when the user finishes editing an item.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
You can use these options with the Control Manger functions GetControlData
and SetControlData
.
Specifies the version of the latest custom callback data structure.
enum { kDataBrowserLatestCustomCallbacks = 0 };
kDataBrowserLatestCustomCallbacks
A convenience constant used in the DataBrowserCustomCallbacks
data structure to specify the version of the structure.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
Specifies data browser attribute constants.
enum { kDataBrowserAttributeNone = 0, kDataBrowserAttributeColumnViewResizeWindow = (1 << 0), kDataBrowserAttributeListViewAlternatingRowColors = (1 << 1) kDataBrowserAttributeListViewDrawColumnDividers = (1 << 2) };
kDataBrowserAttributeNone
The data browser has no attributes.
Available in Mac OS X v10.4 and later.
Declared in HIDataBrowser.h
.
kDataBrowserAttributeColumnViewResizeWindow
In column view, this data browser is allowed to resize the owning window whenever necessary. This includes, but is not necessarily limited to, situations where column resize operations need more visible space in the window. If you turn this attribute on, your window must tolerate being resized behind your application’s back. If your window needs to react to bounds changes, use a kEventWindowBoundsChanged
event handler. If you need to constrain your window’s minimum and maximum bounds, use the kEventWindowGetMinimumSize
and kEventWindowGetMaximumSize
handlers, the SetWindowResizeLimits
function, or something similar.
Available in Mac OS X v10.4 and later.
Declared in HIDataBrowser.h
.
kDataBrowserAttributeListViewAlternatingRowColors
In list view, this data browser should draw alternating row background colors. However, note that this attribute does not work with variable row heights as of Mac OS X v10.4.
Available in Mac OS X v10.4 and later.
Declared in HIDataBrowser.h
.
kDataBrowserAttributeListViewDrawColumnDividers
In list view, this data browser should draw a vertical line between the columns.
Available in Mac OS X v10.4 and later.
Declared in HIDataBrowser.h
.
Use these constants in conjunction with DataBrowserGetAttributes
and DataBrowserChangeAttributes
.
Specifies the control type is a data browser.
enum { kControlKindDataBrowser = 'datb' };
kControlKindDataBrowser
The data browser control type.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
When you call the function GetControlKind
with a control reference that represents a data browser, you obtain the data browser tag kControlKindDataBrowser
as the control type.
Specifies constants used by DataBrowserSetMetric
.
enum { kDataBrowserMetricCellContentInset = 1, kDataBrowserMetricIconAndTextGap = 2, kDataBrowserMetricDisclosureColumnEdgeInset = 3, kDataBrowserMetricDisclosureTriangleAndContentGap = 4, kDataBrowserMetricDisclosureColumnPerDepthGap = 5, kDataBrowserMetricLast = kDataBrowserMetricDisclosureColumnPerDepthGap }; typedef UInt32 DataBrowserMetric;
kDataBrowserMetricCellContentInset
The content (icon, text, etc.) within a cell is drawn a certain amount in from the left and right edges of the cell. This metric governs the amount of inset.
Available in Mac OS X v10.4 and later.
Declared in HIDataBrowser.h
.
kDataBrowserMetricIconAndTextGap
This metric controls the space between the icon and text within a column of type kDataBrowserIconAndTextType
.
Available in Mac OS X v10.4 and later.
Declared in HIDataBrowser.h
.
kDataBrowserMetricDisclosureColumnEdgeInset
In list view only, this metric is used instead of (not in addition to) DataBrowserMetricCellContentInset
for the side of the cell in the disclosure column that displays the disclosure triangle.
Available in Mac OS X v10.4 and later.
Declared in HIDataBrowser.h
.
kDataBrowserMetricDisclosureTriangleAndContentGap
In list view only, this metric controls the amount of space between the disclosure triangle and the cell’s content.
Available in Mac OS X v10.4 and later.
Declared in HIDataBrowser.h
.
kDataBrowserMetricDisclosureColumnPerDepthGap
In list view only, this metric controls the amount of space in the disclosure column for each level of indentation in progressively deeper hierarchies of disclosed items.
Available in Mac OS X v10.4 and later.
Declared in HIDataBrowser.h
.
kDataBrowserMetricLast
Same as kDataBrowserMetricDisclosureColumnPerDepthGap
.
Available in Mac OS X v10.4 and later.
Declared in HIDataBrowser.h
.
Specify a data type or control to display in a column.
typedef OSType DataBrowserPropertyType; enum { kDataBrowserCustomType = 0x3F3F3F3F, kDataBrowserIconType = 'icnr', kDataBrowserTextType = 'text', kDataBrowserDateTimeType = 'date', kDataBrowserSliderType = 'sldr', kDataBrowserCheckboxType = 'chbx', kDataBrowserProgressBarType = 'prog', kDataBrowserRelevanceRankType = 'rank', kDataBrowserPopupMenuType = 'menu', kDataBrowserIconAndTextType = 'ticn' };
kDataBrowserCustomType
Displays custom data defined by your application. You must install callbacks to handle items of this type. Use custom types with caution. In some cases custom types do not display properly or exhibit the appropriate behavior.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserIconType
Displays icons. The associated data for the icon can be of type IconRef
, IconTransformType
, and RGBColor
.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserTextType
Displays text. The associated data is a CFString object.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserDateTimeType
Displays date and time information. The associated data can be of type DateTime
or LongDateTime
.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserSliderType
Displays slider controls. The associated data are values that define the minimum and maximum values and the current value for the slider. Avoid using slider controls in a data browser because, in some cases, they do not display properly onscreen.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserCheckboxType
Displays checkbox controls. The associated data is the current value of the checkbox and a ThemeButtonValue
value. Avoid using checkbox controls in a data browser because, in some cases, they do not display properly onscreen.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserProgressBarType
Displays progress bar controls. The associated data are values that define the minimum and maximum values and the current setting for the progress bar.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserRelevanceRankType
Displays relevance indicators. The associated data are values that define the minimum and maximum values and the current setting for the relevance indicator. Avoid using relevance indicators in a data browser because, in some cases, they do not display properly onscreen.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserPopupMenuType
Displays pop-up menus. The associated data is a MenuRef
data type, a menu item ID, and the value of the pop-up menu, which indicates the item of the menu to draw in the pop-up menu. Avoid using pop-up menu controls in a data browser because, in some cases, they do not display properly onscreen.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserIconAndTextType
Displays icon and text data. The associated data can be of any data type used for icons or text, such as an IconRef
data type and a CFString object.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
You can use these constants to define what is displayed in a column. Each constant defines a presentation style and implies a specific set of primitive types or data structures.
Specifies editing actions to apply to a data browser item.
typedef UInt32 DataBrowserEditCommand; enum { kDataBrowserEditMsgUndo = kHICommandUndo, kDataBrowserEditMsgRedo = kHICommandRedo, kDataBrowserEditMsgCut = kHICommandCut, kDataBrowserEditMsgCopy = kHICommandCopy, kDataBrowserEditMsgPaste = kHICommandPaste, kDataBrowserEditMsgClear = kHICommandClear, kDataBrowserEditMsgSelectAll = kHICommandSelectAll };
kDataBrowserEditMsgUndo
Undo the last editing operation.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserEditMsgRedo
Redo the last editing operation that was undone.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserEditMsgCut
Cut the contents of the selection to the Clipboard.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserEditMsgCopy
Copy the contents of the selection o the Clipboard.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserEditMsgPaste
Replace the contents of the selection with the contents of the Clipboard.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserEditMsgClear
Remove the contents of the selection.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserEditMsgSelectAll
Select all of the text inside of the current edit session.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
These options are for use with the functions EnableDataBrowserEditCommand
and ExecuteDataBrowserEditCommand
.
Specify notifications provided by the data browser to your application.
typedef UInt32 DataBrowserItemNotification; enum { kDataBrowserItemAdded = 1, kDataBrowserItemRemoved = 2, kDataBrowserEditStarted = 3, kDataBrowserEditStopped = 4, kDataBrowserItemSelected = 5, kDataBrowserItemDeselected = 6, kDataBrowserItemDoubleClicked = 7, kDataBrowserContainerOpened = 8, kDataBrowserContainerClosing = 9, kDataBrowserContainerClosed = 10, kDataBrowserContainerSorting = 11, kDataBrowserContainerSorted = 12, kDataBrowserUserStateChanged = 13, kDataBrowserSelectionSetChanged = 14, kDataBrowserTargetChanged = 15, kDataBrowserUserToggledContainer = 16 };
kDataBrowserItemAdded
The specified item has been added to a container in the data browser.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserItemRemoved
The specified item has been removed from a container in the data browser.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserEditStarted
An text editing session has started for the specified item.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserEditStopped
An text editing session has stopped for the specified item.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserItemSelected
An item has been added to the selection set.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserItemDeselected
An item has been removed from the selection set.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserItemDoubleClicked
The user double-clicked an item.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserContainerOpened
A container has been opened.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserContainerClosing
A container is about to close. This notification is sent at the start of the close operation. The container still contains its child items and it is still valid to pass them to data browser functions. The data browser handles closing automatically, so typically applications do not look for this notification. You’d use this only if you are interested in fetching information on the items before the close actually happens.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserContainerClosed
A container has been closed. This notification is sent after the close operation, so it is no longer valid to pass child items to data browser functions.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserContainerSorting
A container is about to be sorted.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserContainerSorted
A container has been sorted.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserUserStateChanged
The user has reformatted the view for the target. For example, the user changed a sorting order or a column width.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserSelectionSetChanged
The selection set has been modified.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserTargetChanged
The target has changed to the specified item.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserUserToggledContainer
The user has toggled opened or closed a container by clicking a disclosure triangle.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
These notifications are used with the callbacks DataBrowserItemNotificationProcPtr
and DataBrowserItemNotificationWithItemProcPtr
. Notifications sent for containers are the same regardless of whether the container opens to an expandable row or to individual rows for each item in the container.
Indicate the current state of an item in the data browser.
typedef UInt32 DataBrowserItemState; enum { kDataBrowserItemNoState = 0, kDataBrowserItemAnyState = (unsigned long) (-1), kDataBrowserItemIsSelected = 1 << 0, kDataBrowserContainerIsOpen = 1 << 1, kDataBrowserItemIsDragTarget = 1 << 2 };
kDataBrowserItemNoState
The state is undefined.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserItemAnyState
Any state is acceptable.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserItemIsSelected
The item is selected.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserContainerIsOpen
The item container is open. This state applies to:
A parent item in a hierarchical list in list view
An item in column view if the item’s contents are displayed in the next column
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserItemIsDragTarget
The item is a drag target.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
Defines the version of the list view header description data structure.
enum { kDataBrowserListViewLatestHeaderDesc = 0 };
kDataBrowserListViewLatestHeaderDesc
A convenience constant that specifies the version of the list view header description data structure.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
Defines the last column as the column to use for an append operation.
enum { kDataBrowserListViewAppendColumn = kDataBrowserTableViewLastColumn };
kDataBrowserListViewAppendColumn
The column to use for an append operation.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
Specifies that there is no item to provide or obtain.
enum { kDataBrowserNoItem = 0L };
kDataBrowserNoItem
A convenience constant used when there is no item to provide or obtain. This value is of type DataBrowserItemID
.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
Specify attributes for items, containers, and columns.
enum { kDataBrowserItemNoProperty = 0L, kDataBrowserItemIsActiveProperty = 1L, kDataBrowserItemIsSelectableProperty = 2L, kDataBrowserItemIsEditableProperty = 3L, kDataBrowserItemIsContainerProperty = 4L, kDataBrowserContainerIsOpenableProperty = 5L, kDataBrowserContainerIsClosableProperty = 6L, kDataBrowserContainerIsSortableProperty = 7L, kDataBrowserItemSelfIdentityProperty = 8L, kDataBrowserContainerAliasIDProperty = 9L, kDataBrowserColumnViewPreviewProperty = 10L, kDataBrowserItemParentContainerProperty = 11L };
kDataBrowserItemNoProperty
No property; no associated data.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserItemIsActiveProperty
The active state of the item. The associated data is of type Boolean
. The default value true
indicates the item is active.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserItemIsSelectableProperty
The selection capability of the item. The associated data is of type Boolean
. The default value true
indicates the item can be selected.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserItemIsEditableProperty
The editing capability of the item. The associated data is of type Boolean
. The default value false
indicates the item cannot be edited.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserItemIsContainerProperty
The container attribute for an item. The associated data is of type Boolean
. The default value false
indicates the item cannot contain other items.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserContainerIsOpenableProperty
The opening capability of a container item. The associated data is of type Boolean
. The default value true
indicates the container can be opened.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserContainerIsClosableProperty
The closing capability of a container item. The associated data is of type Boolean
. The default value true
indicates the container can be closed.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserContainerIsSortableProperty
The sorting capability of container item. The associated data is of type Boolean
. The default value true
indicates the items in the container can be sorted.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserItemSelfIdentityProperty
This property is used only in column view for the item-data and item-compare callbacks. You should not use this property for anything else. It is passed to your item-data callback when the data browser needs to know the data to draw to represent the item. It is your responsibility to provide the data to display for that item in whatever format would be appropriate for the column view display type, which is kDataBrowserIconAndTextType
.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserContainerAliasIDProperty
An alias or symbolic link from an item to a container item. The associated data is of type DataBrowserItemID
. This property is sent to your item-data callback to provide your application with a chance to follow an alias that the item might represent. If the incoming item is an alias to another item, you can call the function SetDataBrowserItemDataItemID
to inform the data browser which other item the incoming item points to.
This property is sent only from column view. Your support for it is optional. Your response allows the data browser to be a bit more memory efficient with its internal storage. If a given item is an alias to an item whose contents are already displayed in one column of the column view, the contents can be shared between those two columns.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserColumnViewPreviewProperty
The column displays a preview. There is no associated data. Available only in column view. This property is sent to your draw-item callback to indicate the need for you to draw a preview of the given item. It can be sent to other callbacks to provide an opportunity for your application to draw or track in the preview column.
You can also pass this in the propertyID
parameter of the function RevealDataBrowserItem
(along with the appropriate item ID of the item whose preview is displayed) to make sure the preview column is visible to the user.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserItemParentContainerProperty
Designates the parent of the specified item. The associated data is of type DataBrowserItemID
. This is sent to your item-data callback when the data browser needs to know the parent container item for a given item.
In column view, this allows the function SetDataBrowserTarget
to process the data properly. The target is the leaf node item whose contents you want to display, which is the rightmost column in column view. However, unlike
SetDataBrowserColumnViewPath
, the function SetDataBrowserTarget
doesn’t offer a way for you to communicate the item IDs of the rest of the column containers, so
SetDataBrowserTarget
asks for them explicitly by requesting the item’s parent, then the parent of the item’s parent, and so on. (Your item-data callback might be called with the parent container property at times other than an explicit call to
SetDataBrowserTarget
, so your item-data callback should support this property.)
In list view, this property allows you to pass a non-container to SetDataBrowserTarget
. In this case, the data browser requests the parent of the target so it knows which container to display the contents of in the list view. (Again, your item-data callback might be called with the parent container property at times other than an explicit call to SetDataBrowserTarget
, so your item-data callback should be sure to support this property.)
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
You can use these constants along with the appropriate value to manage the attributes of items in a data browser. Typically your item-data callback responds to inquires about these properties by calling the appropriate accessor function from within the callback. See DataBrowserItemDataProcPtr
for more information on the item-data callback. “Getting and Setting Item Data” describes the accessor functions.
Modify the appearance or behavior of display properties.
enum { kDataBrowserUniversalPropertyFlagsMask = 0xFF, kDataBrowserPropertyIsMutable = 1 << 0, kDataBrowserDefaultPropertyFlags = 0 << 0, kDataBrowserUniversalPropertyFlags = kDataBrowserUniversalPropertyFlagsMask, kDataBrowserPropertyIsEditable = kDataBrowserPropertyIsMutable };
kDataBrowserUniversalPropertyFlagsMask
Test for universal property flags. This constant is used by the data browser; your application doesn’t need to use it.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserPropertyIsMutable
The property is mutable. You can assign this flag to the propertyFlags
field of the DataBrowserPropertyDesc
structure. You must set this flag is you want to allow editing of the text part of the property.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserDefaultPropertyFlags
The default properties. You can assign this flag to the propertyFlags
field of the DataBrowserPropertyDesc
structure if all you need is the default behavior. The default is for all flags to be off.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserUniversalPropertyFlags
Universal property flags. This constant is used by the data browser; your application doesn’t need to use it.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserPropertyIsEditable
The data can be edited. You must set this flag if you want to allow editing of the text part of the property. This flag can be set if the values displayed in the column can be changed. If your application specifies this flag, then it must also provide a callback that allows the data browser to retrieve and store data values displayed in this column. You can assign this flag to the propertyFlags
field of the DataBrowserPropertyDesc
structure.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
These constants reside in bits 0–7 of the DataBrowserPropertyFlags
data type.
Specify how to display the data associated with a display type.
enum { kDataBrowserPropertyFlagsOffset = 8, kDataBrowserPropertyFlagsMask = 0xFF << kDataBrowserPropertyFlagsOffset, kDataBrowserCheckboxTriState = 1 << kDataBrowserPropertyFlagsOffset, kDataBrowserDateTimeRelative = 1 << (kDataBrowserPropertyFlagsOffset), kDataBrowserDateTimeDateOnly = 1 << (kDataBrowserPropertyFlagsOffset + 1), kDataBrowserDateTimeTimeOnly = 1 << (kDataBrowserPropertyFlagsOffset + 2), kDataBrowserDateTimeSecondsToo = 1 << (kDataBrowserPropertyFlagsOffset + 3), kDataBrowserSliderPlainThumb = kThemeThumbPlain << kDataBrowserPropertyFlagsOffset, kDataBrowserSliderUpwardThumb = kThemeThumbUpward << kDataBrowserPropertyFlagsOffset, kDataBrowserSliderDownwardThumb = kThemeThumbDownward << kDataBrowserPropertyFlagsOffset, kDataBrowserDoNotTruncateText = 3 << kDataBrowserPropertyFlagsOffset, kDataBrowserTruncateTextAtEnd = 2 << kDataBrowserPropertyFlagsOffset, kDataBrowserTruncateTextMiddle = 0 << kDataBrowserPropertyFlagsOffset, kDataBrowserTruncateTextAtStart = 1 << kDataBrowserPropertyFlagsOffset, kDataBrowserPopupMenuButtonless = 1 << kDataBrowserPropertyFlagsOffset, kDataBrowserPropertyModificationFlags = kDataBrowserPropertyFlagsMask, kDataBrowserRelativeDateTime = kDataBrowserDateTimeRelative };
kDataBrowserPropertyFlagsOffset
The offset value for this set of property flags.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserPropertyFlagsMask
Use to set or test for property modifier flags.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserCheckboxTriState
Modifies the kDataBrowserCheckboxType
display type to display a checkbox that can have on, off, and mixed-mode states instead of just on and off states.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserDateTimeRelative
Modifies the kDataBrowserDateTimeType
display type to display relative date and time.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserDateTimeDateOnly
Modifies the kDataBrowserDateTimeType
display type to display only the date.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserDateTimeTimeOnly
Modifies the kDataBrowserDateTimeType
display type to display only the time.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserDateTimeSecondsToo
Modifies the kDataBrowserDateTimeType
display type to display the time with seconds.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserSliderPlainThumb
Modifies the kDataBrowserSliderType
display type to display a round thumb.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserSliderUpwardThumb
Modifies the kDataBrowserSliderType
display type to display a directional thumb that points up.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserSliderDownwardThumb
Modifies the kDataBrowserSliderType
display type to display a directional thumb that points down.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserDoNotTruncateText
Modifies the kDataBrowserTextType
and the kDataBrowserIconAndTextType
display types so they do not truncate text.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserTruncateTextAtEnd
Modifies the kDataBrowserTextType
and the kDataBrowserIconAndTextType
display types so they truncate text, if needed, at the end of the text string.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserTruncateTextMiddle
Modifies the kDataBrowserTextType
and the kDataBrowserIconAndTextType
display types so they truncate text, if needed, in the middle of the text string.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserTruncateTextAtStart
Modifies the kDataBrowserTextType
and the kDataBrowserIconAndTextType
display type so they truncate text, if needed, at the beginning of the text string.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserPopupMenuButtonless
This flag is only for use with columns of type kDataBrowserPopupMenuType
and indicates that the popup is to be drawn in a sleek buttonless fashion. The text is drawn next to a popup glyph, and the whole cell is clickable.
Available on Mac OS X v10.4 and later.
Declared in HIDataBrowser.h
.
kDataBrowserPropertyModificationFlags
Old name. Instead use kDataBrowserPropertyFlagsMask
.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserRelativeDateTime
Old name. Instead use kDataBrowserDateTimeRelative
.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
These constants reside in bits 8–15 of the DataBrowserPropertyFlags
data type.
Specify an offset and mask for bits 16–23 of the DataBrowserPropertyFlag
data type.
enum { kDataBrowserViewSpecificFlagsOffset = 16, kDataBrowserViewSpecificFlagsMask = 0xFF << kDataBrowserViewSpecificFlagsOffset, kDataBrowserViewSpecificPropertyFlags = kDataBrowserViewSpecificFlagsMask };
kDataBrowserViewSpecificFlagsOffset
The offset value for this set of property flags.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserViewSpecificFlagsMask
Use to set or test for view-specific property flags.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserViewSpecificPropertyFlags
Old name. Instead use kDataBrowserViewSpecificFlagsMask
.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
See also “Property Flags: List View Column Behavior.”
Specify behaviors for columns in list view.
typedef DataBrowserPropertyFlags DataBrowserListViewPropertyFlags; enum { kDataBrowserListViewSelectionColumn = kDataBrowserTableViewSelectionColumn, kDataBrowserListViewMovableColumn = 1 << (kDataBrowserViewSpecificFlagsOffset + 1), kDataBrowserListViewSortableColumn = 1 << (kDataBrowserViewSpecificFlagsOffset + 2), kDataBrowserListViewTypeSelectColumn = 1 << (kDataBrowserViewSpecificFlagsOffset + 3), kDataBrowserListViewNoGapForIconInHeaderButton = 1 << (kDataBrowserViewSpecificFlagsOffset + 4), kDataBrowserListViewDefaultColumnFlags = kDataBrowserListViewMovableColumn + kDataBrowserListViewSortableColumn };
kDataBrowserListViewSelectionColumn
If you are using a minimally highlighted list, this indicates to draw the contents of this column as highlighted when the item is selected. (Minimal highlighting is the highlighting used by the Finder for list view prior to Mac OS X version 10.3.)
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserListViewMovableColumn
The column is movable.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserListViewSortableColumn
The column can be sorted.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserListViewTypeSelectColumn
The column is capable of being selected and having text entered. If one or more of your list view columns are marked as type-selectable, the data browser handles type-selection for you automatically. You can use this flag with columns whose display type is kDataBrowserTextType
, kDataBrowserIconAndTextType
, or kDataBrowserDateTimeType
. If you set this flag for a column of another type, the type-select behavior is undefined. Turning on this flag causes the data browser to obtain keyboard input using a Carbon event handler instead of relying on calls to the function HandleControlKey
.
Declared in HIDataBrowser.h
.
Available in Mac OS X 10.3 and later.
kDataBrowserListViewNoGapForIconInHeaderButton
Normally the text in a header button for a column of type kDataBrowserIconAndTextType
is aligned as though it has an icon next to it even if no icon is specified for the header button. This flag indicates that space should not be reserved for an icon if no icon is provided for the header button. This flag allows a client to justify the left edge of the text in a header button to the left edge of the icon in the cells beneath it.
Declared in HIDataBrowser.h
.
Available in Mac OS X v10.4 and later.
kDataBrowserListViewDefaultColumnFlags
The default properties. You can assign this flag to the propertyFlags
field of the DataBrowserPropertyDesc
structure if all you need is the default behavior for list view.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
These constants reside in bits 16–23 of the DataBrowserPropertyFlags
data type and are specific to a list view.
Specify an offset and mask for the high 8 bits of the DataBrowserPropertyFlag
data type.
enum { kDataBrowserClientPropertyFlagsOffset = 24, kDataBrowserClientPropertyFlagsMask = (unsigned long) (0xFF << kDataBrowserClientPropertyFlagsOffset) };
kDataBrowserClientPropertyFlagsOffset
The offset value for this set of property flags.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserClientPropertyFlagsMask
The mask value for this set of property flags.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
Bits 24–31 of the DataBrowserPropertyFlags
data type are reserved for use by your application. You can set and query them for your own purposes.
Specify the visual components of a data type or control displayed in a column.
typedef OSType DataBrowserPropertyPart; enum { kDataBrowserPropertyEnclosingPart = 0, kDataBrowserPropertyContentPart = '----', kDataBrowserPropertyDisclosurePart = 'disc', kDataBrowserPropertyTextPart = kDataBrowserTextType, kDataBrowserPropertyIconPart = kDataBrowserIconType, kDataBrowserPropertySliderPart = kDataBrowserSliderType, kDataBrowserPropertyCheckboxPart = kDataBrowserCheckboxType, kDataBrowserPropertyProgressBarPart = kDataBrowserProgressBarType, kDataBrowserPropertyRelevanceRankPart = kDataBrowserRelevanceRankType };
kDataBrowserPropertyEnclosingPart
The outer boundary of an item.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserPropertyContentPart
The content of an item.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserPropertyDisclosurePart
The location of a disclosure rectangle.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserPropertyTextPart
The location where text is drawn.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserPropertyIconPart
The location where an icon is displayed.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserPropertySliderPart
The location of a slider.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserPropertyCheckboxPart
The location of a checkbox.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserPropertyProgressBarPart
The location of a progress bar.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserPropertyRelevanceRankPart
The location of a relevance indicator.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
You can pass these constants as a parameter to the function GetDataBrowserItemPartBounds
to obtain a rectangle that contains the bounds for the specified part.
Specify how to position an item in a data browser.
typedef UInt8 DataBrowserRevealOptions; enum { kDataBrowserRevealOnly = 0, kDataBrowserRevealAndCenterInView = 1 << 0, kDataBrowserRevealWithoutSelecting = 1 << 1 };
kDataBrowserRevealOnly
Move the content of the data browser as little as possible to make the item visible, and show the item in a selected state.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserRevealAndCenterInView
Reveal the item so that, if possible, the item is centered in the data browser.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserRevealWithoutSelecting
Reveal the item but do not select it.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
You can pass reveal options as a parameter to the function RevealDataBrowserItem
. You can pass more than one at a time for combined functionality.
Specify an anchor direction to apply when the user drags a data selection.
typedef UInt32 DataBrowserSelectionAnchorDirection; enum { kDataBrowserSelectionAnchorUp = 0, kDataBrowserSelectionAnchorDown = 1, kDataBrowserSelectionAnchorLeft = 2, kDataBrowserSelectionAnchorRight = 3 };
kDataBrowserSelectionAnchorUp
Apply the anchor direction at the top of the selection set.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserSelectionAnchorDown
Apply the anchor direction at the bottom of the selection set.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserSelectionAnchorLeft
Apply the anchor direction at the left of the selection set.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserSelectionAnchorRight
Apply the anchor direction at the right of the selection set.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
These options are for use with the function MoveDataBrowserSelectionAnchor
.
Specify how the selection state should be affected by a given list of items.
typedef UInt32 DataBrowserSetOption; enum { kDataBrowserItemsAdd = 0, kDataBrowserItemsAssign = 1, kDataBrowserItemsToggle = 2, kDataBrowserItemsRemove = 3 };
kDataBrowserItemsAdd
Add specified items to the existing set or selection.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserItemsAssign
Assign the destination set to the specified item and redraw the list appropriately.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserItemsToggle
Toggle the membership state of the specified items. Any of the items in the current selection are removed from the selection, and those items that are not in the selection are added to the selection.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserItemsRemove
Remove specified items from the existing set and redraw the items so they are not highlighted.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
These options are for use with the function SetDataBrowserSelectedItems
.
Specify the order in which to sort data.
typedef UInt16 DataBrowserSortOrder; enum { kDataBrowserOrderUndefined = 0, kDataBrowserOrderIncreasing = 1, kDataBrowserOrderDecreasing = 2 };
kDataBrowserOrderUndefined
This constant has no meaning in the context of your application; don’t use it.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserOrderIncreasing
Sort in increasing order.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserOrderDecreasing
Sort in decreasing order.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
Specify a highlighting style to use in list view.
typedef UInt32 DataBrowserTableViewHiliteStyle; enum { kDataBrowserTableViewMinimalHilite = 0, kDataBrowserTableViewFillHilite = 1 };
kDataBrowserTableViewMinimalHilite
Use minimal highlighting. This is the highlighting used by the Finder for list view prior to Mac OS X v. 10.3. For this style, the highlight color for active items is kThemeBrushPrimaryHighlightColor
and for inactive items the color is kThemeBrushSecondaryHighlightColor
.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserTableViewFillHilite
Use full-row highlighting. This is the highlighting used by the Finder for list view in Mac OS X v. 10.3. For this style, the highlight color in Mac OS X v. 10.3 for active items is kThemeBrushAlternatePrimaryHighlightColor
and for inactive items the color is kThemeBrushSecondaryHighlightColor
. Prior to Mac OS X v. 10.3 the highlight color for active and inactive items is kThemeBrushPrimaryHighlightColor
.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
Specifies the last column position.
enum { kDataBrowserTableViewLastColumn = -1 };
kDataBrowserTableViewLastColumn
The last column position.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
Specifies a table view property.
typedef UInt32 DataBrowserTableViewPropertyFlags; enum { kDataBrowserTableViewSelectionColumn = 1 << kDataBrowserViewSpecificFlagsOffset };
kDataBrowserTableViewSelectionColumn
The column can be selected.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
Specify the outcome of tracking a drag operation.
typedef SInt16 DataBrowserTrackingResult; enum { kDataBrowserContentHit = 1, kDataBrowserNothingHit = 0, kDataBrowserStopTracking = -1 };
kDataBrowserContentHit
Indicates that a selectable portion of the item was hit. The data browser will select the item and do other relevant actions as appropriate.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserNothingHit
Indicates that a nonselectable portion—whitespace—was hit. The data browser won’t select the item, but it could, for example, start a selection rectangle.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserStopTracking
Indicates the callback handled the click completely. The data browser will not attempt to display a contextual menu, start a drag, process a double-click, or draw a selection rectangle. The callback is responsible for all facets of click handling if it returns this value.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
These constants are returned from the custom tracking callback, DataBrowserTrackingProcPtr
.
Specify allowable selection behavior.
typedef UInt32 DataBrowserSelectionFlags; enum { kDataBrowserDragSelect = 1 << 0, kDataBrowserSelectOnlyOne = 1 << 1, kDataBrowserResetSelection = 1 << 2, kDataBrowserCmdTogglesSelection = 1 << 3, kDataBrowserNoDisjointSelection = 1 << 4, kDataBrowserAlwaysExtendSelection = 1 << 5, kDataBrowserNeverEmptySelectionSet = 1 << 6 };
kDataBrowserDragSelect
Allows items to be selected by dragging. If the user to clicks the mouse to select a nondraggable item and drags the mouse, any item the pointer moves over is selected. This is on by default.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserSelectOnlyOne
Only one item can be selected at a time. If you use this flag in conjunction with the flag kDataBrowserDragSelect
, then as the user drags, previous items are deselected as each new item is dragged over.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserResetSelection
Clears all selected items before processing the next selection. This is off by default.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserCmdTogglesSelection
Enables use of a command to toggle items in and out of a selection. This is on by default.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserNoDisjointSelection
Prevents a discontinuous selection.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserAlwaysExtendSelection
Multiple items can be selected without holding down a modifier key.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserNeverEmptySelectionSet
There must always be at least one selected item; the user cannot deselect the last selected item.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
You can use one or more of these flags together.
Specify a style to use when displaying data in a data browser.
typedef OSType DataBrowserViewStyle; enum { kDataBrowserNoView = '????', kDataBrowserListView = 'lstv', kDataBrowserColumnView = 'clmv' };
kDataBrowserNoView
There is no view.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserListView
Display data in a list. Lists can be hierarchical.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
kDataBrowserColumnView
Display data in columns that can be browsed.
Available in Mac OS X v10.0 and later.
Declared in HIDataBrowser.h
.
The most common result codes returned by the data browser are listed here.
© 2003, 2008 Apple Inc. All Rights Reserved. (Last updated: 2008-04-08)