Protocol

WebDocumentText

WebDocumentText is an optional protocol for document view objects that display text. This protocol defines methods for accessing document content as strings, and methods for text selection. Classes that adopt this protocol should also adopt WebDocumentView and inherit from NSView.

Declaration

@protocol WebDocumentText

Topics

Getting document content

- string

Returns the entire content of the web document as a string.

Required.

- attributedString

Returns the entire content of the web document as an attributed string.

Required.

Selecting and deselecting text

- selectAll

Selects all the text in the web document.

Required.

- deselectAll

Deselects the currently selected text in the web document.

Required.

- selectedString

Returns the currently selected text in the web document as a string.

Required.

- selectedAttributedString

Returns the currently selected text in the web document as an attributed string.

Required.

Text encoding

- supportsTextEncoding

Returns a Boolean value that indicates whether the web document supports text encoding.

Required.

Relationships

Inherits From

See Also

Working With Document Web Views (Legacy)

WebDocumentRepresentation

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.

Deprecated
WebDocumentSearching

WebDocumentSearching is an optional protocol for document view objects that support searching. Classes that adopt this protocol should also adopt WebDocumentView and inherit from NSView.

Deprecated
WebDocumentView

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.

Deprecated