nsISelectionController

IID:D2D1D179-85A7-11d3-9932-00108301233C
Inherits From:nsISelectionDisplay

Constants

PRInt16 SELECTION_NONE = 0
PRInt16 SELECTION_NORMAL = 1
PRInt16 SELECTION_SPELLCHECK = 2
PRInt16 SELECTION_IME_RAWINPUT = 4
PRInt16 SELECTION_IME_SELECTEDRAWTEXT = 8
PRInt16 SELECTION_IME_CONVERTEDTEXT = 16
PRInt16 SELECTION_IME_SELECTEDCONVERTEDTEXT = 32
PRInt16 SELECTION_ACCESSIBILITY = 64
PRInt16 NUM_SELECTIONTYPES = 8
PRInt16 SELECTION_ANCHOR_REGION = 0
PRInt16 SELECTION_FOCUS_REGION = 1
PRInt16 NUM_SELECTION_REGIONS = 2
PRInt16 SELECTION_OFF = 0
PRInt16 SELECTION_HIDDEN = 1
PRInt16 SELECTION_ON = 2
PRInt16 SELECTION_DISABLED = 3
PRInt16 SELECTION_ATTENTION = 4

Methods

void characterMove ( PRBool forward , PRBool extend ) PRBool checkVisibility ( nsIDOMNode node , PRInt16 startOffset , PRInt16 endOffset ) void completeMove ( PRBool forward , PRBool extend ) void completeScroll ( PRBool forward ) PRBool getCaretEnabled ( ) PRInt16 getDisplaySelection ( ) nsISelection getSelection ( PRInt16 type ) void intraLineMove ( PRBool forward , PRBool extend ) void lineMove ( PRBool forward , PRBool extend ) void pageMove ( PRBool forward , PRBool extend ) void repaintSelection ( PRInt16 type ) void scrollHorizontal ( PRBool left ) void scrollLine ( PRBool forward ) void scrollPage ( PRBool forward ) void scrollSelectionIntoView ( PRInt16 type , PRInt16 region , PRBool isSynchronous ) void selectAll ( ) void setCaretEnabled ( PRBool enabled ) void setCaretReadOnly ( PRBool readOnly ) void setCaretVisibilityDuringSelection ( PRBool visibility ) void setCaretWidth ( PRInt16 pixels ) void setDisplaySelection ( PRInt16 toggle ) void wordMove ( PRBool forward , PRBool extend )

void characterMove ( PRBool forward , PRBool extend )

CharacterMove will move the selection one character forward/backward in the document. this will also have the effect of collapsing the selection if the extend = PR_FALSE the "point" of selection that is extended is considered the "focus" point. or the last point adjusted by the selection.

Arguments:
forward: forward or backward if PR_FALSE
extend: should it collapse the selection of extend it?

PRBool checkVisibility ( nsIDOMNode node , PRInt16 startOffset , PRInt16 endOffset )

CheckVisibility will return true if textnode and offsets are actually rendered in the current precontext.

Arguments:
node: textNode to test
startOffset: offset in dom to first char of textnode to test
endOffset: offset in dom to last char of textnode to test

void completeMove ( PRBool forward , PRBool extend )

CompleteMove will move page view to the top or bottom of the document this will also have the effect of collapsing the selection if the extend = PR_FALSE the "point" of selection that is extended is considered the "focus" point. or the last point adjusted by the selection.

Arguments:
forward: forward or backward if PR_FALSE
extend: should it collapse the selection of extend it?

void completeScroll ( PRBool forward )

CompleteScroll will move page view to the top or bottom of the document

Arguments:
forward: forward or backward if PR_FALSE

PRBool getCaretEnabled ( )

Gets the current state of the caret.

Returns:
if aOutEnabled==null, returns NS_ERROR_INVALID_ARG else NS_OK

PRInt16 getDisplaySelection ( )

GetDisplaySelection will get the display mode for the selection. OFF,ON,DISABLED


nsISelection getSelection ( PRInt16 type )

GetSelection will return the selection that the presentation shell may implement.

Arguments:
type: will hold the type of selection //SelectionType

