| 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 | WebDocument.h |
This protocol is adopted by document representation classes that handle specific MIME types. You can implement your own document view classes and document representation classes to render data for specific MIME types, and register those classes using the WebFrame registerViewClass:representationClass:forMIMEType: method.
– setDataSource: required method
– receivedData:withDataSource: required method
– receivedError:withDataSource: required method
– finishedLoadingWithDataSource: required method
– canProvideDocumentSource required method
– documentSource required method
– title required method
Returns whether the receiver can provide content source. (required)
- (BOOL)canProvideDocumentSource
YES if the receiver can provide source for the document content (for example, HTML source), NO otherwise.
The receiver should return YES only if it makes sense for someone to view the source of the document in question. For example, a web view returns NO if the content is an image, was produced by a plug-in, or contains text content already.
WebDocument.hReturns the receiver’s source as text. (required)
- (NSString *)documentSource
Returns the document source associated with the receiver or nil if the source cannot be provided.
For example, for HTML documents, the receiver should return the HTML source.
WebDocument.hInvoked when a data source finishes loading its content. (required)
- (void)finishedLoadingWithDataSource:(WebDataSource *)dataSource
A WebDataSource object that identifies the request that finished loading.
WebDocument.hInvoked when a data source has received some data. (required)
- (void)receivedData:(NSData *)data withDataSource:(WebDataSource *)dataSource
An NSData object containing the data received.
A WebDataSource object that identifies the request that generated this data.
Data is loaded incrementally, so this method may be invoked multiple times. The receiver is responsible for accumulating this data.
WebDocument.hInvoked when a data source receives an error loading its content. (required)
- (void)receivedError:(NSError *)error withDataSource:(WebDataSource *)dataSource
An NSError object that indicates what error occurred.
A WebDataSource object that identifies the request that caused this error.
The error argument contains details on the error that occurred.
WebDocument.hSets the receiver’s data source. (required)
- (void)setDataSource:(WebDataSource *)dataSource
The data source to associate with the object.
This method is invoked soon after the document representation is created.
WebDocument.hReturns the receiver’s document title. (required)
- (NSString *)title
The title associated with the receiving document object.
WebDocument.h
Last updated: 2009-08-19