nsIEditorMailSupport.idl 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this
  4. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. #include "nsISupports.idl"
  6. interface nsIArray;
  7. interface nsIDOMNode;
  8. [scriptable, uuid(fdf23301-4a94-11d3-9ce4-9960496c41bc)]
  9. interface nsIEditorMailSupport : nsISupports
  10. {
  11. /** Paste the text in the OS clipboard at the cursor position,
  12. * as a quotation (whose representation is dependant on the editor type),
  13. * replacing the selected text (if any).
  14. * @param aSelectionType Text or html?
  15. */
  16. void pasteAsQuotation(in long aSelectionType);
  17. /** Insert a string as quoted text
  18. * (whose representation is dependant on the editor type),
  19. * replacing the selected text (if any).
  20. * @param aQuotedText The actual text to be quoted
  21. * @return The node which was inserted
  22. */
  23. nsIDOMNode insertAsQuotation(in AString aQuotedText);
  24. /**
  25. * Inserts a plaintext string at the current location,
  26. * with special processing for lines beginning with ">",
  27. * which will be treated as mail quotes and inserted
  28. * as plaintext quoted blocks.
  29. * If the selection is not collapsed, the selection is deleted
  30. * and the insertion takes place at the resulting collapsed selection.
  31. *
  32. * @param aString the string to be inserted
  33. */
  34. void insertTextWithQuotations(in DOMString aStringToInsert);
  35. /** Paste a string as quoted text,
  36. * whose representation is dependant on the editor type,
  37. * replacing the selected text (if any)
  38. * @param aCitation The "mid" URL of the source message
  39. * @param aSelectionType Text or html?
  40. */
  41. void pasteAsCitedQuotation(in AString aCitation,
  42. in long aSelectionType);
  43. /** Insert a string as quoted text
  44. * (whose representation is dependant on the editor type),
  45. * replacing the selected text (if any),
  46. * including, if possible, a "cite" attribute.
  47. * @param aQuotedText The actual text to be quoted
  48. * @param aCitation The "mid" URL of the source message
  49. * @param aInsertHTML Insert as html? (vs plaintext)
  50. * @return The node which was inserted
  51. */
  52. nsIDOMNode insertAsCitedQuotation(in AString aQuotedText,
  53. in AString aCitation,
  54. in boolean aInsertHTML);
  55. /**
  56. * Rewrap the selected part of the document, re-quoting if necessary.
  57. * @param aRespectNewlines Try to maintain newlines in the original?
  58. */
  59. void rewrap(in boolean aRespectNewlines);
  60. /**
  61. * Strip any citations in the selected part of the document.
  62. */
  63. void stripCites();
  64. /**
  65. * Get a list of IMG and OBJECT tags in the current document.
  66. */
  67. nsIArray getEmbeddedObjects();
  68. };