PageRenderTime 25ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/mozilla/mozilla/dist/include/editor/nsIContentFilter.h

http://kmbrasil.codeplex.com
C++ Header | 152 lines | 51 code | 27 blank | 74 comment | 0 complexity | e3425a2831ba7c0b4e7845b9342630ef MD5 | raw file
Possible License(s): MPL-2.0-no-copyleft-exception, GPL-2.0
  1. /*
  2. * DO NOT EDIT. THIS FILE IS GENERATED FROM h:/projects/mozilla/mozilla/editor/idl/nsIContentFilter.idl
  3. */
  4. #ifndef __gen_nsIContentFilter_h__
  5. #define __gen_nsIContentFilter_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 nsIURL; /* forward declaration */
  17. /* starting interface: nsIContentFilter */
  18. #define NS_ICONTENTFILTER_IID_STR "c18c49a8-62f0-4045-9884-4aa91e388f14"
  19. #define NS_ICONTENTFILTER_IID \
  20. {0xc18c49a8, 0x62f0, 0x4045, \
  21. { 0x98, 0x84, 0x4a, 0xa9, 0x1e, 0x38, 0x8f, 0x14 }}
  22. class NS_NO_VTABLE nsIContentFilter : public nsISupports {
  23. public:
  24. NS_DEFINE_STATIC_IID_ACCESSOR(NS_ICONTENTFILTER_IID)
  25. /**
  26. * This notification occurs in an editor during these events:
  27. * * open of document (once rendered in window but before editable)
  28. * * paste from clipboard
  29. * * drop from mouse
  30. * * insertion of html (such as with "cmd_insertHTML")
  31. * It provides a hook so the above actions can be canceled or the data
  32. * can be modified (using standard DOM APIs) or left untouched. The data
  33. * that results (if any) from all filter callbacks is what will be used
  34. * for transaction purposes (undo/redo) except for the open event.
  35. *
  36. * The willDeleteSelection parameter is offered for filters who want to
  37. * handle the insertion themselves and need to handle drag/drop correctly.
  38. * The flag is true when the editor intends to delete the selection.
  39. *
  40. * Callers who want to cancel all insertion can simply set
  41. * continueWithInsertion to PR_FALSE and return.
  42. * Note: If cancellation occurs during the "open" event, the editor will
  43. * still be available but will be empty.
  44. *
  45. * Callers who want to allow insertion of the data with no changes
  46. * can simply set continueWithInsertion to PR_TRUE and return.
  47. *
  48. * Callers who want to modify the content (docFragment) being inserted are
  49. * responsible for updating contentStartNode, contentStartOffset,
  50. * contentEndNode, and contentEndOffset (if necessary).
  51. * Callers are responsible for freeing and addref'ing if they want to
  52. * completely replace any of the DOM nodes passed in.
  53. *
  54. * The location where insertion will occur should be considered an
  55. * approximation since the editor may need to adjust it if it deletes
  56. * the selection as part of the event and later determines that insertion
  57. * point is an empty container which should also be removed (or in other
  58. * scenarios such as -moz-user-select:none).
  59. *
  60. * In some scenarios the selection will be deleted. If callers choose
  61. * to adjust the insertion point, they should be careful that the insertion
  62. * point is not in the current selection.
  63. *
  64. * The contentStartNode and contentEndNode are not necessarily
  65. * immediate children of the docFragment. Any nodes outside of the range
  66. * set by contentStartNode and contentEndNode are for context from the
  67. * source document.
  68. *
  69. * @param mimeType the mimetype used for retrieving data
  70. * @param contentSourceURL location where docFragment came from
  71. * @param sourceDocument document where content came from (can be null)
  72. * @param willDeleteSelection tells hook if selection will/should be deleted
  73. * @param docFragment fragment of node to be inserted
  74. * @param contentStartNode node under which content to be inserted begins
  75. * @param contentStartOffset start offset within contentStartNode
  76. * @param contentEndNode node under which content to be inserted ends
  77. * @param contentEndOffset ending offset withing contentEndNode
  78. * @param insertionPointNode location where insertion will occur
  79. * @param insertionPointOffset offset within node where insertion occurs
  80. * @param continueWithInsertion flag to cancel insertion (if desired)
  81. */
  82. /* void notifyOfInsertion (in AString mimeType, in nsIURL contentSourceURL, in nsIDOMDocument sourceDocument, in PRBool willDeleteSelection, inout nsIDOMNode docFragment, inout nsIDOMNode contentStartNode, inout long contentStartOffset, inout nsIDOMNode contentEndNode, inout long contentEndOffset, inout nsIDOMNode insertionPointNode, inout long insertionPointOffset, out boolean continueWithInsertion); */
  83. NS_IMETHOD NotifyOfInsertion(const nsAString & mimeType, nsIURL *contentSourceURL, nsIDOMDocument *sourceDocument, PRBool willDeleteSelection, nsIDOMNode **docFragment, nsIDOMNode **contentStartNode, PRInt32 *contentStartOffset, nsIDOMNode **contentEndNode, PRInt32 *contentEndOffset, nsIDOMNode **insertionPointNode, PRInt32 *insertionPointOffset, PRBool *continueWithInsertion) = 0;
  84. };
  85. /* Use this macro when declaring classes that implement this interface. */
  86. #define NS_DECL_NSICONTENTFILTER \
  87. NS_IMETHOD NotifyOfInsertion(const nsAString & mimeType, nsIURL *contentSourceURL, nsIDOMDocument *sourceDocument, PRBool willDeleteSelection, nsIDOMNode **docFragment, nsIDOMNode **contentStartNode, PRInt32 *contentStartOffset, nsIDOMNode **contentEndNode, PRInt32 *contentEndOffset, nsIDOMNode **insertionPointNode, PRInt32 *insertionPointOffset, PRBool *continueWithInsertion);
  88. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  89. #define NS_FORWARD_NSICONTENTFILTER(_to) \
  90. NS_IMETHOD NotifyOfInsertion(const nsAString & mimeType, nsIURL *contentSourceURL, nsIDOMDocument *sourceDocument, PRBool willDeleteSelection, nsIDOMNode **docFragment, nsIDOMNode **contentStartNode, PRInt32 *contentStartOffset, nsIDOMNode **contentEndNode, PRInt32 *contentEndOffset, nsIDOMNode **insertionPointNode, PRInt32 *insertionPointOffset, PRBool *continueWithInsertion) { return _to NotifyOfInsertion(mimeType, contentSourceURL, sourceDocument, willDeleteSelection, docFragment, contentStartNode, contentStartOffset, contentEndNode, contentEndOffset, insertionPointNode, insertionPointOffset, continueWithInsertion); }
  91. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  92. #define NS_FORWARD_SAFE_NSICONTENTFILTER(_to) \
  93. NS_IMETHOD NotifyOfInsertion(const nsAString & mimeType, nsIURL *contentSourceURL, nsIDOMDocument *sourceDocument, PRBool willDeleteSelection, nsIDOMNode **docFragment, nsIDOMNode **contentStartNode, PRInt32 *contentStartOffset, nsIDOMNode **contentEndNode, PRInt32 *contentEndOffset, nsIDOMNode **insertionPointNode, PRInt32 *insertionPointOffset, PRBool *continueWithInsertion) { return !_to ? NS_ERROR_NULL_POINTER : _to->NotifyOfInsertion(mimeType, contentSourceURL, sourceDocument, willDeleteSelection, docFragment, contentStartNode, contentStartOffset, contentEndNode, contentEndOffset, insertionPointNode, insertionPointOffset, continueWithInsertion); }
  94. #if 0
  95. /* Use the code below as a template for the implementation class for this interface. */
  96. /* Header file */
  97. class nsContentFilter : public nsIContentFilter
  98. {
  99. public:
  100. NS_DECL_ISUPPORTS
  101. NS_DECL_NSICONTENTFILTER
  102. nsContentFilter();
  103. private:
  104. ~nsContentFilter();
  105. protected:
  106. /* additional members */
  107. };
  108. /* Implementation file */
  109. NS_IMPL_ISUPPORTS1(nsContentFilter, nsIContentFilter)
  110. nsContentFilter::nsContentFilter()
  111. {
  112. /* member initializers and constructor code */
  113. }
  114. nsContentFilter::~nsContentFilter()
  115. {
  116. /* destructor code */
  117. }
  118. /* void notifyOfInsertion (in AString mimeType, in nsIURL contentSourceURL, in nsIDOMDocument sourceDocument, in PRBool willDeleteSelection, inout nsIDOMNode docFragment, inout nsIDOMNode contentStartNode, inout long contentStartOffset, inout nsIDOMNode contentEndNode, inout long contentEndOffset, inout nsIDOMNode insertionPointNode, inout long insertionPointOffset, out boolean continueWithInsertion); */
  119. NS_IMETHODIMP nsContentFilter::NotifyOfInsertion(const nsAString & mimeType, nsIURL *contentSourceURL, nsIDOMDocument *sourceDocument, PRBool willDeleteSelection, nsIDOMNode **docFragment, nsIDOMNode **contentStartNode, PRInt32 *contentStartOffset, nsIDOMNode **contentEndNode, PRInt32 *contentEndOffset, nsIDOMNode **insertionPointNode, PRInt32 *insertionPointOffset, PRBool *continueWithInsertion)
  120. {
  121. return NS_ERROR_NOT_IMPLEMENTED;
  122. }
  123. /* End of implementation class template. */
  124. #endif
  125. #endif /* __gen_nsIContentFilter_h__ */