Struct xpcom::interfaces::nsISelection [] [src]

#[repr(C)]
pub struct nsISelection { /* fields omitted */ }

interface nsISelection : nsISupports

/**
 * Interface for manipulating and querying the current selected range
 * of nodes within the document.
 *
 * @version 1.0
 */

Methods

impl nsISelection
[src]

[src]

Cast this nsISelection to one of its base interfaces.

impl nsISelection
[src]

[src]

/**
     * Returns the node in which the selection begins.
     */

readonly attribute nsIDOMNode anchorNode;

[src]

/**
     * The offset within the (text) node where the selection begins.
     */

readonly attribute long anchorOffset;

[src]

/**
     * Returns the node in which the selection ends.
     */

readonly attribute nsIDOMNode focusNode;

[src]

/**
     * The offset within the (text) node where the selection ends.
     */

readonly attribute long focusOffset;

[src]

/**
     * Indicates if the selection is collapsed or not.
     */

readonly attribute boolean isCollapsed;

[src]

/**
     * Returns the number of ranges in the selection.
     */

readonly attribute long rangeCount;

[src]

/**
     * Returns the range at the specified index.
     */

nsIDOMRange getRangeAt (in long index);

[src]

/**
     * Collapses the selection to a single point, at the specified offset
     * in the given DOM node. When the selection is collapsed, and the content
     * is focused and editable, the caret will blink there.
     * @param parentNode      The given dom node where the selection will be set
     * @param offset          Where in given dom node to place the selection (the offset into the given node)
     */

void collapse (in nsIDOMNode parentNode, in long offset);

[src]

[noscript] void collapseNative (in nsINode parentNode, in long offset);

[src]

/**
     * Extends the selection by moving the selection end to the specified node and offset,
     * preserving the selection begin position. The new selection end result will always
     * be from the anchorNode to the new focusNode, regardless of direction.
     * @param parentNode      The node where the selection will be extended to
     * @param offset          Where in node to place the offset in the new selection end
     */

void extend (in nsIDOMNode parentNode, in long offset);

[src]

[noscript] void extendNative (in nsINode parentNode, in long offset);

[src]

/**
     * Collapses the whole selection to a single point at the start
     * of the current selection (irrespective of direction).  If content
     * is focused and editable, the caret will blink there.
     */

void collapseToStart ();

[src]

/**
     * Collapses the whole selection to a single point at the end
     * of the current selection (irrespective of direction).  If content
     * is focused and editable, the caret will blink there.
     */

void collapseToEnd ();

[src]

/**
     * Indicates whether the node is part of the selection. If partlyContained
     * is set to PR_TRUE, the function returns true when some part of the node
     * is part of the selection. If partlyContained is set to PR_FALSE, the
     * function only returns true when the entire node is part of the selection.
     */

boolean containsNode (in nsIDOMNode node, in boolean partlyContained);

[src]

/**
     * Adds all children of the specified node to the selection.
     * @param parentNode  the parent of the children to be added to the selection.
     */

void selectAllChildren (in nsIDOMNode parentNode);

[src]

/**
     * Adds a range to the current selection.
     */

void addRange (in nsIDOMRange range);

[src]

/**
     * Removes a range from the current selection.
     */

void removeRange (in nsIDOMRange range);

[src]

/**
     * Removes all ranges from the current selection.
     */

void removeAllRanges ();

[src]

/**
     * Deletes this selection from document the nodes belong to.
     */

void deleteFromDocument ();

[src]

/**
     * Returns the whole selection into a plain text string.
     */

DOMString toString ();

[src]

/**
     * Modifies the selection.  Note that the parameters are case-insensitive.
     *
     * @param alter can be one of { "move", "extend" }
     *   - "move" collapses the selection to the end of the selection and
     *      applies the movement direction/granularity to the collapsed
     *      selection.
     *   - "extend" leaves the start of the selection unchanged, and applies
     *      movement direction/granularity to the end of the selection.
     * @param direction can be one of { "forward", "backward", "left", "right" }
     * @param granularity can be one of { "character", "word",
     *                                    "line", "lineboundary" }
     *
     * @returns NS_ERROR_NOT_IMPLEMENTED if the granularity is "sentence",
     * "sentenceboundary", "paragraph", "paragraphboundary", or
     * "documentboundary".  Returns NS_ERROR_INVALID_ARG if alter, direction,
     * or granularity has an unrecognized value.
     */

void modify (in DOMString alter, in DOMString direction, in DOMString granularity);

Methods from Deref<Target = nsISupports>

[src]

Cast this nsISupports to one of its base interfaces.

[src]

void QueryInterface (in nsIIDRef uuid, [iid_is (uuid), retval] out nsQIResult result);

[src]

[noscript,notxpcom] nsrefcnt AddRef ();

[src]

[noscript,notxpcom] nsrefcnt Release ();

Trait Implementations

impl XpCom for nsISelection
[src]

IID: nsIID = nsID(3768898739, 62286, 17597, [177, 242, 78, 59, 222, 155, 105, 21])

[src]

Perform a QueryInterface call on this object, attempting to dynamically cast it to the requested interface type. Returns Some(RefPtr) if the cast succeeded, and None otherwise. Read more

impl RefCounted for nsISelection
[src]

[src]

Increment the reference count.

[src]

Decrement the reference count, potentially freeing backing memory.

impl Deref for nsISelection
[src]

The resulting type after dereferencing.

[src]

Dereferences the value.