void intraLineMove ( PRBool forward , PRBool extend )

IntraLineMove will move the selection to the front of the line or end of the line in the document. this will also have the effect of collapsing the selection if the extend = PR_FALSE the "point" of selection that is extended is considered the "focus" point. or the last point adjusted by the selection.

Arguments:
forward: forward or backward if PR_FALSE
extend: should it collapse the selection of extend it?

void lineMove ( PRBool forward , PRBool extend )

LineMove will move the selection one line forward/backward in the document. this will also have the effect of collapsing the selection if the extend = PR_FALSE the "point" of selection that is extended is considered the "focus" point. or the last point adjusted by the selection.

Arguments:
forward: forward or backward if PR_FALSE
extend: should it collapse the selection of extend it?

void pageMove ( PRBool forward , PRBool extend )

PageMove will move the selection one page forward/backward in the document. this will also have the effect of collapsing the selection if the extend = PR_FALSE the "point" of selection that is extended is considered the "focus" point. or the last point adjusted by the selection.

Arguments:
forward: forward or backward if PR_FALSE
extend: should it collapse the selection of extend it?

void repaintSelection ( PRInt16 type )

RepaintSelection repaints the selection specified by type.

Arguments:
type: specifies the selection to repaint.

void scrollHorizontal ( PRBool left )

ScrolHorizontal will scroll left or right dependent on the boolean

Arguments:
left: if true will scroll left. if not will scroll right.

void scrollLine ( PRBool forward )

ScrolLine will scroll line up or down dependent on the boolean

Arguments:
forward: scroll forward or backwards in selection

void scrollPage ( PRBool forward )

ScrollPage will scroll the page without affecting the selection.

Arguments:
forward: scroll forward or backwards in selection

void scrollSelectionIntoView ( PRInt16 type , PRInt16 region , PRBool isSynchronous )

ScrollSelectionIntoView scrolls a region of the selection, so that it is visible in the scrolled view.

Arguments:
type: the selection to scroll into view. //SelectionType
region: the region inside the selection to scroll into view. //SelectionRegion
isSynchronous: when true, scrolls the selection into view before returning. If false, posts a request which is processed at some point after the method returns.

void selectAll ( )

SelectAll will select the whole page


void setCaretEnabled ( PRBool enabled )

Set the caret as enabled or disabled. An enabled caret will draw or blink when made visible. A disabled caret will never show up. Can be called any time.

Arguments:
enabled
Returns:
always NS_OK

void setCaretReadOnly ( PRBool readOnly )

Set the caret readonly or not. An readonly caret will draw but not blink when made visible.

Arguments:
readOnly: PR_TRUE to enable caret. PR_FALSE to disable.
Returns:
always NS_OK

void setCaretVisibilityDuringSelection ( PRBool visibility )

Show the caret even in selections. By default the caret is hidden unless the selection is collapsed. Use this function to show the caret even in selections.

Arguments:
visibility: PR_TRUE to show the caret in selections. PR_FALSE to hide.
Returns:
always NS_OK

void setCaretWidth ( PRInt16 pixels )

Set the carets width Can be called any time.

Arguments:
pixels: , the width of the caret in pixels
Returns:
always NS_OK if successful, NS_ERROR_FAILURE if not.

void setDisplaySelection ( PRInt16 toggle )

SetDisplaySelection will set the display mode for the selection. OFF,ON,DISABLED

Arguments:
toggle

void wordMove ( PRBool forward , PRBool extend )

WordMove will move the selection one word forward/backward in the document. this will also have the effect of collapsing the selection if the extend = PR_FALSE the "point" of selection that is extended is considered the "focus" point. or the last point adjusted by the selection.

Arguments:
forward: forward or backward if PR_FALSE
extend: should it collapse the selection of extend it?

References

This interface is the type of the following properties:

nsIEditor.selectionController

This interface is passed as an argument to the following methods:

nsIEditor.init

Reference documentation is generated from Mozilla's source.

Add a note User Contributed Notes
No comments available

Copyright © 1999 - 2005 XULPlanet.com