Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

Next Page > Hide TOC

WebDocumentRepresentation Protocol Reference

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

Overview

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.

Tasks

Setting the Data Source

Loading Content

Getting Document Source

Getting the Document Title

Instance Methods

canProvideDocumentSource

Returns whether the receiver can provide content source.

- (BOOL)canProvideDocumentSource

Discussion

This method returns YES if the receiver can provide source for the document content (for example, HTML source), NO otherwise.

Availability
See Also
Declared In
WebDocument.h

documentSource

Returns the receiver’s source as text.

- (NSString *)documentSource

Discussion

For example, for HTML documents, returns the HTML source.

Availability
See Also
Declared In
WebDocument.h

finishedLoadingWithDataSource:

Invoked when a data source finishes loading its content.

- (void)finishedLoadingWithDataSource:(WebDataSource *)dataSource

Availability
See Also
Declared In
WebDocument.h

receivedData:withDataSource:

Invoked when a data source has received some data.

- (void)receivedData:(NSData *)data withDataSource:(WebDataSource *)dataSource

Discussion

Data is loaded incrementally so this method may be invoked multiple times.

Availability
See Also
Declared In
WebDocument.h

receivedError:withDataSource:

Invoked when a data source receives an error loading its content.

- (void)receivedError:(NSError *)error withDataSource:(WebDataSource *)dataSource

Discussion

The error argument contains details on the error that occurred.

Availability
See Also
Declared In
WebDocument.h

setDataSource:

Sets the receiver’s data source.

- (void)setDataSource:(WebDataSource *)dataSource

Discussion

This method is invoked soon after the document representation is created.

Availability
See Also
Declared In
WebDocument.h

title

Returns the receiver’s document title.

- (NSString *)title

Availability
Declared In
WebDocument.h

Next Page > Hide TOC


Last updated: 2006-05-23




Did this document help you?
Yes: Tell us what works for you.

It’s good, but: Report typos, inaccuracies, and so forth.

It wasn’t helpful: Tell us what would have helped.
Get information on Apple products.
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Copyright © 2007 Apple Inc.
All rights reserved. | Terms of use | Privacy Notice