class Range


Full nameDOM::Range
Definition#include <dom2_range.h>
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Types

Public Methods

Protected Methods

Protected Members

Node  startContainer ()

[const]

Node within which the range begins

long  startOffset ()

[const]

Offset within the starting node of the range.

Node  endContainer ()

[const]

Node within which the range ends

long  endOffset ()

[const]

Offset within the ending node of the range.

bool  collapsed ()

[const]

TRUE if the range is collapsed

Node  commonAncestorContainer ()

Gets the common ancestor container of the range's two end-points. Also sets it.

void  setStart ( const Node &refNode, long offset )

Sets the attributes describing the start of the range.

INVALID_NODE_TYPE_ERR: Raised if <code> refNode </code> or an ancestor of <code> refNode </code> is an Attr, Entity, Notation, or DocumentType node.

If an offset is out-of-bounds, should it just be fixed up or should an exception be raised.

Parameters:
refNodeThe <code> refNode </code> value. This parameter must be different from <code> null </code> .
offsetThe <code> startOffset </code> value.

Throws: RangeException, NULL_NODE_ERR:, Raised, if, <code>, refNode, </code>, is, <code>, null, </code>, .

void  setEnd ( const Node &refNode, long offset )

Sets the attributes describing the end of a range.

INVALID_NODE_TYPE_ERR: Raised if <code> refNode </code> or an ancestor of <code> refNode </code> is an Attr, Entity, Notation, or DocumentType node.

Parameters:
refNodeThe <code> refNode </code> value. This parameter must be different from <code> null </code> .
offsetThe <code> endOffset </code> value.

Throws: RangeException, NULL_NODE_ERR:, Raised, if, <code>, refNode, </code>, is, <code>, null, </code>, .

void  setStartBefore ( const Node &refNode )

Sets the start position to be before a node

Parameters:
refNodeRange starts before <code> refNode </code>

Throws: RangeException, INVALID_NODE_TYPE_ERR:, Raised, if, an, ancestor, of, <code>, refNode, </code>, is, an, Attr, Entity, Notation, or, DocumentType, node, or, if, <code>, refNode, </code>, is, a, Document, DocumentFragment, Attr, Entity, or, Notation, node.

void  setStartAfter ( const Node &refNode )

Sets the start position to be after a node

Parameters:
refNodeRange starts after <code> refNode </code>

Throws: RangeException, INVALID_NODE_TYPE_ERR:, Raised, if, an, ancestor, of, <code>, refNode, </code>, is, an, Attr, Entity, Notation, or, DocumentType, node, or, if, <code>, refNode, </code>, is, a, Document, DocumentFragment, Attr, Entity, or, Notation, node.

void  setEndBefore ( const Node &refNode )

Sets the end position to be before a node.

Parameters:
refNodeRange ends before <code> refNode </code>

Throws: RangeException, INVALID_NODE_TYPE_ERR:, Raised, if, an, ancestor, of, <code>, refNode, </code>, is, an, Attr, Entity, Notation, or, DocumentType, node, or, if, <code>, refNode, </code>, is, a, Document, DocumentFragment, Attr, Entity, or, Notation, node.

void  setEndAfter ( const Node &refNode )

Sets the end of a range to be after a node

Parameters:
refNodeRange ends after <code> refNode </code> .

Throws: RangeException, INVALID_NODE_TYPE_ERR:, Raised, if, an, ancestor, of, <code>, refNode, </code>, is, an, Attr, Entity, Notation, or, DocumentType, node, or, if, <code>, refNode, </code>, is, a, Document, DocumentFragment, Attr, Entity, or, Notation, node.

void  collapse ( bool toStart )

Collapse a range onto one of its end-points

Parameters:
toStartIf TRUE, collapses the Range onto its start; if FALSE, collapses it onto its end.

void  selectNode ( const Node &refNode )

Select a node and its contents

Parameters:
refNodeThe node to select.

Throws: RangeException, INVALID_NODE_TYPE_ERR:, Raised, if, an, ancestor, of, <code>, refNode, </code>, is, an, Attr, Entity, Notation, or, DocumentType, node, or, if, <code>, refNode, </code>, is, a, Document, DocumentFragment, Attr, Entity, or, Notation, node.

void  selectNodeContents ( const Node &refNode )

Select the contents within a node

Parameters:
refNodeNode to select from

Throws: RangeException, INVALID_NODE_TYPE_ERR:, Raised, if, <code>, refNode, </code>, or, an, ancestor, of, <code>, refNode, </code>, is, an, Attr, Entity, Notation, or, DocumentType, node.

