org.kde.koala

Class Range

public class Range extends Object implements QtSupport

Constructor Summary
protected Range(Class dummy)
Range()
Range(Document rootContainer)
Range(Range other)
Range(Node startContainer, long startOffset, Node endContainer, long endOffset)
Method Summary
booleanboundaryPointsValid()
not part of the DOM Compare the boundary-points of a range.
DocumentFragmentcloneContents()
Duplicates the contents of a range
RangecloneRange()
Produces a new range whose end-points are equal to the end-points of the range.
voidcollapse(boolean toStart)
Collapse a range onto one of its end-points
booleancollapsed()
true if the range is collapsed
NodecommonAncestorContainer()
Gets the common ancestor container of the range's two end-points.
DocumentFragmentcreateContextualFragment(String html)
voiddeleteContents()
Removes the contents of a range from the containing document or document fragment without returning a reference to the removed content.
voiddetach()
Called to indicate that the range is no longer in use and that the implementation may relinquish any resources associated with this range.
NodeendContainer()
Node within which the range ends
longendOffset()
Offset within the ending node of the range.
DocumentFragmentextractContents()
Moves the contents of a range from the containing document or document fragment to a new DocumentFragment.
voidinsertNode(Node newNode)
Inserts a node into the document or document fragment at the start of the range.
booleanisDetached()
not part of the DOM true if the range is detached
booleanisNull()
not part of the DOM
voidselectNode(Node refNode)
Select a node and its contents
voidselectNodeContents(Node refNode)
Select the contents within a node
voidsetEnd(Node refNode, long offset)
Sets the attributes describing the end of a range.
voidsetEndAfter(Node refNode)
Sets the end of a range to be after a node
voidsetEndBefore(Node refNode)
Sets the end position to be before a node.
voidsetStart(Node refNode, long offset)
Sets the attributes describing the start of the range.
voidsetStartAfter(Node refNode)
Sets the start position to be after a node
voidsetStartBefore(Node refNode)
Sets the start position to be before a node
NodestartContainer()
Node within which the range begins
longstartOffset()
Offset within the starting node of the range.
voidsurroundContents(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.
StringtoHTML()
StringtoString()
Returns the contents of a range as a string.

Constructor Detail

Range

protected Range(Class dummy)

Range

public Range()

Range

public Range(Document rootContainer)

Range

public Range(Range other)

Range

public Range(Node startContainer, long startOffset, Node endContainer, long endOffset)

Method Detail

boundaryPointsValid

public boolean 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.

UNKNOWN:

cloneContents

public DocumentFragment cloneContents()
Duplicates the contents of a range

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

UNKNOWN: Duplicates the contents of a range

cloneRange

public Range cloneRange()
Produces a new range whose end-points are equal to the end-points of the range.

Returns: The duplicated range.

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

collapse

public void collapse(boolean toStart)
Collapse a range onto one of its end-points

Parameters: toStart If true, collapses the Range onto its start; if false, collapses it onto its end.

UNKNOWN: Collapse a range onto one of its end-points

collapsed

public boolean collapsed()
true if the range is collapsed

UNKNOWN: true if the range is collapsed

commonAncestorContainer

public Node commonAncestorContainer()
Gets the common ancestor container of the range's two end-points. Also sets it.

UNKNOWN: Gets the common ancestor container of the range's two end-points.

createContextualFragment

public DocumentFragment createContextualFragment(String html)

deleteContents

public void deleteContents()
Removes the contents of a range from the containing document or document fragment without returning a reference to the removed content.

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

detach

public 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.

UNKNOWN: Called to indicate that the range is no longer in use and that the implementation may relinquish any resources associated with this range.

endContainer

public Node endContainer()
Node within which the range ends

UNKNOWN: Node within which the range ends

endOffset

public long endOffset()
Offset within the ending node of the range.

UNKNOWN: Offset within the ending node of the range.

extractContents

public 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.

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

insertNode

public void insertNode(Node newNode)
Inserts a node into the document or document fragment at the start of the range.

Parameters: newNode The node to insert at the start of the range WRONG_DOCUMENT_ERR: Raised if newNode 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 newNode or if newNode is an ancestor of the container .

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

isDetached

public boolean isDetached()
not part of the DOM true if the range is detached

UNKNOWN: not part of the DOM true if the range is detached

isNull

public boolean isNull()
not part of the DOM

UNKNOWN:

selectNode

public void selectNode(Node refNode)
Select a node and its contents

Parameters: refNode The node to select.

UNKNOWN: Select a node and its contents

selectNodeContents

public void selectNodeContents(Node refNode)
Select the contents within a node

Parameters: refNode Node to select from

UNKNOWN: Select the contents within a node

setEnd

public void setEnd(Node refNode, long offset)
Sets the attributes describing the end of a range.

Parameters: refNode The refNode value. This parameter must be different from null . offset The endOffset value. INVALID_NODE_TYPE_ERR: Raised if refNode or an ancestor of refNode is an Attr, Entity, Notation, or DocumentType node.

UNKNOWN: Sets the attributes describing the end of a range.

setEndAfter

public void setEndAfter(Node refNode)
Sets the end of a range to be after a node

Parameters: refNode Range ends after refNode .

UNKNOWN: Sets the end of a range to be after a node

setEndBefore

public void setEndBefore(Node refNode)
Sets the end position to be before a node.

Parameters: refNode Range ends before refNode

UNKNOWN: Sets the end position to be before a node.

setStart

public void setStart(Node refNode, long offset)
Sets the attributes describing the start of the range.

Parameters: refNode The refNode value. This parameter must be different from null . offset The startOffset value. INVALID_NODE_TYPE_ERR: Raised if refNode or an ancestor of refNode 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.

UNKNOWN: Sets the attributes describing the start of the range.

setStartAfter

public void setStartAfter(Node refNode)
Sets the start position to be after a node

Parameters: refNode Range starts after refNode

UNKNOWN: Sets the start position to be after a node

setStartBefore

public void setStartBefore(Node refNode)
Sets the start position to be before a node

Parameters: refNode Range starts before refNode

UNKNOWN: Sets the start position to be before a node

startContainer

public Node startContainer()
Node within which the range begins

UNKNOWN: Node within which the range begins

startOffset

public long startOffset()
Offset within the starting node of the range.

UNKNOWN: Offset within the starting node of the range.

surroundContents

public void surroundContents(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.

Parameters: newParent The node to surround the contents with. WRONG_DOCUMENT_ERR: Raised if newParent 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 newParent or if newParent is an ancestor of the container or if node would end up with a child node of a type not allowed by the type of node . INVALID_NODE_TYPE_ERR: Raised if node is an Attr, Entity, DocumentType, Notation, Document, or DocumentFragment node.

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

toHTML

public String toHTML()

UNKNOWN:

toString

public String toString()
Returns the contents of a range as a string.

Returns: The contents of the range.

UNKNOWN: Returns the contents of a range as a string.