Readonly
autoReadonly
canReturns true when undo/redo is enabled and there is one or more transaction in the redo stack.
Readonly
canRetruns true when undo/redo is enabled and there is one or more transaction in the undo stack.
Readonly
composingwhether this editor has active IME transaction
the MimeType of the document
Readonly
documentthe DOM Document this editor is associated with, refcounted.
Sets document's character set. This is available only when the editor
instance is an HTMLEditor since it's odd to change character set of
parent document of <input>
and <textarea>
.
Readonly
document------------ Document info and file methods -------------- Returns true if the document has no meaningful content
Readonly
documentReturns true if the document is modifed and needs saving
edit flags for this editor. May be set at any time.
Readonly
isReturns true if we have a document that is not marked read-only
Readonly
isReturns true if the current selection anchor is editable
Get and set newline handling.
Values are the constants defined above.
Readonly
passwordpasswordMask attribute is a mask character which is used to mask password.
Readonly
rootthe body element, i.e. the root of the editable document.
Readonly
selectionReadonly
selectionthe selection controller for the current presentation, refcounted.
Readonly
textThe length of the contents in characters.
Readonly
undoReturns true when undo/redo is enabled (by default).
Readonly
unmaskedReadonly
unmaskedThese attributes are available only when the editor is a password field. unmaskedStart is first unmasked character index, or 0 if there is no unmasked characters. unmaskedEnd is next index of the last unmasked character. 0 means there is no unmasked characters.
Get and set the body wrap width.
Special values: 0 = wrap to window width -1 = no wrap at all
Optional
aInstancePtr: objectA run time mechanism for interface discovery.
NS_OK if the interface is supported by the associated instance, NS_NOINTERFACE if it is not.
aInstancePtr must not be null.
[in] A requested interface IID
[out] A pointer to an interface pointer to receive the result.
------------ Various listeners methods -------------- nsIEditor holds strong references to the editor observers, action listeners and document state listeners.
add an EditActionListener to the editors list of listeners.
beginTransaction is a signal from the caller to the editor that
the caller will execute multiple updates to the content tree
that should be treated as a single logical operation,
in the most efficient way possible.
All transactions executed between a call to beginTransaction and
endTransaction will be undoable as an atomic action.
endTransaction must be called after beginTransaction.
Calls to beginTransaction can be nested, as long as endTransaction
is called once per beginUpdate.
Collapses selection at start of the document. If it's an HTML editor, collapses selection at start of current editing host (
element if it's in designMode) instead. If there is a non-editable node before any editable text nodes or inline elements which can have text nodes as their children, collapses selection at start of the editing host. If there is an editable text node which is not collapsed, collapses selection at start of the text node. If there is an editable inline element which cannot have text nodes as its child, collapses selection at before the element node. Otherwise, collapses selection at start of the editing host.cloneAttributes() is similar to Node::cloneNode(), it assures the attribute nodes of the destination are identical with the source node by copying all existing attributes from the source and deleting those not in the source. This is used when the destination element already exists
------------ Selected content removal --------------
DeleteSelection removes all nodes in the current selection.
If eStrip, strip any empty inline elements left behind after the deletion; if eNoStrip, don't. If in doubt, pass eStrip -- eNoStrip is only for if you're about to insert text or similar right after.
------------ Inline Spell Checking methods --------------
Returns the inline spell checker associated with this object. The spell checker is lazily created, so this function may create the object for you during this call.
If true, this will create a spell checker object if one does not exist yet for this editor. If false and the object has not been created, this function WILL RETURN NULL.
insertNode inserts aNode into aParent at aPosition. No checking is done to verify the legality of the insertion. That is the responsibility of the caller.
The place in aParent to insert the new node 0=first child, 1=second child, etc. any number > number of current children = last child
removeAttribute() deletes aAttribute from the attribute list of aElement. If aAttribute is not an attribute of aElement, nothing is done.
the content element to operate on
the string representation of the attribute to get
------------ Node manipulation methods --------------
setAttribute() sets the attribute of aElement. No checking is done to see if aAttribute is a legal attribute of the node, or if aValue is a legal value of aAttribute.
the content element to operate on
While setting the flag with this method to false, DeleteRangeTransaction, DeleteTextTransaction, InsertNodeTransaction, InsertTextTransaction and SplitNodeTransaction won't change Selection after modifying the DOM tree. Note that calling this with false does not guarantee that Selection won't be changed because other transaction may ignore this flag, editor itself may change selection, and current selection may become invalid after changing the DOM tree, etc. After calling this method with true, the caller should guarantee that Selection should be positioned where user expects.
false if you don't want above transactions to modify Selection automatically after modifying the DOM tree. Note that calling this with false does not guarantee that Selection is never changed.
unmask() is available only when the editor is a passwrod field. This
unmasks characters in specified by aStart and aEnd. If there have
already unmasked characters, they are masked when this is called.
Note that if you calls this without non-zero aTimeout
, you bear
responsibility for masking password with calling mask()
. I.e.,
user inputting password won't be masked automacitally. If user types
a new character and echo is enabled, unmasked range is expanded to
including it.
Optional, first index to show the character. If you specify middle of a surrogate pair, this expands the range to include the prceding high surrogate automatically. If omitted, it means that all characters of the password becomes unmasked.
Optional, next index of last unmasked character. If you specify middle of a surrogate pair, the expands the range to include the following low surrogate. If omitted or negative value, it means unmasking all characters after aStart. Specifying same index throws an exception.
Optional, specify milliseconds to hide the unmasked characters if you want to show them temporarily. If omitted or 0, it means this won't mask the characters automatically.
Generated using TypeDoc
autoMaskingEnabled is true if unmasked range and newly inputted characters are masked automatically. That's the default state. If false, until
mask()
is called, unmasked range and newly inputted characters are unmasked.