short  compareBoundaryPoints ( CompareHow how, const Range &sourceRange )

Compare the end-points of two ranges in a document.

Returns: -1, 0 or 1 depending on whether the corresponding end-point of the Range is before, equal to, or after the corresponding end-point of <code> sourceRange </code> .

Throws: DOMException, WRONG_DOCUMENT_ERR:, Raised, if, the, two, Ranges, are, not, in, the, same, document, or, document, fragment.

bool  boundaryPointsValid ( )

not part of the DOM

Compare the boundary-points of a range.

Return true if the startContainer is before the endContainer, or if they are equal. Return false if the startContainer is after the endContainer.

void  deleteContents ( )

Removes the contents of a range from the containing document or document fragment without returning a reference to the removed content.

Throws: DOMException, NO_MODIFICATION_ALLOWED_ERR:, Raised, if, any, portion, of, the, content, of, the, range, is, read-only, or, any, of, the, nodes, that, contain, any, of, the, content, of, the, range, are, read-only.

DocumentFragment  extractContents ( )

Moves the contents of a range from the containing document or document fragment to a new DocumentFragment.

HIERARCHY_REQUEST_ERR: Raised if a DocumentType node would be extracted into the new DocumentFragment.

Returns: A DocumentFragment containing the extracted contents.

Throws: DOMException, NO_MODIFICATION_ALLOWED_ERR:, Raised, if, any, portion, of, the, content, of, the, range, is, read-only, or, any, of, the, nodes, which, contain, any, of, the, content, of, the, range, are, read-only.

DocumentFragment  cloneContents ( )

Duplicates the contents of a range

Returns: A DocumentFragment containing contents equivalent to those of this range.

Throws: DOMException, HIERARCHY_REQUEST_ERR:, Raised, if, a, DocumentType, node, would, be, extracted, into, the, new, DocumentFragment.

void  insertNode ( const Node &newNode )

Inserts a node into the document or document fragment at the start of the range.

WRONG_DOCUMENT_ERR: Raised if <code> newNode </code> and the container of the start of the Range were not created from the same document.

HIERARCHY_REQUEST_ERR: Raised if the container of the start of the Range is of a type that does not allow children of the type of <code> newNode </code> or if <code> newNode </code> is an ancestor of the container .

Parameters:
newNodeThe node to insert at the start of the range

Throws: DOMException, NO_MODIFICATION_ALLOWED_ERR:, Raised, if, an, ancestor, container, of, the, start, of, the, range, is, read-only., RangeException, INVALID_NODE_TYPE_ERR:, Raised, if, <code>, node, </code>, is, an, Attr, Entity, Notation, DocumentFragment, or, Document, node.

void  surroundContents ( const Node &newParent )

Reparents the contents of the range to the given node and inserts the node at the position of the start of the range.

WRONG_DOCUMENT_ERR: Raised if <code> newParent </code> and the container of the start of the Range were not created from the same document.

HIERARCHY_REQUEST_ERR: Raised if the container of the start of the Range is of a type that does not allow children of the type of <code> newParent </code> or if <code> newParent </code> is an ancestor of the container or if <code> node </code> would end up with a child node of a type not allowed by the type of <code> node </code> .

INVALID_NODE_TYPE_ERR: Raised if <code> node </code> is an Attr, Entity, DocumentType, Notation, Document, or DocumentFragment node.

Parameters:
newParentThe node to surround the contents with.

Throws: DOMException, NO_MODIFICATION_ALLOWED_ERR:, Raised, if, an, ancestor, container, of, either, end-point, of, the, range, is, read-only., RangeException, BAD_ENDPOINTS_ERR:, Raised, if, the, range, partially, selects, a, non-text, node.

Range  cloneRange ( )

Produces a new range whose end-points are equal to the end-points of the range.

Returns: The duplicated range.

DOMString  toString ( )

Returns the contents of a range as a string.

Returns: The contents of the range.

DOMString  toHTML ( )

void  detach ( )

Called to indicate that the range is no longer in use and that the implementation may relinquish any resources associated with this range. Subsequent calls to any methods or attribute getters on this range will result in a DOMException being thrown with an error code of INVALID_STATE_ERR.

bool  isDetached ()

[const]

not part of the DOM TRUE if the range is detached

RangeImpl * handle ()

[const]

not part of the DOM


Generated by: ssk@tauon.ph.unimelb.EDU.AU on Wed May 23 05:55:52 2001, using kdoc 2.0a35.