Mac OS X Reference Library Apple Developer Connection spyglass button

WebDocumentText 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

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.

Tasks

Getting Document Content

Selecting and Deselecting Text

Text Encoding

Instance Methods

attributedString

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

- (NSAttributedString *)attributedString

Return Value

An attributed string containing the entire content of the web 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

deselectAll

Deselects the currently selected text in the web document. (required)

- (void)deselectAll

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

selectAll

Selects all the text in the web document. (required)

- (void)selectAll

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

selectedAttributedString

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

- (NSAttributedString *)selectedAttributedString

Return Value

An attributed string containing the currently selected text in the web 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

selectedString

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

- (NSString *)selectedString

Return Value

The currently selected text in the web 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

string

Returns the entire content of the web document as a string. (required)

- (NSString *)string

Return Value

The entire content of the web 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

supportsTextEncoding

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

- (BOOL)supportsTextEncoding

Return Value

YES if the web document supports text encoding; otherwise, NO.

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


Last updated: 2009-03-04

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