PageRenderTime 29ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/mozilla/mozilla/dist/include/editor/nsIHTMLEditor.h

http://kmbrasil.codeplex.com
C++ Header | 1174 lines | 517 code | 144 blank | 513 comment | 0 complexity | 7c73436cabccd92495c5199b1ba09da7 MD5 | raw file
Possible License(s): MPL-2.0-no-copyleft-exception, GPL-2.0

Large files files are truncated, but you can click here to view the full file

  1. /*
  2. * DO NOT EDIT. THIS FILE IS GENERATED FROM h:/projects/mozilla/mozilla/editor/idl/nsIHTMLEditor.idl
  3. */
  4. #ifndef __gen_nsIHTMLEditor_h__
  5. #define __gen_nsIHTMLEditor_h__
  6. #ifndef __gen_nsISupports_h__
  7. #include "nsISupports.h"
  8. #endif
  9. #ifndef __gen_domstubs_h__
  10. #include "domstubs.h"
  11. #endif
  12. /* For IDL files that don't want to include root IDL files. */
  13. #ifndef NS_NO_VTABLE
  14. #define NS_NO_VTABLE
  15. #endif
  16. class nsIAtom; /* forward declaration */
  17. class nsISupportsArray; /* forward declaration */
  18. class nsISelection; /* forward declaration */
  19. class nsIContentFilter; /* forward declaration */
  20. #define NS_EDITOR_ELEMENT_NOT_FOUND \
  21. NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_EDITOR, 1)
  22. /* starting interface: nsIHTMLEditor */
  23. #define NS_IHTMLEDITOR_IID_STR "afc36593-5787-4420-93d9-b2c0ccbf0cad"
  24. #define NS_IHTMLEDITOR_IID \
  25. {0xafc36593, 0x5787, 0x4420, \
  26. { 0x93, 0xd9, 0xb2, 0xc0, 0xcc, 0xbf, 0x0c, 0xad }}
  27. class nsIHTMLEditor : public nsISupports {
  28. public:
  29. NS_DEFINE_STATIC_IID_ACCESSOR(NS_IHTMLEDITOR_IID)
  30. typedef short EAlignment;
  31. enum { eLeft = 0 };
  32. enum { eCenter = 1 };
  33. enum { eRight = 2 };
  34. enum { eJustify = 3 };
  35. /**
  36. * AddDefaultProperty() registers a default style property with the editor
  37. *
  38. * @param aProperty the property to set by default
  39. * @param aAttribute the attribute of the property, if applicable.
  40. * May be null.
  41. * Example: aProperty="font", aAttribute="color"
  42. * @param aValue if aAttribute is not null, the value of the attribute.
  43. * Example: aProperty="font", aAttribute="color",
  44. * aValue="0x00FFFF"
  45. */
  46. /* void addDefaultProperty (in nsIAtom aProperty, in AString aAttribute, in AString aValue); */
  47. NS_IMETHOD AddDefaultProperty(nsIAtom *aProperty, const nsAString & aAttribute, const nsAString & aValue) = 0;
  48. /**
  49. * RemoveDefaultProperty() unregisters a default style property with the editor
  50. *
  51. * @param aProperty the property to remove from defaults
  52. * @param aAttribute the attribute of the property, if applicable.
  53. * May be null.
  54. * Example: aProperty="font", aAttribute="color"
  55. * @param aValue if aAttribute is not null, the value of the attribute.
  56. * Example: aProperty="font", aAttribute="color",
  57. * aValue="0x00FFFF"
  58. */
  59. /* void removeDefaultProperty (in nsIAtom aProperty, in AString aAttribute, in AString aValue); */
  60. NS_IMETHOD RemoveDefaultProperty(nsIAtom *aProperty, const nsAString & aAttribute, const nsAString & aValue) = 0;
  61. /**
  62. * RemoveAllDefaultProperties() unregisters all default style properties with the editor
  63. *
  64. */
  65. /* void removeAllDefaultProperties (); */
  66. NS_IMETHOD RemoveAllDefaultProperties(void) = 0;
  67. /**
  68. * SetInlineProperty() sets the aggregate properties on the current selection
  69. *
  70. * @param aProperty the property to set on the selection
  71. * @param aAttribute the attribute of the property, if applicable.
  72. * May be null.
  73. * Example: aProperty="font", aAttribute="color"
  74. * @param aValue if aAttribute is not null, the value of the attribute.
  75. * May be null.
  76. * Example: aProperty="font", aAttribute="color",
  77. * aValue="0x00FFFF"
  78. */
  79. /* void setCSSInlineProperty (in nsIAtom aProperty, in AString aAttribute, in AString aValue); */
  80. NS_IMETHOD SetCSSInlineProperty(nsIAtom *aProperty, const nsAString & aAttribute, const nsAString & aValue) = 0;
  81. /* void setInlineProperty (in nsIAtom aProperty, in AString aAttribute, in AString aValue); */
  82. NS_IMETHOD SetInlineProperty(nsIAtom *aProperty, const nsAString & aAttribute, const nsAString & aValue) = 0;
  83. /**
  84. * getInlineProperty() gets aggregate properties of the current selection.
  85. * All object in the current selection are scanned and their attributes are
  86. * represented in a list of Property object.
  87. *
  88. * @param aProperty the property to get on the selection
  89. * @param aAttribute the attribute of the property, if applicable.
  90. * May be null.
  91. * Example: aProperty="font", aAttribute="color"
  92. * @param aValue if aAttribute is not null, the value of the attribute.
  93. * May be null.
  94. * Example: aProperty="font", aAttribute="color",
  95. * aValue="0x00FFFF"
  96. * @param aFirst [OUT] PR_TRUE if the first text node in the
  97. * selection has the property
  98. * @param aAny [OUT] PR_TRUE if any of the text nodes in the
  99. * selection have the property
  100. * @param aAll [OUT] PR_TRUE if all of the text nodes in the
  101. * selection have the property
  102. */
  103. /* void getInlineProperty (in nsIAtom aProperty, in AString aAttribute, in AString aValue, out boolean aFirst, out boolean aAny, out boolean aAll); */
  104. NS_IMETHOD GetInlineProperty(nsIAtom *aProperty, const nsAString & aAttribute, const nsAString & aValue, PRBool *aFirst, PRBool *aAny, PRBool *aAll) = 0;
  105. /* AString getInlinePropertyWithAttrValue (in nsIAtom aProperty, in AString aAttribute, in AString aValue, out boolean aFirst, out boolean aAny, out boolean aAll); */
  106. NS_IMETHOD GetInlinePropertyWithAttrValue(nsIAtom *aProperty, const nsAString & aAttribute, const nsAString & aValue, PRBool *aFirst, PRBool *aAny, PRBool *aAll, nsAString & _retval) = 0;
  107. /**
  108. * removeAllInlineProperties() deletes all the inline properties from all
  109. * text in the current selection.
  110. */
  111. /* void removeAllInlineProperties (); */
  112. NS_IMETHOD RemoveAllInlineProperties(void) = 0;
  113. /**
  114. * removeInlineProperty() deletes the properties from all text in the current
  115. * selection. If aProperty is not set on the selection, nothing is done.
  116. *
  117. * @param aProperty the property to remove from the selection
  118. * All atoms are for normal HTML tags (e.g.:
  119. * nsIEditorProperty::font) except when you want to
  120. * remove just links and not named anchors.
  121. * For that, use nsIEditorProperty::href
  122. * @param aAttribute the attribute of the property, if applicable.
  123. * May be null.
  124. * Example: aProperty=nsIEditorProptery::font,
  125. * aAttribute="color"
  126. * nsIEditProperty::allAttributes is special.
  127. * It indicates that all content-based text properties
  128. * are to be removed from the selection.
  129. */
  130. /* void removeInlineProperty (in nsIAtom aProperty, in AString aAttribute); */
  131. NS_IMETHOD RemoveInlineProperty(nsIAtom *aProperty, const nsAString & aAttribute) = 0;
  132. /**
  133. * Increase font size for text in selection by 1 HTML unit
  134. * All existing text is scanned for existing <FONT SIZE> attributes
  135. * so they will be incremented instead of inserting new <FONT> tag
  136. */
  137. /* void increaseFontSize (); */
  138. NS_IMETHOD IncreaseFontSize(void) = 0;
  139. /**
  140. * Decrease font size for text in selection by 1 HTML unit
  141. * All existing text is scanned for existing <FONT SIZE> attributes
  142. * so they will be decreased instead of inserting new <FONT> tag
  143. */
  144. /* void decreaseFontSize (); */
  145. NS_IMETHOD DecreaseFontSize(void) = 0;
  146. /**
  147. * canDrag decides if a drag should be started
  148. * (for example, based on the current selection and mousepoint).
  149. */
  150. /* boolean canDrag (in nsIDOMEvent aEvent); */
  151. NS_IMETHOD CanDrag(nsIDOMEvent *aEvent, PRBool *_retval) = 0;
  152. /**
  153. * doDrag transfers the relevant data (as appropriate)
  154. * to a transferable so it can later be dropped.
  155. */
  156. /* void doDrag (in nsIDOMEvent aEvent); */
  157. NS_IMETHOD DoDrag(nsIDOMEvent *aEvent) = 0;
  158. /**
  159. * insertFromDrop looks for a dragsession and inserts the
  160. * relevant data in response to a drop.
  161. */
  162. /* void insertFromDrop (in nsIDOMEvent aEvent); */
  163. NS_IMETHOD InsertFromDrop(nsIDOMEvent *aEvent) = 0;
  164. /**
  165. * Tests if a node is a BLOCK element according the the HTML 4.0 DTD.
  166. * This does NOT consider CSS effect on display type
  167. *
  168. * @param aNode the node to test
  169. */
  170. /* boolean nodeIsBlock (in nsIDOMNode node); */
  171. NS_IMETHOD NodeIsBlock(nsIDOMNode *node, PRBool *_retval) = 0;
  172. /**
  173. * Insert some HTML source at the current location
  174. *
  175. * @param aInputString the string to be inserted
  176. */
  177. /* void insertHTML (in AString aInputString); */
  178. NS_IMETHOD InsertHTML(const nsAString & aInputString) = 0;
  179. /**
  180. * Paste the text in the OS clipboard at the cursor position, replacing
  181. * the selected text (if any), but strip out any HTML styles and formatting
  182. */
  183. /* void pasteNoFormatting (in long aSelectionType); */
  184. NS_IMETHOD PasteNoFormatting(PRInt32 aSelectionType) = 0;
  185. /**
  186. * Rebuild the entire document from source HTML
  187. * Needed to be able to edit HEAD and other outside-of-BODY content
  188. *
  189. * @param aSourceString HTML source string of the entire new document
  190. */
  191. /* void rebuildDocumentFromSource (in AString aSourceString); */
  192. NS_IMETHOD RebuildDocumentFromSource(const nsAString & aSourceString) = 0;
  193. /**
  194. * Insert some HTML source, interpreting
  195. * the string argument according to the given context.
  196. *
  197. * @param aInputString the string to be inserted
  198. * @param aContextStr Context of insertion
  199. * @param aInfoStr Related info to aInputString
  200. * @param aFlavor Transferable flavor, can be ""
  201. * @param aSourceDoc document where input was dragged from (may be null)
  202. * @param aDestinationNode location for insertion (such as when dropped)
  203. * @param aDestinationOffset used with aDestNode to determine insert location
  204. * @param aDeleteSelection used with aDestNode during drag&drop
  205. * @param aCollapseSelection used with aDestNode during drag&drop
  206. */
  207. /* 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); */
  208. NS_IMETHOD InsertHTMLWithContext(const nsAString & aInputString, const nsAString & aContextStr, const nsAString & aInfoStr, const nsAString & aFlavor, nsIDOMDocument *aSourceDoc, nsIDOMNode *aDestinationNode, PRInt32 aDestinationOffset, PRBool aDeleteSelection) = 0;
  209. /**
  210. * Insert an element, which may have child nodes, at the selection
  211. * Used primarily to insert a new element for various insert element dialogs,
  212. * but it enforces the HTML 4.0 DTD "CanContain" rules, so it should
  213. * be useful for other elements.
  214. *
  215. * @param aElement The element to insert
  216. * @param aDeleteSelection Delete the selection before inserting
  217. * If aDeleteSelection is PR_FALSE, then the element is inserted
  218. * after the end of the selection for all element except
  219. * Named Anchors, which insert before the selection
  220. */
  221. /* void insertElementAtSelection (in nsIDOMElement aElement, in boolean aDeleteSelection); */
  222. NS_IMETHOD InsertElementAtSelection(nsIDOMElement *aElement, PRBool aDeleteSelection) = 0;
  223. /**
  224. * Set the documents title.
  225. */
  226. /* void setDocumentTitle (in AString aTitle); */
  227. NS_IMETHOD SetDocumentTitle(const nsAString & aTitle) = 0;
  228. /**
  229. * Set the BaseURL for the document to the current URL
  230. * but only if the page doesn't have a <base> tag
  231. * This should be done after the document URL has changed,
  232. * such as after saving a file
  233. * This is used as base for relativizing link and image urls
  234. */
  235. /* void updateBaseURL (); */
  236. NS_IMETHOD UpdateBaseURL(void) = 0;
  237. /**
  238. * Set the selection at the suppled element
  239. *
  240. * @param aElement An element in the document
  241. */
  242. /* void selectElement (in nsIDOMElement aElement); */
  243. NS_IMETHOD SelectElement(nsIDOMElement *aElement) = 0;
  244. /**
  245. * Create a collapsed selection just after aElement
  246. *
  247. * XXX could we parameterize SelectElement(before/select/after>?
  248. *
  249. * The selection is set to parent-of-aElement with an
  250. * offset 1 greater than aElement's offset
  251. * but it enforces the HTML 4.0 DTD "CanContain" rules, so it should
  252. * be useful for other elements.
  253. *
  254. * @param aElement An element in the document
  255. */
  256. /* void setCaretAfterElement (in nsIDOMElement aElement); */
  257. NS_IMETHOD SetCaretAfterElement(nsIDOMElement *aElement) = 0;
  258. /**
  259. * SetParagraphFormat Insert a block paragraph tag around selection
  260. * @param aParagraphFormat "p", "h1" to "h6", "address", "pre", or "blockquote"
  261. */
  262. /* void setParagraphFormat (in AString aParagraphFormat); */
  263. NS_IMETHOD SetParagraphFormat(const nsAString & aParagraphFormat) = 0;
  264. /**
  265. * getParagraphState returns what block tag paragraph format is in
  266. * the selection.
  267. * @param aMixed True if there is more than one format
  268. * @return Name of block tag. "" is returned for none.
  269. */
  270. /* AString getParagraphState (out boolean aMixed); */
  271. NS_IMETHOD GetParagraphState(PRBool *aMixed, nsAString & _retval) = 0;
  272. /**
  273. * getFontFaceState returns what font face is in the selection.
  274. * @param aMixed True if there is more than one font face
  275. * @return Name of face. Note: "tt" is returned for
  276. * tt tag. "" is returned for none.
  277. */
  278. /* AString getFontFaceState (out boolean aMixed); */
  279. NS_IMETHOD GetFontFaceState(PRBool *aMixed, nsAString & _retval) = 0;
  280. /**
  281. * getFontColorState returns what font face is in the selection.
  282. * @param aMixed True if there is more than one font color
  283. * @return Color string. "" is returned for none.
  284. */
  285. /* AString getFontColorState (out boolean aMixed); */
  286. NS_IMETHOD GetFontColorState(PRBool *aMixed, nsAString & _retval) = 0;
  287. /**
  288. * getFontColorState returns what font face is in the selection.
  289. * @param aMixed True if there is more than one font color
  290. * @return Color string. "" is returned for none.
  291. */
  292. /* AString getBackgroundColorState (out boolean aMixed); */
  293. NS_IMETHOD GetBackgroundColorState(PRBool *aMixed, nsAString & _retval) = 0;
  294. /**
  295. * getHighlightColorState returns what the highlight color of the selection.
  296. * @param aMixed True if there is more than one font color
  297. * @return Color string. "" is returned for none.
  298. */
  299. /* AString getHighlightColorState (out boolean aMixed); */
  300. NS_IMETHOD GetHighlightColorState(PRBool *aMixed, nsAString & _retval) = 0;
  301. /**
  302. * getListState returns what list type is in the selection.
  303. * @param aMixed True if there is more than one type of list, or
  304. * if there is some list and non-list
  305. * @param aOL The company that employs me. No, really, it's
  306. * true if an "ol" list is selected.
  307. * @param aUL true if an "ul" list is selected.
  308. * @param aDL true if a "dl" list is selected.
  309. */
  310. /* void getListState (out boolean aMixed, out boolean aOL, out boolean aUL, out boolean aDL); */
  311. NS_IMETHOD GetListState(PRBool *aMixed, PRBool *aOL, PRBool *aUL, PRBool *aDL) = 0;
  312. /**
  313. * getListItemState returns what list item type is in the selection.
  314. * @param aMixed True if there is more than one type of list item, or
  315. * if there is some list and non-list
  316. * @param aLI true if "li" list items are selected.
  317. * @param aDT true if "dt" list items are selected.
  318. * @param aDD true if "dd" list items are selected.
  319. */
  320. /* void getListItemState (out boolean aMixed, out boolean aLI, out boolean aDT, out boolean aDD); */
  321. NS_IMETHOD GetListItemState(PRBool *aMixed, PRBool *aLI, PRBool *aDT, PRBool *aDD) = 0;
  322. /**
  323. * getAlignment returns what alignment is in the selection.
  324. * @param aMixed True if there is more than one type of list item, or
  325. * if there is some list and non-list
  326. * @param aAlign enum value for first encountered alignment
  327. * (left/center/right)
  328. */
  329. /* void getAlignment (out boolean aMixed, out short aAlign); */
  330. NS_IMETHOD GetAlignment(PRBool *aMixed, PRInt16 *aAlign) = 0;
  331. /**
  332. * Document me!
  333. *
  334. */
  335. /* void getIndentState (out boolean aCanIndent, out boolean aCanOutdent); */
  336. NS_IMETHOD GetIndentState(PRBool *aCanIndent, PRBool *aCanOutdent) = 0;
  337. /**
  338. * Document me!
  339. *
  340. */
  341. /* void makeOrChangeList (in AString aListType, in boolean entireList, in AString aBulletType); */
  342. NS_IMETHOD MakeOrChangeList(const nsAString & aListType, PRBool entireList, const nsAString & aBulletType) = 0;
  343. /**
  344. * Document me!
  345. *
  346. */
  347. /* void removeList (in AString aListType); */
  348. NS_IMETHOD RemoveList(const nsAString & aListType) = 0;
  349. /**
  350. * Document me!
  351. *
  352. */
  353. /* void indent (in AString aIndent); */
  354. NS_IMETHOD Indent(const nsAString & aIndent) = 0;
  355. /**
  356. * Document me!
  357. *
  358. */
  359. /* void align (in AString aAlign); */
  360. NS_IMETHOD Align(const nsAString & aAlign) = 0;
  361. /**
  362. * Return the input node or a parent matching the given aTagName,
  363. * starting the search at the supplied node.
  364. * An example of use is for testing if a node is in a table cell
  365. * given a selection anchor node.
  366. *
  367. * @param aTagName The HTML tagname
  368. * Special input values:
  369. * Use "href" to get a link node
  370. * (an "A" tag with the "href" attribute set)
  371. * Use "anchor" or "namedanchor" to get a named anchor node
  372. * (an "A" tag with the "name" attribute set)
  373. * Use "list" to get an OL, UL, or DL list node
  374. * Use "td" to get either a TD or TH cell node
  375. *
  376. * @param aNode The node in the document to start the search.
  377. * If it is null, the anchor node of the current selection is used.
  378. * @return NS_EDITOR_ELEMENT_NOT_FOUND if an element is not found
  379. * (passes NS_SUCCEEDED macro)
  380. */
  381. /* nsIDOMElement getElementOrParentByTagName (in AString aTagName, in nsIDOMNode aNode); */
  382. NS_IMETHOD GetElementOrParentByTagName(const nsAString & aTagName, nsIDOMNode *aNode, nsIDOMElement **_retval) = 0;
  383. /**
  384. * Return an element only if it is the only node selected,
  385. * such as an image, horizontal rule, etc.
  386. * The exception is a link, which is more like a text attribute:
  387. * The Anchor tag is returned if the selection is within the textnode(s)
  388. * that are children of the "A" node.
  389. * This could be a collapsed selection, i.e., a caret
  390. * within the link text.
  391. *
  392. * @param aTagName The HTML tagname or and empty string
  393. * to get any element (but only if it is the only element selected)
  394. * Special input values for Links and Named anchors:
  395. * Use "href" to get a link node
  396. * (an "A" tag with the "href" attribute set)
  397. * Use "anchor" or "namedanchor" to get a named anchor node
  398. * (an "A" tag with the "name" attribute set)
  399. * @return NS_EDITOR_ELEMENT_NOT_FOUND if an element is not found
  400. * (passes NS_SUCCEEDED macro)
  401. */
  402. /* nsIDOMElement getSelectedElement (in AString aTagName); */
  403. NS_IMETHOD GetSelectedElement(const nsAString & aTagName, nsIDOMElement **_retval) = 0;
  404. /**
  405. * Output the contents of the <HEAD> section as text/HTML format
  406. */
  407. /* AString getHeadContentsAsHTML (); */
  408. NS_IMETHOD GetHeadContentsAsHTML(nsAString & _retval) = 0;
  409. /**
  410. * Replace all children of <HEAD> with string of HTML source
  411. */
  412. /* void replaceHeadContentsWithHTML (in AString aSourceToInsert); */
  413. NS_IMETHOD ReplaceHeadContentsWithHTML(const nsAString & aSourceToInsert) = 0;
  414. /**
  415. * Return a new element with default attribute values
  416. *
  417. * This does not rely on the selection, and is not sensitive to context.
  418. *
  419. * Used primarily to supply new element for various insert element dialogs
  420. * (Image, Link, NamedAnchor, Table, and HorizontalRule
  421. * are the only returned elements as of 7/25/99)
  422. *
  423. * @param aTagName The HTML tagname
  424. * Special input values for Links and Named anchors:
  425. * Use "href" to get a link node
  426. * (an "A" tag with the "href" attribute set)
  427. * Use "anchor" or "namedanchor" to get a named anchor node
  428. * (an "A" tag with the "name" attribute set)
  429. * @return The new element created.
  430. */
  431. /* nsIDOMElement createElementWithDefaults (in AString aTagName); */
  432. NS_IMETHOD CreateElementWithDefaults(const nsAString & aTagName, nsIDOMElement **_retval) = 0;
  433. /**
  434. * Insert an link element as the parent of the current selection
  435. *
  436. * @param aElement An "A" element with a non-empty "href" attribute
  437. */
  438. /* void insertLinkAroundSelection (in nsIDOMElement aAnchorElement); */
  439. NS_IMETHOD InsertLinkAroundSelection(nsIDOMElement *aAnchorElement) = 0;
  440. /**
  441. * Set the value of the "bgcolor" attribute on the document's <body> element
  442. *
  443. * @param aColor The HTML color string, such as "#ffccff" or "yellow"
  444. */
  445. /* void setBackgroundColor (in AString aColor); */
  446. NS_IMETHOD SetBackgroundColor(const nsAString & aColor) = 0;
  447. /**
  448. * Set an attribute on the document's <body> element
  449. * such as text, link, background colors
  450. *
  451. * 8/31/00 THIS ISN'T BEING USED? SHOULD WE DROP IT?
  452. *
  453. * @param aAttr The attribute to be set
  454. * @param aValue The value of the attribute
  455. */
  456. /* void setBodyAttribute (in AString aAttr, in AString aValue); */
  457. NS_IMETHOD SetBodyAttribute(const nsAString & aAttr, const nsAString & aValue) = 0;
  458. /**
  459. * XXX Used to suppress spurious drag/drop events to workaround bug 50703
  460. * Don't use this method! It will go away after first release!
  461. */
  462. /* void ignoreSpuriousDragEvent (in boolean aIgnoreSpuriousDragEvent); */
  463. NS_IMETHOD IgnoreSpuriousDragEvent(PRBool aIgnoreSpuriousDragEvent) = 0;
  464. /**
  465. * Find all the nodes in the document which contain references
  466. * to outside URIs (e.g. a href, img src, script src, etc.)
  467. * The objects in the array will be type nsIURIRefObject.
  468. *
  469. * @return aNodeList the linked nodes found
  470. */
  471. /* nsISupportsArray getLinkedObjects (); */
  472. NS_IMETHOD GetLinkedObjects(nsISupportsArray **_retval) = 0;
  473. /**
  474. * A boolean which is true is the HTMLEditor has been instantiated
  475. * with CSS knowledge and if the CSS pref is currently checked
  476. *
  477. * @return true if CSS handled and enabled
  478. */
  479. /* attribute boolean isCSSEnabled; */
  480. NS_IMETHOD GetIsCSSEnabled(PRBool *aIsCSSEnabled) = 0;
  481. NS_IMETHOD SetIsCSSEnabled(PRBool aIsCSSEnabled) = 0;
  482. /**
  483. * Add listener for insertion override
  484. * @param inFilter function which callers want called during insertion
  485. */
  486. /* void addInsertionListener (in nsIContentFilter inFilter); */
  487. NS_IMETHOD AddInsertionListener(nsIContentFilter *inFilter) = 0;
  488. /**
  489. * Remove listener for insertion override
  490. * @param inFilter function which callers do not want called during insertion
  491. */
  492. /* void removeInsertionListener (in nsIContentFilter inFilter); */
  493. NS_IMETHOD RemoveInsertionListener(nsIContentFilter *inFilter) = 0;
  494. /**
  495. * Returns an anonymous nsDOMElement of type aTag,
  496. * child of aParentNode. If aIsCreatedHidden is true, the class
  497. * "hidden" is added to the created element. If aAnonClass is not
  498. * the empty string, it becomes the value of the attribute "_moz_anonclass"
  499. * @return a DOM Element
  500. * @param aTag [IN] a string representing the desired type of
  501. * the element to create
  502. * @param aParentNode [IN] the parent node of the created anonymous
  503. * element
  504. * @param aAnonClass [IN] contents of the _moz_anonclass attribute
  505. * @param aIsCreatedHidden [IN] a boolean specifying if the class "hidden"
  506. * is to be added to the created anonymous
  507. * element
  508. */
  509. /* nsIDOMElement createAnonymousElement (in AString aTag, in nsIDOMNode aParentNode, in AString aAnonClass, in boolean aIsCreatedHidden); */
  510. NS_IMETHOD CreateAnonymousElement(const nsAString & aTag, nsIDOMNode *aParentNode, const nsAString & aAnonClass, PRBool aIsCreatedHidden, nsIDOMElement **_retval) = 0;
  511. /**
  512. * returns the deepest container of the selection
  513. * @return a DOM Element
  514. */
  515. /* nsIDOMElement getSelectionContainer (); */
  516. NS_IMETHOD GetSelectionContainer(nsIDOMElement **_retval) = 0;
  517. /**
  518. * Checks if the anonymous nodes created by the HTML editor have to be
  519. * refreshed or hidden depending on a possible new state of the selection
  520. * @param aSelection [IN] a selection
  521. */
  522. /* void checkSelectionStateForAnonymousButtons (in nsISelection aSelection); */
  523. NS_IMETHOD CheckSelectionStateForAnonymousButtons(nsISelection *aSelection) = 0;
  524. /* boolean isAnonymousElement (in nsIDOMElement aElement); */
  525. NS_IMETHOD IsAnonymousElement(nsIDOMElement *aElement, PRBool *_retval) = 0;
  526. /**
  527. * A boolean indicating if a return key pressed in a paragraph creates
  528. * another paragraph or just inserts a <br> at the caret
  529. *
  530. * @return true if CR in a paragraph creates a new paragraph
  531. */
  532. /* attribute boolean returnInParagraphCreatesNewParagraph; */
  533. NS_IMETHOD GetReturnInParagraphCreatesNewParagraph(PRBool *aReturnInParagraphCreatesNewParagraph) = 0;
  534. NS_IMETHOD SetReturnInParagraphCreatesNewParagraph(PRBool aReturnInParagraphCreatesNewParagraph) = 0;
  535. };
  536. /* Use this macro when declaring classes that implement this interface. */
  537. #define NS_DECL_NSIHTMLEDITOR \
  538. NS_IMETHOD AddDefaultProperty(nsIAtom *aProperty, const nsAString & aAttribute, const nsAString & aValue); \
  539. NS_IMETHOD RemoveDefaultProperty(nsIAtom *aProperty, const nsAString & aAttribute, const nsAString & aValue); \
  540. NS_IMETHOD RemoveAllDefaultProperties(void); \
  541. NS_IMETHOD SetCSSInlineProperty(nsIAtom *aProperty, const nsAString & aAttribute, const nsAString & aValue); \
  542. NS_IMETHOD SetInlineProperty(nsIAtom *aProperty, const nsAString & aAttribute, const nsAString & aValue); \
  543. NS_IMETHOD GetInlineProperty(nsIAtom *aProperty, const nsAString & aAttribute, const nsAString & aValue, PRBool *aFirst, PRBool *aAny, PRBool *aAll); \
  544. NS_IMETHOD GetInlinePropertyWithAttrValue(nsIAtom *aProperty, const nsAString & aAttribute, const nsAString & aValue, PRBool *aFirst, PRBool *aAny, PRBool *aAll, nsAString & _retval); \
  545. NS_IMETHOD RemoveAllInlineProperties(void); \
  546. NS_IMETHOD RemoveInlineProperty(nsIAtom *aProperty, const nsAString & aAttribute); \
  547. NS_IMETHOD IncreaseFontSize(void); \
  548. NS_IMETHOD DecreaseFontSize(void); \
  549. NS_IMETHOD CanDrag(nsIDOMEvent *aEvent, PRBool *_retval); \
  550. NS_IMETHOD DoDrag(nsIDOMEvent *aEvent); \
  551. NS_IMETHOD InsertFromDrop(nsIDOMEvent *aEvent); \
  552. NS_IMETHOD NodeIsBlock(nsIDOMNode *node, PRBool *_retval); \
  553. NS_IMETHOD InsertHTML(const nsAString & aInputString); \
  554. NS_IMETHOD PasteNoFormatting(PRInt32 aSelectionType); \
  555. NS_IMETHOD RebuildDocumentFromSource(const nsAString & aSourceString); \
  556. NS_IMETHOD InsertHTMLWithContext(const nsAString & aInputString, const nsAString & aContextStr, const nsAString & aInfoStr, const nsAString & aFlavor, nsIDOMDocument *aSourceDoc, nsIDOMNode *aDestinationNode, PRInt32 aDestinationOffset, PRBool aDeleteSelection); \
  557. NS_IMETHOD InsertElementAtSelection(nsIDOMElement *aElement, PRBool aDeleteSelection); \
  558. NS_IMETHOD SetDocumentTitle(const nsAString & aTitle); \
  559. NS_IMETHOD UpdateBaseURL(void); \
  560. NS_IMETHOD SelectElement(nsIDOMElement *aElement); \
  561. NS_IMETHOD SetCaretAfterElement(nsIDOMElement *aElement); \
  562. NS_IMETHOD SetParagraphFormat(const nsAString & aParagraphFormat); \
  563. NS_IMETHOD GetParagraphState(PRBool *aMixed, nsAString & _retval); \
  564. NS_IMETHOD GetFontFaceState(PRBool *aMixed, nsAString & _retval); \
  565. NS_IMETHOD GetFontColorState(PRBool *aMixed, nsAString & _retval); \
  566. NS_IMETHOD GetBackgroundColorState(PRBool *aMixed, nsAString & _retval); \
  567. NS_IMETHOD GetHighlightColorState(PRBool *aMixed, nsAString & _retval); \
  568. NS_IMETHOD GetListState(PRBool *aMixed, PRBool *aOL, PRBool *aUL, PRBool *aDL); \
  569. NS_IMETHOD GetListItemState(PRBool *aMixed, PRBool *aLI, PRBool *aDT, PRBool *aDD); \
  570. NS_IMETHOD GetAlignment(PRBool *aMixed, PRInt16 *aAlign); \
  571. NS_IMETHOD GetIndentState(PRBool *aCanIndent, PRBool *aCanOutdent); \
  572. NS_IMETHOD MakeOrChangeList(const nsAString & aListType, PRBool entireList, const nsAString & aBulletType); \
  573. NS_IMETHOD RemoveList(const nsAString & aListType); \
  574. NS_IMETHOD Indent(const nsAString & aIndent); \
  575. NS_IMETHOD Align(const nsAString & aAlign); \
  576. NS_IMETHOD GetElementOrParentByTagName(const nsAString & aTagName, nsIDOMNode *aNode, nsIDOMElement **_retval); \
  577. NS_IMETHOD GetSelectedElement(const nsAString & aTagName, nsIDOMElement **_retval); \
  578. NS_IMETHOD GetHeadContentsAsHTML(nsAString & _retval); \
  579. NS_IMETHOD ReplaceHeadContentsWithHTML(const nsAString & aSourceToInsert); \
  580. NS_IMETHOD CreateElementWithDefaults(const nsAString & aTagName, nsIDOMElement **_retval); \
  581. NS_IMETHOD InsertLinkAroundSelection(nsIDOMElement *aAnchorElement); \
  582. NS_IMETHOD SetBackgroundColor(const nsAString & aColor); \
  583. NS_IMETHOD SetBodyAttribute(const nsAString & aAttr, const nsAString & aValue); \
  584. NS_IMETHOD IgnoreSpuriousDragEvent(PRBool aIgnoreSpuriousDragEvent); \
  585. NS_IMETHOD GetLinkedObjects(nsISupportsArray **_retval); \
  586. NS_IMETHOD GetIsCSSEnabled(PRBool *aIsCSSEnabled); \
  587. NS_IMETHOD SetIsCSSEnabled(PRBool aIsCSSEnabled); \
  588. NS_IMETHOD AddInsertionListener(nsIContentFilter *inFilter); \
  589. NS_IMETHOD RemoveInsertionListener(nsIContentFilter *inFilter); \
  590. NS_IMETHOD CreateAnonymousElement(const nsAString & aTag, nsIDOMNode *aParentNode, const nsAString & aAnonClass, PRBool aIsCreatedHidden, nsIDOMElement **_retval); \
  591. NS_IMETHOD GetSelectionContainer(nsIDOMElement **_retval); \
  592. NS_IMETHOD CheckSelectionStateForAnonymousButtons(nsISelection *aSelection); \
  593. NS_IMETHOD IsAnonymousElement(nsIDOMElement *aElement, PRBool *_retval); \
  594. NS_IMETHOD GetReturnInParagraphCreatesNewParagraph(PRBool *aReturnInParagraphCreatesNewParagraph); \
  595. NS_IMETHOD SetReturnInParagraphCreatesNewParagraph(PRBool aReturnInParagraphCreatesNewParagraph);
  596. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  597. #define NS_FORWARD_NSIHTMLEDITOR(_to) \
  598. NS_IMETHOD AddDefaultProperty(nsIAtom *aProperty, const nsAString & aAttribute, const nsAString & aValue) { return _to AddDefaultProperty(aProperty, aAttribute, aValue); } \
  599. NS_IMETHOD RemoveDefaultProperty(nsIAtom *aProperty, const nsAString & aAttribute, const nsAString & aValue) { return _to RemoveDefaultProperty(aProperty, aAttribute, aValue); } \
  600. NS_IMETHOD RemoveAllDefaultProperties(void) { return _to RemoveAllDefaultProperties(); } \
  601. NS_IMETHOD SetCSSInlineProperty(nsIAtom *aProperty, const nsAString & aAttribute, const nsAString & aValue) { return _to SetCSSInlineProperty(aProperty, aAttribute, aValue); } \
  602. NS_IMETHOD SetInlineProperty(nsIAtom *aProperty, const nsAString & aAttribute, const nsAString & aValue) { return _to SetInlineProperty(aProperty, aAttribute, aValue); } \
  603. NS_IMETHOD GetInlineProperty(nsIAtom *aProperty, const nsAString & aAttribute, const nsAString & aValue, PRBool *aFirst, PRBool *aAny, PRBool *aAll) { return _to GetInlineProperty(aProperty, aAttribute, aValue, aFirst, aAny, aAll); } \
  604. NS_IMETHOD GetInlinePropertyWithAttrValue(nsIAtom *aProperty, const nsAString & aAttribute, const nsAString & aValue, PRBool *aFirst, PRBool *aAny, PRBool *aAll, nsAString & _retval) { return _to GetInlinePropertyWithAttrValue(aProperty, aAttribute, aValue, aFirst, aAny, aAll, _retval); } \
  605. NS_IMETHOD RemoveAllInlineProperties(void) { return _to RemoveAllInlineProperties(); } \
  606. NS_IMETHOD RemoveInlineProperty(nsIAtom *aProperty, const nsAString & aAttribute) { return _to RemoveInlineProperty(aProperty, aAttribute); } \
  607. NS_IMETHOD IncreaseFontSize(void) { return _to IncreaseFontSize(); } \
  608. NS_IMETHOD DecreaseFontSize(void) { return _to DecreaseFontSize(); } \
  609. NS_IMETHOD CanDrag(nsIDOMEvent *aEvent, PRBool *_retval) { return _to CanDrag(aEvent, _retval); } \
  610. NS_IMETHOD DoDrag(nsIDOMEvent *aEvent) { return _to DoDrag(aEvent); } \
  611. NS_IMETHOD InsertFromDrop(nsIDOMEvent *aEvent) { return _to InsertFromDrop(aEvent); } \
  612. NS_IMETHOD NodeIsBlock(nsIDOMNode *node, PRBool *_retval) { return _to NodeIsBlock(node, _retval); } \
  613. NS_IMETHOD InsertHTML(const nsAString & aInputString) { return _to InsertHTML(aInputString); } \
  614. NS_IMETHOD PasteNoFormatting(PRInt32 aSelectionType) { return _to PasteNoFormatting(aSelectionType); } \
  615. NS_IMETHOD RebuildDocumentFromSource(const nsAString & aSourceString) { return _to RebuildDocumentFromSource(aSourceString); } \
  616. NS_IMETHOD InsertHTMLWithContext(const nsAString & aInputString, const nsAString & aContextStr, const nsAString & aInfoStr, const nsAString & aFlavor, nsIDOMDocument *aSourceDoc, nsIDOMNode *aDestinationNode, PRInt32 aDestinationOffset, PRBool aDeleteSelection) { return _to InsertHTMLWithContext(aInputString, aContextStr, aInfoStr, aFlavor, aSourceDoc, aDestinationNode, aDestinationOffset, aDeleteSelection); } \
  617. NS_IMETHOD InsertElementAtSelection(nsIDOMElement *aElement, PRBool aDeleteSelection) { return _to InsertElementAtSelection(aElement, aDeleteSelection); } \
  618. NS_IMETHOD SetDocumentTitle(const nsAString & aTitle) { return _to SetDocumentTitle(aTitle); } \
  619. NS_IMETHOD UpdateBaseURL(void) { return _to UpdateBaseURL(); } \
  620. NS_IMETHOD SelectElement(nsIDOMElement *aElement) { return _to SelectElement(aElement); } \
  621. NS_IMETHOD SetCaretAfterElement(nsIDOMElement *aElement) { return _to SetCaretAfterElement(aElement); } \
  622. NS_IMETHOD SetParagraphFormat(const nsAString & aParagraphFormat) { return _to SetParagraphFormat(aParagraphFormat); } \
  623. NS_IMETHOD GetParagraphState(PRBool *aMixed, nsAString & _retval) { return _to GetParagraphState(aMixed, _retval); } \
  624. NS_IMETHOD GetFontFaceState(PRBool *aMixed, nsAString & _retval) { return _to GetFontFaceState(aMixed, _retval); } \
  625. NS_IMETHOD GetFontColorState(PRBool *aMixed, nsAString & _retval) { return _to GetFontColorState(aMixed, _retval); } \
  626. NS_IMETHOD GetBackgroundColorState(PRBool *aMixed, nsAString & _retval) { return _to GetBackgroundColorState(aMixed, _retval); } \
  627. NS_IMETHOD GetHighlightColorState(PRBool *aMixed, nsAString & _retval) { return _to GetHighlightColorState(aMixed, _retval); } \
  628. NS_IMETHOD GetListState(PRBool *aMixed, PRBool *aOL, PRBool *aUL, PRBool *aDL) { return _to GetListState(aMixed, aOL, aUL, aDL); } \
  629. NS_IMETHOD GetListItemState(PRBool *aMixed, PRBool *aLI, PRBool *aDT, PRBool *aDD) { return _to GetListItemState(aMixed, aLI, aDT, aDD); } \
  630. NS_IMETHOD GetAlignment(PRBool *aMixed, PRInt16 *aAlign) { return _to GetAlignment(aMixed, aAlign); } \
  631. NS_IMETHOD GetIndentState(PRBool *aCanIndent, PRBool *aCanOutdent) { return _to GetIndentState(aCanIndent, aCanOutdent); } \
  632. NS_IMETHOD MakeOrChangeList(const nsAString & aListType, PRBool entireList, const nsAString & aBulletType) { return _to MakeOrChangeList(aListType, entireList, aBulletType); } \
  633. NS_IMETHOD RemoveList(const nsAString & aListType) { return _to RemoveList(aListType); } \
  634. NS_IMETHOD Indent(const nsAString & aIndent) { return _to Indent(aIndent); } \
  635. NS_IMETHOD Align(const nsAString & aAlign) { return _to Align(aAlign); } \
  636. NS_IMETHOD GetElementOrParentByTagName(const nsAString & aTagName, nsIDOMNode *aNode, nsIDOMElement **_retval) { return _to GetElementOrParentByTagName(aTagName, aNode, _retval); } \
  637. NS_IMETHOD GetSelectedElement(const nsAString & aTagName, nsIDOMElement **_retval) { return _to GetSelectedElement(aTagName, _retval); } \
  638. NS_IMETHOD GetHeadContentsAsHTML(nsAString & _retval) { return _to GetHeadContentsAsHTML(_retval); } \
  639. NS_IMETHOD ReplaceHeadContentsWithHTML(const nsAString & aSourceToInsert) { return _to ReplaceHeadContentsWithHTML(aSourceToInsert); } \
  640. NS_IMETHOD CreateElementWithDefaults(const nsAString & aTagName, nsIDOMElement **_retval) { return _to CreateElementWithDefaults(aTagName, _retval); } \
  641. NS_IMETHOD InsertLinkAroundSelection(nsIDOMElement *aAnchorElement) { return _to InsertLinkAroundSelection(aAnchorElement); } \
  642. NS_IMETHOD SetBackgroundColor(const nsAString & aColor) { return _to SetBackgroundColor(aColor); } \
  643. NS_IMETHOD SetBodyAttribute(const nsAString & aAttr, const nsAString & aValue) { return _to SetBodyAttribute(aAttr, aValue); } \
  644. NS_IMETHOD IgnoreSpuriousDragEvent(PRBool aIgnoreSpuriousDragEvent) { return _to IgnoreSpuriousDragEvent(aIgnoreSpuriousDragEvent); } \
  645. NS_IMETHOD GetLinkedObjects(nsISupportsArray **_retval) { return _to GetLinkedObjects(_retval); } \
  646. NS_IMETHOD GetIsCSSEnabled(PRBool *aIsCSSEnabled) { return _to GetIsCSSEnabled(aIsCSSEnabled); } \
  647. NS_IMETHOD SetIsCSSEnabled(PRBool aIsCSSEnabled) { return _to SetIsCSSEnabled(aIsCSSEnabled); } \
  648. NS_IMETHOD AddInsertionListener(nsIContentFilter *inFilter) { return _to AddInsertionListener(inFilter); } \
  649. NS_IMETHOD RemoveInsertionListener(nsIContentFilter *inFilter) { return _to RemoveInsertionListener(inFilter); } \
  650. NS_IMETHOD CreateAnonymousElement(const nsAString & aTag, nsIDOMNode *aParentNode, const nsAString & aAnonClass, PRBool aIsCreatedHidden, nsIDOMElement **_retval) { return _to CreateAnonymousElement(aTag, aParentNode, aAnonClass, aIsCreatedHidden, _retval); } \
  651. NS_IMETHOD GetSelectionContainer(nsIDOMElement **_retval) { return _to GetSelectionContainer(_retval); } \
  652. NS_IMETHOD CheckSelectionStateForAnonymousButtons(nsISelection *aSelection) { return _to CheckSelectionStateForAnonymousButtons(aSelection); } \
  653. NS_IMETHOD IsAnonymousElement(nsIDOMElement *aElement, PRBool *_retval) { return _to IsAnonymousElement(aElement, _retval); } \
  654. NS_IMETHOD GetReturnInParagraphCreatesNewParagraph(PRBool *aReturnInParagraphCreatesNewParagraph) { return _to GetReturnInParagraphCreatesNewParagraph(aReturnInParagraphCreatesNewParagraph); } \
  655. NS_IMETHOD SetReturnInParagraphCreatesNewParagraph(PRBool aReturnInParagraphCreatesNewParagraph) { return _to SetReturnInParagraphCreatesNewParagraph(aReturnInParagraphCreatesNewParagraph); }
  656. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  657. #define NS_FORWARD_SAFE_NSIHTMLEDITOR(_to) \
  658. NS_IMETHOD AddDefaultProperty(nsIAtom *aProperty, const nsAString & aAttribute, const nsAString & aValue) { return !_to ? NS_ERROR_NULL_POINTER : _to->AddDefaultProperty(aProperty, aAttribute, aValue); } \
  659. NS_IMETHOD RemoveDefaultProperty(nsIAtom *aProperty, const nsAString & aAttribute, const nsAString & aValue) { return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveDefaultProperty(aProperty, aAttribute, aValue); } \
  660. NS_IMETHOD RemoveAllDefaultProperties(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveAllDefaultProperties(); } \
  661. NS_IMETHOD SetCSSInlineProperty(nsIAtom *aProperty, const nsAString & aAttribute, const nsAString & aValue) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetCSSInlineProperty(aProperty, aAttribute, aValue); } \
  662. NS_IMETHOD SetInlineProperty(nsIAtom *aProperty, const nsAString & aAttribute, const nsAString & aValue) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetInlineProperty(aProperty, aAttribute, aValue); } \
  663. NS_IMETHOD GetInlineProperty(nsIAtom *aProperty, const nsAString & aAttribute, const nsAString & aValue, PRBool *aFirst, PRBool *aAny, PRBool *aAll) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetInlineProperty(aProperty, aAttribute, aValue, aFirst, aAny, aAll); } \
  664. NS_IMETHOD GetInlinePropertyWithAttrValue(nsIAtom *aProperty, const nsAString & aAttribute, const nsAString & aValue, PRBool *aFirst, PRBool *aAny, PRBool *aAll, nsAString & _retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetInlinePropertyWithAttrValue(aProperty, aAttribute, aValue, aFirst, aAny, aAll, _retval); } \
  665. NS_IMETHOD RemoveAllInlineProperties(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveAllInlineProperties(); } \
  666. NS_IMETHOD RemoveInlineProperty(nsIAtom *aProperty, const nsAString & aAttribute) { return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveInlineProperty(aProperty, aAttribute); } \
  667. NS_IMETHOD IncreaseFontSize(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->IncreaseFontSize(); } \
  668. NS_IMETHOD DecreaseFontSize(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->DecreaseFontSize(); } \
  669. NS_IMETHOD CanDrag(nsIDOMEvent *aEvent, PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->CanDrag(aEvent, _retval); } \
  670. NS_IMETHOD DoDrag(nsIDOMEvent *aEvent) { return !_to ? NS_ERROR_NULL_POINTER : _to->DoDrag(aEvent); } \
  671. NS_IMETHOD InsertFromDrop(nsIDOMEvent *aEvent) { return !_to ? NS_ERROR_NULL_POINTER : _to->InsertFromDrop(aEvent); } \
  672. NS_IMETHOD NodeIsBlock(nsIDOMNode *node, PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->NodeIsBlock(node, _retval); } \
  673. NS_IMETHOD InsertHTML(const nsAString & aInputString) { return !_to ? NS_ERROR_NULL_POINTER : _to->InsertHTML(aInputString); } \
  674. NS_IMETHOD PasteNoFormatting(PRInt32 aSelectionType) { return !_to ? NS_ERROR_NULL_POINTER : _to->PasteNoFormatting(aSelectionType); } \
  675. NS_IMETHOD RebuildDocumentFromSource(const nsAString & aSourceString) { return !_to ? NS_ERROR_NULL_POINTER : _to->RebuildDocumentFromSource(aSourceString); } \
  676. NS_IMETHOD InsertHTMLWithContext(const nsAString & aInputString, const nsAString & aContextStr, const nsAString & aInfoStr, const nsAString & aFlavor, nsIDOMDocument *aSourceDoc, nsIDOMNode *aDestinationNode, PRInt32 aDestinationOffset, PRBool aDeleteSelection) { return !_to ? NS_ERROR_NULL_POINTER : _to->InsertHTMLWithContext(aInputString, aContextStr, aInfoStr, aFlavor, aSourceDoc, aDestinationNode, aDestinationOffset, aDeleteSelection); } \
  677. NS_IMETHOD InsertElementAtSelection(nsIDOMElement *aElement, PRBool aDeleteSelection) { return !_to ? NS_ERROR_NULL_POINTER : _to->InsertElementAtSelection(aElement, aDeleteSelection); } \
  678. NS_IMETHOD SetDocumentTitle(const nsAString & aTitle) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetDocumentTitle(aTitle); } \
  679. NS_IMETHOD UpdateBaseURL(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->UpdateBaseURL(); } \
  680. NS_IMETHOD SelectElement(nsIDOMElement *aElement) { return !_to ? NS_ERROR_NULL_POINTER : _to->SelectElement(aElement); } \
  681. NS_IMETHOD SetCaretAfterElement(nsIDOMElement *aElement) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetCaretAfterElement(aElement); } \
  682. NS_IMETHOD SetParagraphFormat(const nsAString & aParagraphFormat) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetParagraphFormat(aParagraphFormat); } \
  683. NS_IMETHOD GetParagraphState(PRBool *aMixed, nsAString & _retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetParagraphState(aMixed, _retval); } \
  684. NS_IMETHOD GetFontFaceState(PRBool *aMixed, nsAString & _retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetFontFaceState(aMixed, _retval); } \
  685. NS_IMETHOD GetFontColorState(PRBool *aMixed, nsAString & _retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetFontColorState(aMixed, _retval); } \
  686. NS_IMETHOD GetBackgroundColorState(PRBool *aMixed, nsAString & _retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetBackgroundColorState(aMixed, _retval); } \
  687. NS_IMETHOD GetHighlightColorState(PRBool *aMixed, nsAString & _retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetHighlightColorState(aMixed, _retval); } \
  688. NS_IMETHOD GetListState(PRBool *aMixed, PRBool *aOL, PRBool *aUL, PRBool *aDL) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetListState(aMixed, aOL, aUL, aDL); } \
  689. NS_IMETHOD GetListItemState(PRBool *aMixed, PRBool *aLI, PRBool *aDT, PRBool *aDD) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetListItemState(aMixed, aLI, aDT, aDD); } \
  690. NS_IMETHOD GetAlignment(PRBool *aMixed, PRInt16 *aAlign) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetAlignment(aMixed, aAlign); } \
  691. NS_IMETHOD GetIndentState(PRBool *aCanIndent, PRBool *aCanOutdent) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetIndentState(aCanIndent, aCanOutdent); } \
  692. NS_IMETHOD MakeOrChangeList(const nsAString & aListType, PRBool entireList, const nsAString & aBulletType) { return !_to ? NS_ERROR_NULL_POINTER : _to->MakeOrChangeList(aListType, entireList, aBulletType); } \
  693. NS_IMETHOD RemoveList(const nsAString & aListType) { return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveList(aListType); } \
  694. NS_IMETHOD Indent(const nsAString & aIndent) { return !_to ? NS_ERROR_NULL_POINTER : _to->Indent(aIndent); } \
  695. NS_IMETHOD Align(const nsAString & aAlign) { return !_to ? NS_ERROR_NULL_POINTER : _to->Align(aAlign); } \
  696. NS_IMETHOD GetElementOrParentByTagName(const nsAString & aTagName, nsIDOMNode *aNode, nsIDOMElement **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetElementOrParentByTagName(aTagName, aNode, _retval); } \
  697. NS_IMETHOD GetSelectedElement(const nsAString & aTagName, nsIDOMElement **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetSelectedElement(aTagName, _retval); } \
  698. NS_IMETHOD GetHeadContentsAsHTML(nsAString & _retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetHeadContentsAsHTML(_retval); } \
  699. NS_IMETHOD ReplaceHeadContentsWithHTML(const nsAString & aSourceToInsert) { return !_to ? NS_ERROR_NULL_POINTER : _to->ReplaceHeadContentsWithHTML(aSourceToInsert); } \
  700. NS_IMETHOD CreateElementWithDefaults(const nsAString & aTagName, nsIDOMElement **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->CreateElementWithDefaults(aTagName, _retval); } \
  701. NS_IMETHOD InsertLinkAroundSelection(nsIDOMElement *aAnchorElement) { return !_to ? NS_ERROR_NULL_POINTER : _to->InsertLinkAroundSelection(aAnchorElement); } \
  702. NS_IMETHOD SetBackgroundColor(const nsAString & aColor) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetBackgroundColor(aColor); } \
  703. NS_IMETHOD SetBodyAttribute(const nsAString & aAttr, const nsAString & aValue) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetBodyAttribute(aAttr, aValue); } \
  704. NS_IMETHOD IgnoreSpuriousDragEvent(PRBool aIgnoreSpuriousDragEvent) { return !_to ? NS_ERROR_NULL_POINTER : _to->IgnoreSpuriousDragEvent(aIgnoreSpuriousDragEvent); } \
  705. NS_IMETHOD GetLinkedObjects(nsISupportsArray **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetLinkedObjects(_retval); } \
  706. NS_IMETHOD GetIsCSSEnabled(PRBool *aIsCSSEnabled) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetIsCSSEnabled(aIsCSSEnabled); } \
  707. NS_IMETHOD SetIsCSSEnabled(PRBool aIsCSSEnabled) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetIsCSSEnabled(aIsCSSEnabled); } \
  708. NS_IMETHOD AddInsertionListener(nsIContentFilter *inFilter) { return !_to ? NS_ERROR_NULL_POINTER : _to->AddInsertionListener(inFilter); } \
  709. NS_IMETHOD RemoveInsertionListener(nsIContentFilter *inFilter) { return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveInsertionListener(inFilter); } \
  710. NS_IMETHOD CreateAnonymousElement(const nsAString & aTag, nsIDOMNode *aParentNode, const nsAString & aAnonClass, PRBool aIsCreatedHidden, nsIDOMElement **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->CreateAnonymousElement(aTag, aParentNode, aAnonClass, aIsCreatedHidden, _retval); } \
  711. NS_IMETHOD GetSelectionContainer(nsIDOMElement **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetSelectionContainer(_retval); } \
  712. NS_IMETHOD CheckSelectionStateForAnonymousButtons(nsISelection *aSelection) { return !_to ? NS_ERROR_NULL_POINTER : _to->CheckSelectionStateForAnonymousButtons(aSelection); } \
  713. NS_IMETHOD IsAnonymousElement(nsIDOMElement *aElement, PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->IsAnonymousElement(aElement, _retval); } \
  714. NS_IMETHOD GetReturnInParagraphCreatesNewParagraph(PRBool *aReturnInParagraphCreatesNewParagraph) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetReturnInParagraphCreatesNewParagraph(aReturnInParagraphCreatesNewParagraph); } \
  715. NS_IMETHOD SetReturnInParagraphCreatesNewParagraph(PRBool aReturnInParagraphCreatesNewParagraph) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetReturnInParagraphCreatesNewParagraph(aReturnInParagraphCreatesNewParagraph); }
  716. #if 0
  717. /* Use the code below as a template for the implementation class for this interface. */
  718. /* Header file */
  719. class nsHTMLEditor : public nsIHTMLEditor
  720. {
  721. public:
  722. NS_DECL_ISUPPORTS
  723. NS_DECL_NSIHTMLEDITOR
  724. nsHTMLEditor();
  725. private:
  726. ~nsHTMLEditor();
  727. protected:
  728. /* additional members */
  729. };
  730. /* Implementation file */
  731. NS_IMPL_ISUPPORTS1(nsHTMLEditor, nsIHTMLEditor)
  732. nsHTMLEditor::nsHTMLEditor()
  733. {
  734. /* member initializers and constructor code */
  735. }
  736. nsHTMLEditor::~nsHTMLEditor()
  737. {
  738. /* destructor code */
  739. }
  740. /* void addDefaultProperty (in nsIAtom aProperty, in AString aAttribute, in AString aValue); */
  741. NS_IMETHODIMP nsHTMLEditor::AddDefaultProperty(nsIAtom *aProperty, const nsAString & aAttribute, const nsAString & aValue)
  742. {
  743. return NS_ERROR_NOT_IMPLEMENTED;
  744. }
  745. /* void remov…

Large files files are truncated, but you can click here to view the full file