WARNING: Most of this content (with the exception of the Mozilla 1.9 XPCOM reference) is very old, and can be expected to be out of date and possibly obsolete. For better XUL documentation, please visit the XUL hub at the Mozilla Developer Center.

nsIPlaintextEditor

IID:1480e196-0d5c-40cf-8563-ed8a33eabcf2
Inherits From:nsISupports

This interface is implemented by the following components:


Constants

PRInt32 eEditorPlaintextMask = 1
PRInt32 eEditorSingleLineMask = 2
PRInt32 eEditorPasswordMask = 4
PRInt32 eEditorReadonlyMask = 8
PRInt32 eEditorDisabledMask = 16
PRInt32 eEditorFilterInputMask = 32
PRInt32 eEditorMailMask = 64
PRInt32 eEditorUseAsyncUpdatesMask = 128
PRInt32 eEditorEnableWrapHackMask = 256
PRInt32 eEditorWidgetMask = 512
PRInt32 eEditorNoCSSMask = 1024
PRInt32 eEditorAllowInteraction = 2048
PRInt32 eNewlinesPasteIntact = 0
PRInt32 eNewlinesPasteToFirst = 1
PRInt32 eNewlinesReplaceWithSpaces = 2
PRInt32 eNewlinesStrip = 3
PRInt32 eNewlinesReplaceWithCommas = 4
PRInt32 eNewlinesStripSurroundingWhitespace = 5

Properties

PRInt32 maxTextLength

The maximum number of characters allowed. default: -1 (unlimited).

PRInt32 newlineHandling

Get and set newline handling.

Values are the constants defined above.

readonly PRInt32 textLength

The length of the contents in characters. XXX change this type to 'unsigned long'

PRInt32 wrapWidth

Get and set the body wrap width.

Special values: 0 = wrap to window width -1 = no wrap at all


Methods

void handleKeyPress ( nsIDOMKeyEvent keyEvent ) void insertLineBreak ( ) void insertText ( DOMString stringToInsert ) void setWrapColumn ( PRInt32 wrapColumn )

void handleKeyPress ( nsIDOMKeyEvent keyEvent )

EditorKeyPress consumes a keyevent.

Arguments:
keyEvent: key event to consume

void insertLineBreak ( )

Insert a line break into the content model. The interpretation of a break is up to the implementation: it may enter a character, split a node in the tree, etc. This may be more efficient than calling InsertText with a newline.


void insertText ( DOMString stringToInsert )

Inserts a string at the current location, given by the selection. If the selection is not collapsed, the selection is deleted and the insertion takes place at the resulting collapsed selection.

Arguments:
stringToInsert

void setWrapColumn ( PRInt32 wrapColumn )

Similar to the setter for wrapWidth, but just sets the editor internal state without actually changing the content being edited to wrap at that column. This should only be used by callers who are sure that their content is already set up correctly.

Arguments:
wrapColumn

Reference documentation is generated from Mozilla's source.

Copyright © 1999-2006 XULPlanet.com