Implemented by
[scriptable, uuid(1480e196-0d5c-40cf-8563-ed8a33eabcf2)]
interface nsIPlaintextEditor : nsISupports
Constants
const
long
eEditorPlaintextMask = 1
const
long
eEditorSingleLineMask = 2
const
long
eEditorPasswordMask = 4
const
long
eEditorReadonlyMask = 8
const
long
eEditorDisabledMask = 16
const
long
eEditorFilterInputMask = 32
const
long
eEditorMailMask = 64
const
long
eEditorUseAsyncUpdatesMask = 128
const
long
eEditorEnableWrapHackMask = 256
const
long
eEditorWidgetMask = 512
const
long
eEditorNoCSSMask = 1024
const
long
eEditorAllowInteraction = 2048
const
long
eNewlinesPasteIntact = 0
const
long
eNewlinesPasteToFirst = 1
const
long
eNewlinesReplaceWithSpaces = 2
const
long
eNewlinesStrip = 3
const
long
eNewlinesReplaceWithCommas = 4
const
long
eNewlinesStripSurroundingWhitespace = 5
Attributes
The maximum number of characters allowed. default: -1 (unlimited).
attribute
long
maxTextLength
Get and set newline handling. Values are the constants defined above.
attribute
long
newlineHandling
The length of the contents in characters. XXX change this type to 'unsigned long'
readonly attribute
long
textLength
Get and set the body wrap width.
Special values:
0 = wrap to window width
-1 = no wrap at all
attribute
long
wrapWidth
Methods
EditorKeyPress consumes a keyevent. @param aKeyEvent key event to consume
void
handleKeyPress(in nsIDOMKeyEvent aKeyEvent)
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
insertLineBreak()
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. @param aString the string to be inserted
void
insertText(in DOMString aStringToInsert)
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.
void
setWrapColumn(in long aWrapColumn)
Compare to: