| Inherits from | |
| Conforms to | |
| Framework | /System/Library/Frameworks/WebKit.framework |
| Availability | Available in Mac OS X v10.2 with Safari 1.0 and later. Available in Mac OS X v10.2.7 and later. |
| Companion guide | |
| Declared in | WebBackForwardList.h |
A WebBackForwardList object maintains a list of visited pages used to go back and forward to the most recent page. A WebBackForwardList object maintains only the list data—it does not perform actual page loads (in other words, it does not make any client requests). If you need to perform a page load, see the loadRequest: method in WebFrame Class Reference to find out how to do this.
Items are typically inserted in a back-forward list in the order they are visited. A WebBackForwardList object also maintains the notion of the current item (which is always at index 0), the preceding item (which is at index -1), and the following item (which is at index 1). The goBack and goForward methods move the current item backward or forward by one. The goToItem: method sets the current item to the specified item. All other methods that return WebHistoryItem objects do not change the value of the current item, they just return the requested item or items. You can also limit the number of history items stored in the back-forward list using the setCapacity: method.
WebBackForwardList objects also control the number of pages cached. You can turn page caching off by setting the page cache size to 0 using the pageCacheSize method, or limit the number of pages cached by passing a value greater than 0.
– backItem
– backListCount
– backListWithLimit:
– containsItem:
– currentItem
– itemAtIndex:
– forwardItem
– forwardListCount
– forwardListWithLimit:
– pageCacheSize Deprecated in Mac OS X v10.4.11
– setPageCacheSize: Deprecated in Mac OS X v10.4.11
Inserts an item into the back-forward list, immediately after the current item.
- (void)addItem:(WebHistoryItem *)item
A web history item that represents a visited webpage. If item is nil, an NSInvalidArgumentException exception is raised.
Any items following item in the back-forward list are removed. This method also removes items if the capacity of the receiver is exceeded.
WebBackForwardList.hReturns the item that precedes the current item in the back-forward list.
- (WebHistoryItem *)backItem
The item that precedes the current item in the back-forward list, or nil if none precedes it.
WebBackForwardList.hReturns the number of items that precede the current item in the back-forward list.
- (int)backListCount
The number of items that precede the current item in the back-forward list.
WebBackForwardList.hReturns the items that precede the current item in the back-forward list, up to the specified number of items.
- (NSArray *)backListWithLimit:(int)limit
The greatest number of items to return.
An array containing (at most) the specified number of items, or nil if no items precede the current item.
WebBackForwardList.hReturns the maximum number of items that the back-forward list can contain.
- (int)capacity
The maximum number of items the back-forward list can contain.
WebBackForwardList.hReturns a Boolean value indicating whether the back-forward list contains the specified item.
- (BOOL)containsItem:(WebHistoryItem *)item
The item to find in the back-forward list.
YES if the specified item is in the back-forward list; otherwise, NO.
WebBackForwardList.hReturns the current item in the back-forward list.
- (WebHistoryItem *)currentItem
The current item, or nil if the back-forward list is empty.
WebBackForwardList.hReturns the item that follows the current item in the back-forward list.
- (WebHistoryItem *)forwardItem
The item that follows the current item, or nil if none follows it.
WebBackForwardList.hReturns the number of items that follow the current item in the back-forward list.
- (int)forwardListCount
The number of items that follow the current item.
WebBackForwardList.hReturns the items that follow the current item in the back-forward list, up to the specified number of items.
- (NSArray *)forwardListWithLimit:(int)limit
The greatest number of items to return.
An array containing (at most) the specified number of items, or nil if no items follow the current item.
WebBackForwardList.hMoves backward one item in the back-forward list.
- (void)goBack
This method works by changing the current item to the item that precedes it. This method raises an NSInternalInconsistencyException exception if no item precedes the current item.
WebBackForwardList.hMoves forward one item in the back-forward list.
- (void)goForward
This method works by changing the current item to the item that follows it. This method raises an NSInternalInconsistencyException exception if no item follows the current item.
WebBackForwardList.hMakes the specified item in the back-forward list the current item.
- (void)goToItem:(WebHistoryItem *)item
A web history item that represents a visited webpage. If item is not in the back-forward list, an NSInvalidArgumentException exception is raised.
WebBackForwardList.hReturns the item at the specified index in the back-forward list.
- (WebHistoryItem *)itemAtIndex:(int)index
The index of the item to return. The position of the current item is index 0, and the position of any other item is expressed as an offset from index 0. For example, the item preceding the current item is at index -1, and the item following the current item is at index 1.
The item at the specified index, or nil if index exceeds the bounds of the back-forward list (that is, if index is greater than the value returned by forwardListCount, or less than the negative form of the value returned by backListCount).
WebBackForwardList.hSets the maximum number of items that the back-forward list can contain.
- (void)setCapacity:(int)size
The maximum number of items that the list can contain.
WebBackForwardList.hLast updated: 2009-02-04