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]
pub fn coerce<T: nsISelectionCoerce>(&self) -> &T
[src]
Cast this nsISelection
to one of its base interfaces.
impl nsISelection
[src]
pub unsafe fn GetAnchorNode(
&self,
aAnchorNode: *mut *const nsIDOMNode
) -> nsresult
[src]
&self,
aAnchorNode: *mut *const nsIDOMNode
) -> nsresult
/**
* Returns the node in which the selection begins.
*/
readonly attribute nsIDOMNode anchorNode;
pub unsafe fn GetAnchorOffset(&self, aAnchorOffset: *mut int32_t) -> nsresult
[src]
/**
* The offset within the (text) node where the selection begins.
*/
readonly attribute long anchorOffset;
pub unsafe fn GetFocusNode(
&self,
aFocusNode: *mut *const nsIDOMNode
) -> nsresult
[src]
&self,
aFocusNode: *mut *const nsIDOMNode
) -> nsresult
/**
* Returns the node in which the selection ends.
*/
readonly attribute nsIDOMNode focusNode;
pub unsafe fn GetFocusOffset(&self, aFocusOffset: *mut int32_t) -> nsresult
[src]
/**
* The offset within the (text) node where the selection ends.
*/
readonly attribute long focusOffset;
pub unsafe fn GetIsCollapsed(&self, aIsCollapsed: *mut bool) -> nsresult
[src]
/**
* Indicates if the selection is collapsed or not.
*/
readonly attribute boolean isCollapsed;
pub unsafe fn GetRangeCount(&self, aRangeCount: *mut int32_t) -> nsresult
[src]
/**
* Returns the number of ranges in the selection.
*/
readonly attribute long rangeCount;
pub unsafe fn GetRangeAt(
&self,
index: int32_t,
_retval: *mut *const nsIDOMRange
) -> nsresult
[src]
&self,
index: int32_t,
_retval: *mut *const nsIDOMRange
) -> nsresult
/**
* Returns the range at the specified index.
*/
nsIDOMRange getRangeAt (in long index);
pub unsafe fn Collapse(
&self,
parentNode: *const nsIDOMNode,
offset: int32_t
) -> nsresult
[src]
&self,
parentNode: *const nsIDOMNode,
offset: int32_t
) -> nsresult
/**
* 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);
pub unsafe fn CollapseNative(
&self,
parentNode: *const nsINode,
offset: int32_t
) -> nsresult
[src]
&self,
parentNode: *const nsINode,
offset: int32_t
) -> nsresult
[noscript] void collapseNative (in nsINode parentNode, in long offset);
pub unsafe fn Extend(
&self,
parentNode: *const nsIDOMNode,
offset: int32_t
) -> nsresult
[src]
&self,
parentNode: *const nsIDOMNode,
offset: int32_t
) -> nsresult
/**
* 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);
pub unsafe fn ExtendNative(
&self,
parentNode: *const nsINode,
offset: int32_t
) -> nsresult
[src]
&self,
parentNode: *const nsINode,
offset: int32_t
) -> nsresult
[noscript] void extendNative (in nsINode parentNode, in long offset);
pub unsafe fn CollapseToStart(&self) -> nsresult
[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 ();
pub unsafe fn CollapseToEnd(&self) -> nsresult
[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 ();
pub unsafe fn ContainsNode(
&self,
node: *const nsIDOMNode,
partlyContained: bool,
_retval: *mut bool
) -> nsresult
[src]
&self,
node: *const nsIDOMNode,
partlyContained: bool,
_retval: *mut bool
) -> nsresult
/**
* 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);
pub unsafe fn SelectAllChildren(
&self,
parentNode: *const nsIDOMNode
) -> nsresult
[src]
&self,
parentNode: *const nsIDOMNode
) -> nsresult
/**
* 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);
pub unsafe fn AddRange(&self, range: *const nsIDOMRange) -> nsresult
[src]
/**
* Adds a range to the current selection.
*/
void addRange (in nsIDOMRange range);
pub unsafe fn RemoveRange(&self, range: *const nsIDOMRange) -> nsresult
[src]
/**
* Removes a range from the current selection.
*/
void removeRange (in nsIDOMRange range);
pub unsafe fn RemoveAllRanges(&self) -> nsresult
[src]
/**
* Removes all ranges from the current selection.
*/
void removeAllRanges ();
pub unsafe fn DeleteFromDocument(&self) -> nsresult
[src]
/**
* Deletes this selection from document the nodes belong to.
*/
void deleteFromDocument ();
pub unsafe fn ToString(&self, _retval: &mut nsAString) -> nsresult
[src]
/**
* Returns the whole selection into a plain text string.
*/
DOMString toString ();
pub unsafe fn Modify(
&self,
alter: &nsAString,
direction: &nsAString,
granularity: &nsAString
) -> nsresult
[src]
&self,
alter: &nsAString,
direction: &nsAString,
granularity: &nsAString
) -> nsresult
/**
* 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>
pub fn coerce<T: nsISupportsCoerce>(&self) -> &T
[src]
Cast this nsISupports
to one of its base interfaces.
pub unsafe fn QueryInterface(
&self,
uuid: &nsIID,
result: *mut *mut c_void
) -> nsresult
[src]
&self,
uuid: &nsIID,
result: *mut *mut c_void
) -> nsresult
void QueryInterface (in nsIIDRef uuid, [iid_is (uuid), retval] out nsQIResult result);
pub unsafe fn AddRef(&self) -> nsrefcnt
[src]
[noscript,notxpcom] nsrefcnt AddRef ();
pub unsafe fn Release(&self) -> nsrefcnt
[src]
[noscript,notxpcom] nsrefcnt Release ();
Trait Implementations
impl XpCom for nsISelection
[src]
const IID: nsIID
IID: nsIID = nsID(3768898739, 62286, 17597, [177, 242, 78, 59, 222, 155, 105, 21])
fn query_interface<T: XpCom>(&self) -> Option<RefPtr<T>>
[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]
unsafe fn addref(&self)
[src]
Increment the reference count.
unsafe fn release(&self)
[src]
Decrement the reference count, potentially freeing backing memory.
impl Deref for nsISelection
[src]
type Target = nsISupports
The resulting type after dereferencing.
fn deref(&self) -> &nsISupports
[src]
Dereferences the value.