Mac OS X Reference Library Apple Developer Connection spyglass button

WebDocumentView 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 the document view of a WebFrameView. You can extend WebKit to support additional MIME types by implementing your own document view and document representation classes to render data for specific MIME types. You register those classes using the WebFrame registerViewClass:representationClass:forMIMEType: method. Classes that adopt this protocol are expected to be subclasses of NSView.

Tasks

Setting the Data Source

Controlling the Layout

Attaching to a Window

Instance Methods

dataSourceUpdated:

Invoked when additional data has been received. (required)

- (void)dataSourceUpdated:(WebDataSource *)dataSource

Parameters
dataSource

The source of the new data.

Availability
  • Available in Mac OS X v10.2 with Safari 1.0 and later.
  • Available in Mac OS X v10.2.7 and later.
See Also
Declared In
WebDocument.h

layout

Invoked when the receiver should change its layout immediately. (required)

- (void)layout

Discussion

This message is sent to the view as a hint to perform any calculations and update rendering information. For example, at a minimum, the receiver might set the frame rectangle. This method should not perform any drawing operations.

Availability
  • Available in Mac OS X v10.2 with Safari 1.0 and later.
  • Available in Mac OS X v10.2.7 and later.
See Also
Declared In
WebDocument.h

setDataSource:

Invoked when the data source for this document has been changed. (required)

- (void)setDataSource:(WebDataSource *)dataSource

Parameters
dataSource

The new data source for the document.

Availability
  • Available in Mac OS X v10.2 with Safari 1.0 and later.
  • Available in Mac OS X v10.2.7 and later.
See Also
Declared In
WebDocument.h

setNeedsLayout:

Sets whether or not the receiver should change its layout. (required)

- (void)setNeedsLayout:(BOOL)flag

Parameters
flag

Sets whether the receiver needs to update its layout in the next call to its drawRect: method.

Discussion

A view conforming to this protocol should store the most recent value of this flag in an internal variable. Then, in its drawRect method, if the most recent value of this flag was YES, it should invoke layout and reset the internal variable before updating the contents of the view.

Availability
  • Available in Mac OS X v10.2 with Safari 1.0 and later.
  • Available in Mac OS X v10.2.7 and later.
Declared In
WebDocument.h

viewDidMoveToHostWindow

Invoked when a web view's host window is set. (required)

- (void)viewDidMoveToHostWindow

Availability
  • Available in Mac OS X v10.2 with Safari 1.0 and later.
  • Available in Mac OS X v10.2.7 and later.
See Also
Declared In
WebDocument.h

viewWillMoveToHostWindow:

Invoked when a web view’s host window is about to change. (required)

- (void)viewWillMoveToHostWindow:(NSWindow *)hostWindow

Parameters
hostWindow

The new host window for the view.

Availability
  • Available in Mac OS X v10.2 with Safari 1.0 and later.
  • Available in Mac OS X v10.2.7 and later.
See Also
Declared In
WebDocument.h


Last updated: 2009-08-19

Did this document help you? Yes It's good, but... Not helpful...