nsISupports
Last changed in Gecko 5.0 (Firefox 5.0 / Thunderbird 5.0 / SeaMonkey 2.2)void addDefaultProperty(in nsIAtom aProperty, in AString aAttribute, in AString aValue); |
void addInsertionListener(in nsIContentFilter inFilter); |
void align(in AString aAlign); |
boolean breakIsVisible(in nsIDOMNode aNode); |
boolean canDrag(in nsIDOMEvent aEvent); |
void checkSelectionStateForAnonymousButtons(in nsISelection aSelection); |
nsIDOMElement createAnonymousElement(in AString aTag, in nsIDOMNode aParentNode, in AString aAnonClass, in boolean aIsCreatedHidden); |
nsIDOMElement createElementWithDefaults(in AString aTagName); |
void decreaseFontSize(); |
void doDrag(in nsIDOMEvent aEvent); |
void getAlignment(out boolean aMixed, out short aAlign); |
AString getBackgroundColorState(out boolean aMixed); |
nsIDOMElement getElementOrParentByTagName(in AString aTagName, in nsIDOMNode aNode); |
AString getFontColorState(out boolean aMixed); |
AString getFontFaceState(out boolean aMixed); |
AString getHeadContentsAsHTML(); |
AString getHighlightColorState(out boolean aMixed); |
void getIndentState(out boolean aCanIndent, out boolean aCanOutdent); |
void getInlineProperty(in nsIAtom aProperty, in AString aAttribute, in AString aValue, out boolean aFirst, out boolean aAny, out boolean aAll); |
AString getInlinePropertyWithAttrValue(in nsIAtom aProperty, in AString aAttribute, in AString aValue, out boolean aFirst, out boolean aAny, out boolean aAll); |
nsISupportsArray getLinkedObjects(); |
void getListItemState(out boolean aMixed, out boolean aLI, out boolean aDT, out boolean aDD); |
void getListState(out boolean aMixed, out boolean aOL, out boolean aUL, out boolean aDL); |
AString getParagraphState(out boolean aMixed); |
nsIDOMElement getSelectedElement(in AString aTagName); |
nsIDOMElement getSelectionContainer(); |
void ignoreSpuriousDragEvent(in boolean aIgnoreSpuriousDragEvent); |
void increaseFontSize(); |
void indent(in AString aIndent); |
void insertElementAtSelection(in nsIDOMElement aElement, in boolean aDeleteSelection); |
void insertFromDrop(in nsIDOMEvent aEvent); |
void insertHTML(in AString aInputString); |
void insertHTMLWithContext(in AString aInputString, in AString aContextStr, in AString aInfoStr, in AString aFlavor, in nsIDOMDocument aSourceDoc, in nsIDOMNode aDestinationNode, in long aDestinationOffset, in boolean aDeleteSelection); |
void insertLinkAroundSelection(in nsIDOMElement aAnchorElement); |
boolean isAnonymousElement(in nsIDOMElement aElement); |
void makeOrChangeList(in AString aListType, in boolean entireList, in AString aBulletType); |
boolean nodeIsBlock(in nsIDOMNode node); |
void pasteNoFormatting(in long aSelectionType); |
void rebuildDocumentFromSource(in AString aSourceString); |
void removeAllDefaultProperties(); |
void removeAllInlineProperties(); |
void removeDefaultProperty(in nsIAtom aProperty, in AString aAttribute, in AString aValue); |
void removeInlineProperty(in nsIAtom aProperty, in AString aAttribute); |
void removeInsertionListener(in nsIContentFilter inFilter); |
void removeList(in AString aListType); |
void replaceHeadContentsWithHTML(in AString aSourceToInsert); |
void selectElement(in nsIDOMElement aElement); |
void setBackgroundColor(in AString aColor); |
void setBodyAttribute(in AString aAttr, in AString aValue); |
void setCaretAfterElement(in nsIDOMElement aElement); |
void setCSSInlineProperty(in nsIAtom aProperty, in AString aAttribute, in AString aValue); |
void setDocumentTitle(in AString aTitle); |
void setInlineProperty(in nsIAtom aProperty, in AString aAttribute, in AString aValue); |
void setParagraphFormat(in AString aParagraphFormat); |
void updateBaseURL(); |
Attribute | Type | Description |
isCSSEnabled |
boolean |
A boolean which is true is the HTMLEditor has been instantiated with CSS knowledge and if the CSS pref is currently checked. |
returnInParagraphCreatesNewParagraph |
boolean |
A boolean indicating if a return key pressed in a paragraph creates another paragraph or just inserts a <br> at the caret. |
Constant | Value | Description |
eLeft |
0 |
|
eCenter |
1 |
|
eRight |
2 |
|
eJustify |
3 |
R
egisters a default style property with the editor.
void addDefaultProperty( in nsIAtom aProperty, in AString aAttribute, in AString aValue );
aProperty
aAttribute
null
. Example: aProperty
="font", aAttribute
="color"aValue
aAttribute
is not null
, the value of the attribute. Example: aProperty
="font", aAttribute
="color", aValue
="0x00FFFF"Add listener for insertion override.
void addInsertionListener( in nsIContentFilter inFilter );
inFilter
Document me!
void align( in AString aAlign );
aAlign
Checks whether a BR node is visible to the user.
boolean breakIsVisible( in nsIDOMNode aNode );
aNode
Decides if a drag should be started (for example, based on the current selection and mousepoint).
boolean canDrag( in nsIDOMEvent aEvent );
aEvent
Checks if the anonymous nodes created by the HTML editor have to be refreshed or hidden depending on a possible new state of the selection.
void checkSelectionStateForAnonymousButtons( in nsISelection aSelection );
aSelection
Returns an anonymous nsDOMElement of type aTag
, child of aParentNode
. If aIsCreatedHidden is true
, the class "hidden" is added to the created element. If aAnonClass
is not the empty string, it becomes the value of the attribute "_moz_anonclass"
nsIDOMElement createAnonymousElement( in AString aTag, in nsIDOMNode aParentNode, in AString aAnonClass, in boolean aIsCreatedHidden );
aTag
aParentNode
aAnonClass
aIsCreatedHidden
A DOM Element.
Return a new element with default attribute values.
This does not rely on the selection, and is not sensitive to context.
Used primarily to supply new element for various insert element dialogs (Image, Link, Table, and HorizontalRule are the only returned elements as of 9/12/18); NamedAnchor was removed in Firefox 63.
nsIDOMElement createElementWithDefaults( in AString aTagName );
aTagName
The new element created.
Decrease font size for text in selection by 1 HTML unit All existing text is scanned for existing <FONT SIZE> attributes so they will be decreased instead of inserting new <FONT> tag.
void decreaseFontSize();
None.
Transfers the relevant data (as appropriate) to a transferable so it can later be dropped.
void doDrag( in nsIDOMEvent aEvent );
aEvent
Returns what alignment is in the selection.
void getAlignment( out boolean aMixed, out short aAlign );
aMixed
true
if there is more than one type of list item, or if there is some list and non-list.aAlign
getFontColorState()
returns what font face is in the selection.
AString getBackgroundColorState( out boolean aMixed );
aMixed
true
if there is more than one font color.Color string. "" is returned for none.
Return the input node or a parent matching the given aTagName
, starting the search at the supplied node. An example of use is for testing if a node is in a table cell given a selection anchor node.
nsIDOMElement getElementOrParentByTagName( in AString aTagName, in nsIDOMNode aNode );
aTagName
aNode
null
, the anchor node of the current selection is used.NS_EDITOR_ELEMENT_NOT_FOUND if an element is not found (passes NS_SUCCEEDED macro)
Returns what font face is in the selection.
AString getFontColorState( out boolean aMixed );
aMixed
true
if there is more than one font color.Color string. "" is returned for none.
Returns what font face is in the selection.
AString getFontFaceState( out boolean aMixed );
aMixed
true
if there is more than one font face.Name of face. Note: "tt" is returned for tt tag. "" is returned for none.
Output the contents of the <HEAD> section as text/HTML format.
AString getHeadContentsAsHTML();
None.
Returns what the highlight color of the selection.
AString getHighlightColorState( out boolean aMixed );
aMixed
true
if there is more than one font color.Color string. "" is returned for none.
Document me!
void getIndentState( out boolean aCanIndent, out boolean aCanOutdent );
aCanIndent
aCanOutdent
Gets aggregate properties of the current selection. All object in the current selection are scanned and their attributes are represented in a list of Property object.
void getInlineProperty( in nsIAtom aProperty, in AString aAttribute, in AString aValue, out boolean aFirst, out boolean aAny, out boolean aAll );
aProperty
aAttribute
null
. Example: aProperty
="font", aAttribute
="color"aValue
null
, the value of the attribute. May be null
. Example: aProperty
="font", aAttribute
="color", aValue
="0x00FFFF"aFirst
aAny
aAll
AString getInlinePropertyWithAttrValue( in nsIAtom aProperty, in AString aAttribute, in AString aValue, out boolean aFirst, out boolean aAny, out boolean aAll );
aProperty
aAttribute
aValue
aFirst
aAny
aAll
Find all the nodes in the document which contain references to outside URIs (for example a href, img src, script src, and so on.) The objects in the array will be type nsIURIRefObject
.
nsISupportsArray getLinkedObjects();
None.
ANodeList the linked nodes found.
getListItemState
returns what list item type is in the selection.
void getListItemState( out boolean aMixed, out boolean aLI, out boolean aDT, out boolean aDD );
aMixed
true
if there is more than one type of list item, or if there is some list and non-list.aLI
true
if "li" list items are selected.aDT
true
if "dt" list items are selected.aDD
true
if "dd" list items are selected.Returns what list type is in the selection.
void getListState( out boolean aMixed, out boolean aOL, out boolean aUL, out boolean aDL );
aMixed
true
if there is more than one type of list, or if there is some list and non-list.aOL
true
if an "ol" list is selected.aUL
true
if an "ul" list is selected.aDL
true
if a "dl" list is selected.Returns what block tag paragraph format is in the selection.
AString getParagraphState( out boolean aMixed );
aMixed
true
if there is more than one format.Name of block tag. "" is returned for none.
Return an element only if it is the only node selected, such as an image, horizontal rule, and so on. The exception is a link, which is more like a text attribute: The Anchor tag is returned if the selection is within the textnode(s) that are children of the "A" node. This could be a collapsed selection, that is, a caret within the link text.
nsIDOMElement getSelectedElement( in AString aTagName );
aTagName
NS_EDITOR_ELEMENT_NOT_FOUND if an element is not found (passes NS_SUCCEEDED macro)
Returns the deepest container of the selection.
nsIDOMElement getSelectionContainer();
None.
A DOM Element.
Used to suppress spurious drag/drop events to workaround bug 50703. Do not use this method! It will go away after first release!
void ignoreSpuriousDragEvent( in boolean aIgnoreSpuriousDragEvent );
aIgnoreSpuriousDragEvent
Increase font size for text in selection by 1 HTML unit All existing text is scanned for existing <FONT SIZE> attributes so they will be incremented instead of inserting new <FONT> tag.
void increaseFontSize();
None.
Document me!
void indent( in AString aIndent );
aIndent
Insert an element, which may have child nodes, at the selection Used primarily to insert a new element for various insert element dialogs, but it enforces the HTML 4.0 DTD "CanContain" rules, so it should be useful for other elements.
void insertElementAtSelection( in nsIDOMElement aElement, in boolean aDeleteSelection );
aElement
aDeleteSelection
Looks for a dragsession and inserts the relevant data in response to a drop.
void insertFromDrop( in nsIDOMEvent aEvent );
aEvent
Insert some HTML source at the current location.
void insertHTML( in AString aInputString );
aInputString
Insert some HTML source, interpreting the string argument according to the given context.
void insertHTMLWithContext( in AString aInputString, in AString aContextStr, in AString aInfoStr, in AString aFlavor, in nsIDOMDocument aSourceDoc, in nsIDOMNode aDestinationNode, in long aDestinationOffset, in boolean aDeleteSelection );
aInputString
aContextStr
aInfoStr
aFlavor
aSourceDoc
null
)aDestinationNode
aDestinationOffset
aDeleteSelection
Insert an link element as the parent of the current selection.
void insertLinkAroundSelection( in nsIDOMElement aAnchorElement );
aAnchorElement
boolean isAnonymousElement( in nsIDOMElement aElement );
aElement
void makeOrChangeList( in AString aListType, in boolean entireList, in AString aBulletType );
aListType
entireList
aBulletType
Tests if a node is a BLOCK element according the the HTML 4.0 DTD. This does NOT consider CSS effect on display type.
boolean nodeIsBlock( in nsIDOMNode node );
node
Paste the text in the OS clipboard at the cursor position, replacing the selected text (if any), but strip out any HTML styles and formatting.
void pasteNoFormatting( in long aSelectionType );
aSelectionType
Rebuild the entire document from source HTML Needed to be able to edit HEAD and other outside-of-BODY content.
void rebuildDocumentFromSource( in AString aSourceString );
aSourceString
Unregisters all default style properties with the editor.
void removeAllDefaultProperties();
None.
Deletes all the inline properties from all text in the current selection.
void removeAllInlineProperties();
None.
Unregisters a default style property with the editor.
void removeDefaultProperty( in nsIAtom aProperty, in AString aAttribute, in AString aValue );
aProperty
aAttribute
null
. Example: aProperty
="font", aAttribute
="color"aValue
aAttribute
is not null
, the value of the attribute. Example: aProperty
="font", aAttribute
="color", aValue
="0x00FFFF"Deletes the properties from all text in the current selection. If aProperty
is not set on the selection, nothing is done.
void removeInlineProperty( in nsIAtom aProperty, in AString aAttribute );
aProperty
nsIEditorProperty.font()
) except when you want to remove just links and not named anchors. For that, use nsIEditorProperty.href()
.aAttribute
null
. Example: aProperty
=nsIEditorProptery.font()
, aAttribute
="color" nsIEditProperty.allAttributes()
is special. It indicates that all content-based text properties are to be removed from the selection.Remove listener for insertion override.
void removeInsertionListener( in nsIContentFilter inFilter );
inFilter
Document me!
void removeList( in AString aListType );
aListType
Replace all children of <HEAD> with string of HTML source.
void replaceHeadContentsWithHTML( in AString aSourceToInsert );
aSourceToInsert
Set the selection at the suppled element.
void selectElement( in nsIDOMElement aElement );
aElement
Set the value of the "bgcolor" attribute on the document's <body> element.
void setBackgroundColor( in AString aColor );
aColor
Set an attribute on the document's <body> element such as text, link, background colors.
void setBodyAttribute( in AString aAttr, in AString aValue );
aAttr
aValue
Create a collapsed selection just after aElement.
The selection is set to parent-of-aElement with an offset 1 greater than aElement's offset but it enforces the HTML 4.0 DTD "CanContain" rules, so it should be useful for other elements.
void setCaretAfterElement( in nsIDOMElement aElement );
aElement
SetInlineProperty()
sets the aggregate properties on the current selection.
void setCSSInlineProperty( in nsIAtom aProperty, in AString aAttribute, in AString aValue );
aProperty
aAttribute
null
. Example: aProperty
="font", aAttribute
="color"aValue
aAttribute
is not null
, the value of the attribute. May be null
. Example: aProperty
="font", aAttribute
="color", aValue
="0x00FFFF"Set the documents title.
void setDocumentTitle( in AString aTitle );
aTitle
void setInlineProperty( in nsIAtom aProperty, in AString aAttribute, in AString aValue );
aProperty
aAttribute
aValue
Insert a block paragraph tag around selection.
void setParagraphFormat( in AString aParagraphFormat );
aParagraphFormat
Set the BaseURL for the document to the current URL but only if the page doesn't have a <base> tag This should be done after the document URL has changed, such as after saving a file This is used as base for relativizing link and image urls.
void updateBaseURL();
None.