/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM $SRCDIR/editor/nsIEditor.idl
 */

#ifndef __gen_nsIEditor_h__
#define __gen_nsIEditor_h__


#include "nsISupports.h"

#include "nsIClipboard.h"

#include "domstubs.h"

#include "mozilla/AlreadyAddRefed.h"
#include "mozilla/Assertions.h"
#include "mozilla/DebugOnly.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
class nsISelectionController; /* forward declaration */

class nsIDocumentStateListener; /* forward declaration */

class nsIEditActionListener; /* forward declaration */

class nsIInlineSpellChecker; /* forward declaration */

class nsITransferable; /* forward declaration */

namespace mozilla {
namespace dom {
class Document; /* webidl Document */
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {
class Element; /* webidl Element */
} // namespace dom
} // namespace mozilla

class nsINode; /* webidl Node */

namespace mozilla {
namespace dom {
class Selection; /* webidl Selection */
} // namespace dom
} // namespace mozilla

// %{C++:22-26
namespace mozilla {
class EditorBase;
class HTMLEditor;
class TextEditor;
} // namespace mozilla
// %}

/* starting interface:    nsIEditor */
#define NS_IEDITOR_IID_STR "094be624-f0bf-400f-89e2-6a84baab9474"

#define NS_IEDITOR_IID \
  {0x094be624, 0xf0bf, 0x400f, \
    { 0x89, 0xe2, 0x6a, 0x84, 0xba, 0xab, 0x94, 0x74 }}

class MOZ_BINDING(binding_to, idl, class, XPIDL_nsIEditor) nsIEditor : public nsISupports {
 public:

  NS_INLINE_DECL_STATIC_IID(NS_IEDITOR_IID)

  /* Used by ToJSValue to check which scriptable interface is implemented. */
  using ScriptableInterfaceType = nsIEditor;

// %{C++:33-34
  typedef short EDirection;
  typedef short EStripWrappers;
// %}
  enum {
    eNone MOZ_BINDING(binding_to, idl, const, XPIDL_nsIEditor_eNone) = 0,
    eNext MOZ_BINDING(binding_to, idl, const, XPIDL_nsIEditor_eNext) = 1,
    ePrevious MOZ_BINDING(binding_to, idl, const, XPIDL_nsIEditor_ePrevious) = 2,
    eNextWord MOZ_BINDING(binding_to, idl, const, XPIDL_nsIEditor_eNextWord) = 3,
    ePreviousWord MOZ_BINDING(binding_to, idl, const, XPIDL_nsIEditor_ePreviousWord) = 4,
    eToBeginningOfLine MOZ_BINDING(binding_to, idl, const, XPIDL_nsIEditor_eToBeginningOfLine) = 5,
    eToEndOfLine MOZ_BINDING(binding_to, idl, const, XPIDL_nsIEditor_eToEndOfLine) = 6
  };

// %{C++:45-81
  static bool EDirectionIsValid(EDirection aDirectionAndAmount) {
    return aDirectionAndAmount == nsIEditor::eNone ||
           aDirectionAndAmount == nsIEditor::eNext ||
           aDirectionAndAmount == nsIEditor::ePrevious ||
           aDirectionAndAmount == nsIEditor::eNextWord ||
           aDirectionAndAmount == nsIEditor::ePreviousWord ||
           aDirectionAndAmount == nsIEditor::eToBeginningOfLine ||
           aDirectionAndAmount == nsIEditor::eToEndOfLine;
  }
  static bool EDirectionIsValidExceptNone(EDirection aDirectionAndAmount) {
    return aDirectionAndAmount != nsIEditor::eNone &&
           EDirectionIsValid(aDirectionAndAmount);
  }

  /**
   * Return true if nsIEditor::EDirection value means the direction of pressing
   * `Backspace` key.
   */
  [[nodiscard]] static bool DirectionIsBackspace(
    EDirection aDirectionAndAmount) {
    MOZ_ASSERT(EDirectionIsValid(aDirectionAndAmount));
    return aDirectionAndAmount == nsIEditor::ePrevious ||
           aDirectionAndAmount == nsIEditor::ePreviousWord ||
           aDirectionAndAmount == nsIEditor::eToBeginningOfLine;
  }

  /**
   * Return true if nsIEditor::EDirection value means the direction of pressing
   * `Delete` key (forwardDelete).
   */
  [[nodiscard]] static bool DirectionIsDelete(
    EDirection aDirectionAndAmount) {
    MOZ_ASSERT(EDirectionIsValid(aDirectionAndAmount));
    return aDirectionAndAmount == nsIEditor::eNext ||
           aDirectionAndAmount == nsIEditor::eNextWord ||
           aDirectionAndAmount == nsIEditor::eToEndOfLine;
  }
// %}
  enum {
    eStrip MOZ_BINDING(binding_to, idl, const, XPIDL_nsIEditor_eStrip) = 0,
    eNoStrip MOZ_BINDING(binding_to, idl, const, XPIDL_nsIEditor_eNoStrip) = 1,
    eEditorPlaintextMask MOZ_BINDING(binding_to, idl, const, XPIDL_nsIEditor_eEditorPlaintextMask) = 1,
    eEditorSingleLineMask MOZ_BINDING(binding_to, idl, const, XPIDL_nsIEditor_eEditorSingleLineMask) = 2,
    eEditorPasswordMask MOZ_BINDING(binding_to, idl, const, XPIDL_nsIEditor_eEditorPasswordMask) = 4,
    eEditorReadonlyMask MOZ_BINDING(binding_to, idl, const, XPIDL_nsIEditor_eEditorReadonlyMask) = 8,
    eEditorMailMask MOZ_BINDING(binding_to, idl, const, XPIDL_nsIEditor_eEditorMailMask) = 32,
    eEditorEnableWrapHackMask MOZ_BINDING(binding_to, idl, const, XPIDL_nsIEditor_eEditorEnableWrapHackMask) = 64,
    eEditorAllowInteraction MOZ_BINDING(binding_to, idl, const, XPIDL_nsIEditor_eEditorAllowInteraction) = 512,
    eEditorRightToLeft MOZ_BINDING(binding_to, idl, const, XPIDL_nsIEditor_eEditorRightToLeft) = 2048,
    eEditorLeftToRight MOZ_BINDING(binding_to, idl, const, XPIDL_nsIEditor_eEditorLeftToRight) = 4096,
    eEditorSkipSpellCheck MOZ_BINDING(binding_to, idl, const, XPIDL_nsIEditor_eEditorSkipSpellCheck) = 8192,
    eNewlinesPasteIntact MOZ_BINDING(binding_to, idl, const, XPIDL_nsIEditor_eNewlinesPasteIntact) = 0,
    eNewlinesPasteToFirst MOZ_BINDING(binding_to, idl, const, XPIDL_nsIEditor_eNewlinesPasteToFirst) = 1,
    eNewlinesReplaceWithSpaces MOZ_BINDING(binding_to, idl, const, XPIDL_nsIEditor_eNewlinesReplaceWithSpaces) = 2,
    eNewlinesStrip MOZ_BINDING(binding_to, idl, const, XPIDL_nsIEditor_eNewlinesStrip) = 3,
    eNewlinesReplaceWithCommas MOZ_BINDING(binding_to, idl, const, XPIDL_nsIEditor_eNewlinesReplaceWithCommas) = 4,
    eNewlinesStripSurroundingWhitespace MOZ_BINDING(binding_to, idl, const, XPIDL_nsIEditor_eNewlinesStripSurroundingWhitespace) = 5
  };

  /* readonly attribute Selection selection; */
  MOZ_BINDING(binding_to, idl, getter, XPIDL_nsIEditor_selection)
  NS_IMETHOD GetSelection(mozilla::dom::Selection **aSelection) = 0;

  /* [can_run_script] void setAttributeOrEquivalent (in Element element, in AString sourceAttrName, in AString sourceAttrValue, in boolean aSuppressTransaction); */
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_setAttributeOrEquivalent)
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD SetAttributeOrEquivalent(mozilla::dom::Element *element, const nsAString& sourceAttrName, const nsAString& sourceAttrValue, bool aSuppressTransaction) = 0;

  /* [can_run_script] void removeAttributeOrEquivalent (in Element element, in AString sourceAttrName, in boolean aSuppressTransaction); */
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_removeAttributeOrEquivalent)
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD RemoveAttributeOrEquivalent(mozilla::dom::Element *element, const nsAString& sourceAttrName, bool aSuppressTransaction) = 0;

  /* [setter_can_run_script] attribute unsigned long flags; */
  MOZ_BINDING(binding_to, idl, getter, XPIDL_nsIEditor_flags)
  NS_IMETHOD GetFlags(uint32_t *aFlags) = 0;
  MOZ_BINDING(binding_to, idl, setter, XPIDL_nsIEditor_flags)
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD SetFlags(uint32_t aFlags) = 0;

  /* attribute AString contentsMIMEType; */
  MOZ_BINDING(binding_to, idl, getter, XPIDL_nsIEditor_contentsMIMEType)
  NS_IMETHOD GetContentsMIMEType(nsAString& aContentsMIMEType) = 0;
  MOZ_BINDING(binding_to, idl, setter, XPIDL_nsIEditor_contentsMIMEType)
  NS_IMETHOD SetContentsMIMEType(const nsAString& aContentsMIMEType) = 0;

  /* readonly attribute boolean isDocumentEditable; */
  MOZ_BINDING(binding_to, idl, getter, XPIDL_nsIEditor_isDocumentEditable)
  NS_IMETHOD GetIsDocumentEditable(bool *aIsDocumentEditable) = 0;

  /* readonly attribute boolean isSelectionEditable; */
  MOZ_BINDING(binding_to, idl, getter, XPIDL_nsIEditor_isSelectionEditable)
  NS_IMETHOD GetIsSelectionEditable(bool *aIsSelectionEditable) = 0;

  /* readonly attribute Document document; */
  MOZ_BINDING(binding_to, idl, getter, XPIDL_nsIEditor_document)
  NS_IMETHOD GetDocument(mozilla::dom::Document **aDocument) = 0;

  /* readonly attribute Element rootElement; */
  MOZ_BINDING(binding_to, idl, getter, XPIDL_nsIEditor_rootElement)
  NS_IMETHOD GetRootElement(mozilla::dom::Element **aRootElement) = 0;

  /* readonly attribute nsISelectionController selectionController; */
  MOZ_BINDING(binding_to, idl, getter, XPIDL_nsIEditor_selectionController)
  NS_IMETHOD GetSelectionController(nsISelectionController **aSelectionController) = 0;

  /* [can_run_script] void deleteSelection (in short action, in short stripWrappers); */
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_deleteSelection)
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD DeleteSelection(int16_t action, int16_t stripWrappers) = 0;

  /* readonly attribute boolean documentIsEmpty; */
  MOZ_BINDING(binding_to, idl, getter, XPIDL_nsIEditor_documentIsEmpty)
  NS_IMETHOD GetDocumentIsEmpty(bool *aDocumentIsEmpty) = 0;

  /* readonly attribute boolean documentModified; */
  MOZ_BINDING(binding_to, idl, getter, XPIDL_nsIEditor_documentModified)
  NS_IMETHOD GetDocumentModified(bool *aDocumentModified) = 0;

  /* [setter_can_run_script] attribute ACString documentCharacterSet; */
  MOZ_BINDING(binding_to, idl, getter, XPIDL_nsIEditor_documentCharacterSet)
  NS_IMETHOD GetDocumentCharacterSet(nsACString& aDocumentCharacterSet) = 0;
  MOZ_BINDING(binding_to, idl, setter, XPIDL_nsIEditor_documentCharacterSet)
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD SetDocumentCharacterSet(const nsACString& aDocumentCharacterSet) = 0;

  /* [can_run_script] void resetModificationCount (); */
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_resetModificationCount)
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD ResetModificationCount(void) = 0;

  /* long getModificationCount (); */
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_getModificationCount)
  NS_IMETHOD GetModificationCount(int32_t *_retval) = 0;

  /* [can_run_script] void incrementModificationCount (in long aModCount); */
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_incrementModificationCount)
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD IncrementModificationCount(int32_t aModCount) = 0;

  /* void enableUndo (in boolean enable); */
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_enableUndo)
  NS_IMETHOD EnableUndo(bool enable) = 0;

  /* [infallible] readonly attribute boolean undoRedoEnabled; */
  MOZ_BINDING(binding_to, idl, getter, XPIDL_nsIEditor_undoRedoEnabled)
  NS_IMETHOD GetUndoRedoEnabled(bool *aUndoRedoEnabled) = 0;
  inline bool  GetUndoRedoEnabled()
  {
    bool result;
    mozilla::DebugOnly<nsresult> rv = GetUndoRedoEnabled(&result);
    MOZ_ASSERT(NS_SUCCEEDED(rv));
    return result;
  }

  /* [infallible] readonly attribute boolean canUndo; */
  MOZ_BINDING(binding_to, idl, getter, XPIDL_nsIEditor_canUndo)
  NS_IMETHOD GetCanUndo(bool *aCanUndo) = 0;
  inline bool  GetCanUndo()
  {
    bool result;
    mozilla::DebugOnly<nsresult> rv = GetCanUndo(&result);
    MOZ_ASSERT(NS_SUCCEEDED(rv));
    return result;
  }

  /* [infallible] readonly attribute boolean canRedo; */
  MOZ_BINDING(binding_to, idl, getter, XPIDL_nsIEditor_canRedo)
  NS_IMETHOD GetCanRedo(bool *aCanRedo) = 0;
  inline bool  GetCanRedo()
  {
    bool result;
    mozilla::DebugOnly<nsresult> rv = GetCanRedo(&result);
    MOZ_ASSERT(NS_SUCCEEDED(rv));
    return result;
  }

  /* [binaryname(ClearUndoRedoXPCOM)] void clearUndoRedo (); */
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_clearUndoRedo)
  NS_IMETHOD ClearUndoRedoXPCOM(void) = 0;

  /* [can_run_script] void undo (); */
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_undo)
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD Undo(void) = 0;

  /* [can_run_script] void undoAll (); */
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_undoAll)
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD UndoAll(void) = 0;

  /* [can_run_script] void redo (); */
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_redo)
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD Redo(void) = 0;

  /* [can_run_script] void beginTransaction (); */
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_beginTransaction)
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD BeginTransaction(void) = 0;

  /* [can_run_script] void endTransaction (); */
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_endTransaction)
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD EndTransaction(void) = 0;

  /* nsIInlineSpellChecker getInlineSpellChecker (in boolean autoCreate); */
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_getInlineSpellChecker)
  NS_IMETHOD GetInlineSpellChecker(bool autoCreate, nsIInlineSpellChecker **_retval) = 0;

  /* void setSpellcheckUserOverride (in boolean enable); */
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_setSpellcheckUserOverride)
  NS_IMETHOD SetSpellcheckUserOverride(bool enable) = 0;

  /* [can_run_script] void cut (); */
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_cut)
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD Cut(void) = 0;

  /* [can_run_script] boolean canCut (); */
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_canCut)
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD CanCut(bool *_retval) = 0;

  /* [can_run_script] void copy (); */
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_copy)
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD Copy(void) = 0;

  /* [can_run_script] boolean canCopy (); */
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_canCopy)
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD CanCopy(bool *_retval) = 0;

  /* [can_run_script] void paste (in nsIClipboard_ClipboardType aClipboardType); */
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_paste)
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD Paste(nsIClipboard::ClipboardType aClipboardType) = 0;

  /* [can_run_script] void pasteTransferable (in nsITransferable aTransferable); */
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_pasteTransferable)
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD PasteTransferable(nsITransferable *aTransferable) = 0;

  /* boolean canPaste (in nsIClipboard_ClipboardType aClipboardType); */
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_canPaste)
  NS_IMETHOD CanPaste(nsIClipboard::ClipboardType aClipboardType, bool *_retval) = 0;

  /* [can_run_script] void selectAll (); */
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_selectAll)
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD SelectAll(void) = 0;

  /* [can_run_script] void beginningOfDocument (); */
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_beginningOfDocument)
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD BeginningOfDocument(void) = 0;

  /* [can_run_script] void endOfDocument (); */
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_endOfDocument)
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD EndOfDocument(void) = 0;

  /* [can_run_script] void setAttribute (in Element aElement, in AString attributestr, in AString attvalue); */
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_setAttribute)
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD SetAttribute(mozilla::dom::Element *aElement, const nsAString& attributestr, const nsAString& attvalue) = 0;

  /* [can_run_script] void removeAttribute (in Element aElement, in AString aAttribute); */
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_removeAttribute)
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD RemoveAttribute(mozilla::dom::Element *aElement, const nsAString& aAttribute) = 0;

  /* [can_run_script] void cloneAttributes (in Element aDestElement, in Element aSourceElement); */
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_cloneAttributes)
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD CloneAttributes(mozilla::dom::Element *aDestElement, mozilla::dom::Element *aSourceElement) = 0;

  /* [can_run_script,optional_argc] void insertNode (in Node node, in Node parent, in unsigned long aPosition, [optional] in boolean aPreserveSelection); */
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_insertNode)
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD InsertNode(nsINode *node, nsINode *parent, uint32_t aPosition, bool aPreserveSelection, uint8_t _argc) = 0;

  /* [can_run_script,optional_argc] void deleteNode (in Node child, [optional] in boolean aPreserveSelection); */
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_deleteNode)
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD DeleteNode(nsINode *child, bool aPreserveSelection, uint8_t _argc) = 0;

  /* AString outputToString (in AString formatType, in unsigned long flags); */
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_outputToString)
  NS_IMETHOD OutputToString(const nsAString& formatType, uint32_t flags, nsAString& _retval) = 0;

  /* void addEditActionListener (in nsIEditActionListener listener); */
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_addEditActionListener)
  NS_IMETHOD AddEditActionListener(nsIEditActionListener *listener) = 0;

  /* void removeEditActionListener (in nsIEditActionListener listener); */
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_removeEditActionListener)
  NS_IMETHOD RemoveEditActionListener(nsIEditActionListener *listener) = 0;

  /* void addDocumentStateListener (in nsIDocumentStateListener listener); */
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_addDocumentStateListener)
  NS_IMETHOD AddDocumentStateListener(nsIDocumentStateListener *listener) = 0;

  /* void removeDocumentStateListener (in nsIDocumentStateListener listener); */
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_removeDocumentStateListener)
  NS_IMETHOD RemoveDocumentStateListener(nsIDocumentStateListener *listener) = 0;

  /* void forceCompositionEnd (); */
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_forceCompositionEnd)
  NS_IMETHOD ForceCompositionEnd(void) = 0;

  /* readonly attribute boolean composing; */
  MOZ_BINDING(binding_to, idl, getter, XPIDL_nsIEditor_composing)
  NS_IMETHOD GetComposing(bool *aComposing) = 0;

  /* [can_run_script,optional_argc] void unmask ([optional] in unsigned long aStart, [optional] in long long aEnd, [optional] in unsigned long aTimeout); */
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_unmask)
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD Unmask(uint32_t aStart, int64_t aEnd, uint32_t aTimeout, uint8_t _argc) = 0;

  /* [can_run_script] void mask (); */
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_mask)
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD Mask(void) = 0;

  /* readonly attribute unsigned long unmaskedStart; */
  MOZ_BINDING(binding_to, idl, getter, XPIDL_nsIEditor_unmaskedStart)
  NS_IMETHOD GetUnmaskedStart(uint32_t *aUnmaskedStart) = 0;

  /* readonly attribute unsigned long unmaskedEnd; */
  MOZ_BINDING(binding_to, idl, getter, XPIDL_nsIEditor_unmaskedEnd)
  NS_IMETHOD GetUnmaskedEnd(uint32_t *aUnmaskedEnd) = 0;

  /* readonly attribute boolean autoMaskingEnabled; */
  MOZ_BINDING(binding_to, idl, getter, XPIDL_nsIEditor_autoMaskingEnabled)
  NS_IMETHOD GetAutoMaskingEnabled(bool *aAutoMaskingEnabled) = 0;

  /* readonly attribute AString passwordMask; */
  MOZ_BINDING(binding_to, idl, getter, XPIDL_nsIEditor_passwordMask)
  NS_IMETHOD GetPasswordMask(nsAString& aPasswordMask) = 0;

  /* readonly attribute unsigned long textLength; */
  MOZ_BINDING(binding_to, idl, getter, XPIDL_nsIEditor_textLength)
  NS_IMETHOD GetTextLength(uint32_t *aTextLength) = 0;

  /* attribute long newlineHandling; */
  MOZ_BINDING(binding_to, idl, getter, XPIDL_nsIEditor_newlineHandling)
  NS_IMETHOD GetNewlineHandling(int32_t *aNewlineHandling) = 0;
  MOZ_BINDING(binding_to, idl, setter, XPIDL_nsIEditor_newlineHandling)
  NS_IMETHOD SetNewlineHandling(int32_t aNewlineHandling) = 0;

  /* [can_run_script] void insertText (in AString aStringToInsert); */
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_insertText)
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD InsertText(const nsAString& aStringToInsert) = 0;

  /* [can_run_script] void insertLineBreak (); */
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_insertLineBreak)
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD InsertLineBreak(void) = 0;

// %{C++:632-670
  inline bool IsHTMLEditor() const;
  inline bool IsTextEditor() const;

  /**
   * AsEditorBase() returns a pointer to EditorBase class.
   *
   * In order to avoid circular dependency issues, this method is defined
   * in mozilla/EditorBase.h.  Consumers need to #include that header.
   */
  inline mozilla::EditorBase* AsEditorBase();
  inline const mozilla::EditorBase* AsEditorBase() const;

  /**
   * AsTextEditor() and GetTextEditor() return a pointer to TextEditor class.
   * AsTextEditor() does not check the concrete class type.  So, it never
   * returns nullptr.  GetAsTextEditor() does check the concrete class type.
   * So, it may return nullptr.
   *
   * In order to avoid circular dependency issues, this method is defined
   * in mozilla/TextEditor.h.  Consumers need to #include that header.
   */
  inline mozilla::TextEditor* AsTextEditor();
  inline const mozilla::TextEditor* AsTextEditor() const;
  inline mozilla::TextEditor* GetAsTextEditor();
  inline const mozilla::TextEditor* GetAsTextEditor() const;

  /**
   * AsHTMLEditor() and GetHTMLEditor() return a pointer to HTMLEditor class.
   * AsHTMLEditor() does not check the concrete class type.  So, it never
   * returns nullptr.  GetAsHTMLEditor() does check the concrete class type.
   * So, it may return nullptr.
   *
   * In order to avoid circular dependency issues, this method is defined
   * in mozilla/HTMLEditor.h.  Consumers need to #include that header.
   */
  inline mozilla::HTMLEditor* AsHTMLEditor();
  inline const mozilla::HTMLEditor* AsHTMLEditor() const;
  inline mozilla::HTMLEditor* GetAsHTMLEditor();
  inline const mozilla::HTMLEditor* GetAsHTMLEditor() const;
// %}
};


/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIEDITOR \
  NS_IMETHOD GetSelection(mozilla::dom::Selection **aSelection) override; \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD SetAttributeOrEquivalent(mozilla::dom::Element *element, const nsAString& sourceAttrName, const nsAString& sourceAttrValue, bool aSuppressTransaction) override; \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD RemoveAttributeOrEquivalent(mozilla::dom::Element *element, const nsAString& sourceAttrName, bool aSuppressTransaction) override; \
  NS_IMETHOD GetFlags(uint32_t *aFlags) override; \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD SetFlags(uint32_t aFlags) override; \
  NS_IMETHOD GetContentsMIMEType(nsAString& aContentsMIMEType) override; \
  NS_IMETHOD SetContentsMIMEType(const nsAString& aContentsMIMEType) override; \
  NS_IMETHOD GetIsDocumentEditable(bool *aIsDocumentEditable) override; \
  NS_IMETHOD GetIsSelectionEditable(bool *aIsSelectionEditable) override; \
  NS_IMETHOD GetDocument(mozilla::dom::Document **aDocument) override; \
  NS_IMETHOD GetRootElement(mozilla::dom::Element **aRootElement) override; \
  NS_IMETHOD GetSelectionController(nsISelectionController **aSelectionController) override; \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD DeleteSelection(int16_t action, int16_t stripWrappers) override; \
  NS_IMETHOD GetDocumentIsEmpty(bool *aDocumentIsEmpty) override; \
  NS_IMETHOD GetDocumentModified(bool *aDocumentModified) override; \
  NS_IMETHOD GetDocumentCharacterSet(nsACString& aDocumentCharacterSet) override; \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD SetDocumentCharacterSet(const nsACString& aDocumentCharacterSet) override; \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD ResetModificationCount(void) override; \
  NS_IMETHOD GetModificationCount(int32_t *_retval) override; \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD IncrementModificationCount(int32_t aModCount) override; \
  NS_IMETHOD EnableUndo(bool enable) override; \
  using nsIEditor::GetUndoRedoEnabled; \
  NS_IMETHOD GetUndoRedoEnabled(bool *aUndoRedoEnabled) override; \
  using nsIEditor::GetCanUndo; \
  NS_IMETHOD GetCanUndo(bool *aCanUndo) override; \
  using nsIEditor::GetCanRedo; \
  NS_IMETHOD GetCanRedo(bool *aCanRedo) override; \
  NS_IMETHOD ClearUndoRedoXPCOM(void) override; \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD Undo(void) override; \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD UndoAll(void) override; \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD Redo(void) override; \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD BeginTransaction(void) override; \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD EndTransaction(void) override; \
  NS_IMETHOD GetInlineSpellChecker(bool autoCreate, nsIInlineSpellChecker **_retval) override; \
  NS_IMETHOD SetSpellcheckUserOverride(bool enable) override; \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD Cut(void) override; \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD CanCut(bool *_retval) override; \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD Copy(void) override; \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD CanCopy(bool *_retval) override; \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD Paste(nsIClipboard::ClipboardType aClipboardType) override; \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD PasteTransferable(nsITransferable *aTransferable) override; \
  NS_IMETHOD CanPaste(nsIClipboard::ClipboardType aClipboardType, bool *_retval) override; \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD SelectAll(void) override; \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD BeginningOfDocument(void) override; \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD EndOfDocument(void) override; \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD SetAttribute(mozilla::dom::Element *aElement, const nsAString& attributestr, const nsAString& attvalue) override; \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD RemoveAttribute(mozilla::dom::Element *aElement, const nsAString& aAttribute) override; \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD CloneAttributes(mozilla::dom::Element *aDestElement, mozilla::dom::Element *aSourceElement) override; \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD InsertNode(nsINode *node, nsINode *parent, uint32_t aPosition, bool aPreserveSelection, uint8_t _argc) override; \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD DeleteNode(nsINode *child, bool aPreserveSelection, uint8_t _argc) override; \
  NS_IMETHOD OutputToString(const nsAString& formatType, uint32_t flags, nsAString& _retval) override; \
  NS_IMETHOD AddEditActionListener(nsIEditActionListener *listener) override; \
  NS_IMETHOD RemoveEditActionListener(nsIEditActionListener *listener) override; \
  NS_IMETHOD AddDocumentStateListener(nsIDocumentStateListener *listener) override; \
  NS_IMETHOD RemoveDocumentStateListener(nsIDocumentStateListener *listener) override; \
  NS_IMETHOD ForceCompositionEnd(void) override; \
  NS_IMETHOD GetComposing(bool *aComposing) override; \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD Unmask(uint32_t aStart, int64_t aEnd, uint32_t aTimeout, uint8_t _argc) override; \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD Mask(void) override; \
  NS_IMETHOD GetUnmaskedStart(uint32_t *aUnmaskedStart) override; \
  NS_IMETHOD GetUnmaskedEnd(uint32_t *aUnmaskedEnd) override; \
  NS_IMETHOD GetAutoMaskingEnabled(bool *aAutoMaskingEnabled) override; \
  NS_IMETHOD GetPasswordMask(nsAString& aPasswordMask) override; \
  NS_IMETHOD GetTextLength(uint32_t *aTextLength) override; \
  NS_IMETHOD GetNewlineHandling(int32_t *aNewlineHandling) override; \
  NS_IMETHOD SetNewlineHandling(int32_t aNewlineHandling) override; \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD InsertText(const nsAString& aStringToInsert) override; \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD InsertLineBreak(void) override; \

/* Use this macro when declaring the members of this interface when the
   class doesn't implement the interface. This is useful for forwarding. */
#define NS_DECL_NON_VIRTUAL_NSIEDITOR \
  MOZ_BINDING(binding_to, idl, getter, XPIDL_nsIEditor_selection)\
  nsresult GetSelection(mozilla::dom::Selection **aSelection); \
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_setAttributeOrEquivalent)\
  MOZ_CAN_RUN_SCRIPT nsresult SetAttributeOrEquivalent(mozilla::dom::Element *element, const nsAString& sourceAttrName, const nsAString& sourceAttrValue, bool aSuppressTransaction); \
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_removeAttributeOrEquivalent)\
  MOZ_CAN_RUN_SCRIPT nsresult RemoveAttributeOrEquivalent(mozilla::dom::Element *element, const nsAString& sourceAttrName, bool aSuppressTransaction); \
  MOZ_BINDING(binding_to, idl, getter, XPIDL_nsIEditor_flags)\
  nsresult GetFlags(uint32_t *aFlags); \
  MOZ_BINDING(binding_to, idl, setter, XPIDL_nsIEditor_flags)\
  MOZ_CAN_RUN_SCRIPT nsresult SetFlags(uint32_t aFlags); \
  MOZ_BINDING(binding_to, idl, getter, XPIDL_nsIEditor_contentsMIMEType)\
  nsresult GetContentsMIMEType(nsAString& aContentsMIMEType); \
  MOZ_BINDING(binding_to, idl, setter, XPIDL_nsIEditor_contentsMIMEType)\
  nsresult SetContentsMIMEType(const nsAString& aContentsMIMEType); \
  MOZ_BINDING(binding_to, idl, getter, XPIDL_nsIEditor_isDocumentEditable)\
  nsresult GetIsDocumentEditable(bool *aIsDocumentEditable); \
  MOZ_BINDING(binding_to, idl, getter, XPIDL_nsIEditor_isSelectionEditable)\
  nsresult GetIsSelectionEditable(bool *aIsSelectionEditable); \
  MOZ_BINDING(binding_to, idl, getter, XPIDL_nsIEditor_document)\
  nsresult GetDocument(mozilla::dom::Document **aDocument); \
  MOZ_BINDING(binding_to, idl, getter, XPIDL_nsIEditor_rootElement)\
  nsresult GetRootElement(mozilla::dom::Element **aRootElement); \
  MOZ_BINDING(binding_to, idl, getter, XPIDL_nsIEditor_selectionController)\
  nsresult GetSelectionController(nsISelectionController **aSelectionController); \
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_deleteSelection)\
  MOZ_CAN_RUN_SCRIPT nsresult DeleteSelection(int16_t action, int16_t stripWrappers); \
  MOZ_BINDING(binding_to, idl, getter, XPIDL_nsIEditor_documentIsEmpty)\
  nsresult GetDocumentIsEmpty(bool *aDocumentIsEmpty); \
  MOZ_BINDING(binding_to, idl, getter, XPIDL_nsIEditor_documentModified)\
  nsresult GetDocumentModified(bool *aDocumentModified); \
  MOZ_BINDING(binding_to, idl, getter, XPIDL_nsIEditor_documentCharacterSet)\
  nsresult GetDocumentCharacterSet(nsACString& aDocumentCharacterSet); \
  MOZ_BINDING(binding_to, idl, setter, XPIDL_nsIEditor_documentCharacterSet)\
  MOZ_CAN_RUN_SCRIPT nsresult SetDocumentCharacterSet(const nsACString& aDocumentCharacterSet); \
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_resetModificationCount)\
  MOZ_CAN_RUN_SCRIPT nsresult ResetModificationCount(void); \
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_getModificationCount)\
  nsresult GetModificationCount(int32_t *_retval); \
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_incrementModificationCount)\
  MOZ_CAN_RUN_SCRIPT nsresult IncrementModificationCount(int32_t aModCount); \
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_enableUndo)\
  nsresult EnableUndo(bool enable); \
  using nsIEditor::GetUndoRedoEnabled; \
  MOZ_BINDING(binding_to, idl, getter, XPIDL_nsIEditor_undoRedoEnabled)\
  nsresult GetUndoRedoEnabled(bool *aUndoRedoEnabled); \
  using nsIEditor::GetCanUndo; \
  MOZ_BINDING(binding_to, idl, getter, XPIDL_nsIEditor_canUndo)\
  nsresult GetCanUndo(bool *aCanUndo); \
  using nsIEditor::GetCanRedo; \
  MOZ_BINDING(binding_to, idl, getter, XPIDL_nsIEditor_canRedo)\
  nsresult GetCanRedo(bool *aCanRedo); \
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_clearUndoRedo)\
  nsresult ClearUndoRedoXPCOM(void); \
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_undo)\
  MOZ_CAN_RUN_SCRIPT nsresult Undo(void); \
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_undoAll)\
  MOZ_CAN_RUN_SCRIPT nsresult UndoAll(void); \
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_redo)\
  MOZ_CAN_RUN_SCRIPT nsresult Redo(void); \
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_beginTransaction)\
  MOZ_CAN_RUN_SCRIPT nsresult BeginTransaction(void); \
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_endTransaction)\
  MOZ_CAN_RUN_SCRIPT nsresult EndTransaction(void); \
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_getInlineSpellChecker)\
  nsresult GetInlineSpellChecker(bool autoCreate, nsIInlineSpellChecker **_retval); \
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_setSpellcheckUserOverride)\
  nsresult SetSpellcheckUserOverride(bool enable); \
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_cut)\
  MOZ_CAN_RUN_SCRIPT nsresult Cut(void); \
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_canCut)\
  MOZ_CAN_RUN_SCRIPT nsresult CanCut(bool *_retval); \
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_copy)\
  MOZ_CAN_RUN_SCRIPT nsresult Copy(void); \
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_canCopy)\
  MOZ_CAN_RUN_SCRIPT nsresult CanCopy(bool *_retval); \
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_paste)\
  MOZ_CAN_RUN_SCRIPT nsresult Paste(nsIClipboard::ClipboardType aClipboardType); \
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_pasteTransferable)\
  MOZ_CAN_RUN_SCRIPT nsresult PasteTransferable(nsITransferable *aTransferable); \
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_canPaste)\
  nsresult CanPaste(nsIClipboard::ClipboardType aClipboardType, bool *_retval); \
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_selectAll)\
  MOZ_CAN_RUN_SCRIPT nsresult SelectAll(void); \
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_beginningOfDocument)\
  MOZ_CAN_RUN_SCRIPT nsresult BeginningOfDocument(void); \
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_endOfDocument)\
  MOZ_CAN_RUN_SCRIPT nsresult EndOfDocument(void); \
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_setAttribute)\
  MOZ_CAN_RUN_SCRIPT nsresult SetAttribute(mozilla::dom::Element *aElement, const nsAString& attributestr, const nsAString& attvalue); \
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_removeAttribute)\
  MOZ_CAN_RUN_SCRIPT nsresult RemoveAttribute(mozilla::dom::Element *aElement, const nsAString& aAttribute); \
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_cloneAttributes)\
  MOZ_CAN_RUN_SCRIPT nsresult CloneAttributes(mozilla::dom::Element *aDestElement, mozilla::dom::Element *aSourceElement); \
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_insertNode)\
  MOZ_CAN_RUN_SCRIPT nsresult InsertNode(nsINode *node, nsINode *parent, uint32_t aPosition, bool aPreserveSelection, uint8_t _argc); \
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_deleteNode)\
  MOZ_CAN_RUN_SCRIPT nsresult DeleteNode(nsINode *child, bool aPreserveSelection, uint8_t _argc); \
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_outputToString)\
  nsresult OutputToString(const nsAString& formatType, uint32_t flags, nsAString& _retval); \
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_addEditActionListener)\
  nsresult AddEditActionListener(nsIEditActionListener *listener); \
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_removeEditActionListener)\
  nsresult RemoveEditActionListener(nsIEditActionListener *listener); \
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_addDocumentStateListener)\
  nsresult AddDocumentStateListener(nsIDocumentStateListener *listener); \
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_removeDocumentStateListener)\
  nsresult RemoveDocumentStateListener(nsIDocumentStateListener *listener); \
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_forceCompositionEnd)\
  nsresult ForceCompositionEnd(void); \
  MOZ_BINDING(binding_to, idl, getter, XPIDL_nsIEditor_composing)\
  nsresult GetComposing(bool *aComposing); \
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_unmask)\
  MOZ_CAN_RUN_SCRIPT nsresult Unmask(uint32_t aStart, int64_t aEnd, uint32_t aTimeout, uint8_t _argc); \
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_mask)\
  MOZ_CAN_RUN_SCRIPT nsresult Mask(void); \
  MOZ_BINDING(binding_to, idl, getter, XPIDL_nsIEditor_unmaskedStart)\
  nsresult GetUnmaskedStart(uint32_t *aUnmaskedStart); \
  MOZ_BINDING(binding_to, idl, getter, XPIDL_nsIEditor_unmaskedEnd)\
  nsresult GetUnmaskedEnd(uint32_t *aUnmaskedEnd); \
  MOZ_BINDING(binding_to, idl, getter, XPIDL_nsIEditor_autoMaskingEnabled)\
  nsresult GetAutoMaskingEnabled(bool *aAutoMaskingEnabled); \
  MOZ_BINDING(binding_to, idl, getter, XPIDL_nsIEditor_passwordMask)\
  nsresult GetPasswordMask(nsAString& aPasswordMask); \
  MOZ_BINDING(binding_to, idl, getter, XPIDL_nsIEditor_textLength)\
  nsresult GetTextLength(uint32_t *aTextLength); \
  MOZ_BINDING(binding_to, idl, getter, XPIDL_nsIEditor_newlineHandling)\
  nsresult GetNewlineHandling(int32_t *aNewlineHandling); \
  MOZ_BINDING(binding_to, idl, setter, XPIDL_nsIEditor_newlineHandling)\
  nsresult SetNewlineHandling(int32_t aNewlineHandling); \
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_insertText)\
  MOZ_CAN_RUN_SCRIPT nsresult InsertText(const nsAString& aStringToInsert); \
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIEditor_insertLineBreak)\
  MOZ_CAN_RUN_SCRIPT nsresult InsertLineBreak(void); \

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIEDITOR(_to) \
  NS_IMETHOD GetSelection(mozilla::dom::Selection **aSelection) override { return _to GetSelection(aSelection); } \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD SetAttributeOrEquivalent(mozilla::dom::Element *element, const nsAString& sourceAttrName, const nsAString& sourceAttrValue, bool aSuppressTransaction) override { return _to SetAttributeOrEquivalent(element, sourceAttrName, sourceAttrValue, aSuppressTransaction); } \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD RemoveAttributeOrEquivalent(mozilla::dom::Element *element, const nsAString& sourceAttrName, bool aSuppressTransaction) override { return _to RemoveAttributeOrEquivalent(element, sourceAttrName, aSuppressTransaction); } \
  NS_IMETHOD GetFlags(uint32_t *aFlags) override { return _to GetFlags(aFlags); } \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD SetFlags(uint32_t aFlags) override { return _to SetFlags(aFlags); } \
  NS_IMETHOD GetContentsMIMEType(nsAString& aContentsMIMEType) override { return _to GetContentsMIMEType(aContentsMIMEType); } \
  NS_IMETHOD SetContentsMIMEType(const nsAString& aContentsMIMEType) override { return _to SetContentsMIMEType(aContentsMIMEType); } \
  NS_IMETHOD GetIsDocumentEditable(bool *aIsDocumentEditable) override { return _to GetIsDocumentEditable(aIsDocumentEditable); } \
  NS_IMETHOD GetIsSelectionEditable(bool *aIsSelectionEditable) override { return _to GetIsSelectionEditable(aIsSelectionEditable); } \
  NS_IMETHOD GetDocument(mozilla::dom::Document **aDocument) override { return _to GetDocument(aDocument); } \
  NS_IMETHOD GetRootElement(mozilla::dom::Element **aRootElement) override { return _to GetRootElement(aRootElement); } \
  NS_IMETHOD GetSelectionController(nsISelectionController **aSelectionController) override { return _to GetSelectionController(aSelectionController); } \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD DeleteSelection(int16_t action, int16_t stripWrappers) override { return _to DeleteSelection(action, stripWrappers); } \
  NS_IMETHOD GetDocumentIsEmpty(bool *aDocumentIsEmpty) override { return _to GetDocumentIsEmpty(aDocumentIsEmpty); } \
  NS_IMETHOD GetDocumentModified(bool *aDocumentModified) override { return _to GetDocumentModified(aDocumentModified); } \
  NS_IMETHOD GetDocumentCharacterSet(nsACString& aDocumentCharacterSet) override { return _to GetDocumentCharacterSet(aDocumentCharacterSet); } \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD SetDocumentCharacterSet(const nsACString& aDocumentCharacterSet) override { return _to SetDocumentCharacterSet(aDocumentCharacterSet); } \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD ResetModificationCount(void) override { return _to ResetModificationCount(); } \
  NS_IMETHOD GetModificationCount(int32_t *_retval) override { return _to GetModificationCount(_retval); } \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD IncrementModificationCount(int32_t aModCount) override { return _to IncrementModificationCount(aModCount); } \
  NS_IMETHOD EnableUndo(bool enable) override { return _to EnableUndo(enable); } \
  using nsIEditor::GetUndoRedoEnabled; \
  NS_IMETHOD GetUndoRedoEnabled(bool *aUndoRedoEnabled) override { return _to GetUndoRedoEnabled(aUndoRedoEnabled); } \
  using nsIEditor::GetCanUndo; \
  NS_IMETHOD GetCanUndo(bool *aCanUndo) override { return _to GetCanUndo(aCanUndo); } \
  using nsIEditor::GetCanRedo; \
  NS_IMETHOD GetCanRedo(bool *aCanRedo) override { return _to GetCanRedo(aCanRedo); } \
  NS_IMETHOD ClearUndoRedoXPCOM(void) override { return _to ClearUndoRedoXPCOM(); } \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD Undo(void) override { return _to Undo(); } \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD UndoAll(void) override { return _to UndoAll(); } \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD Redo(void) override { return _to Redo(); } \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD BeginTransaction(void) override { return _to BeginTransaction(); } \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD EndTransaction(void) override { return _to EndTransaction(); } \
  NS_IMETHOD GetInlineSpellChecker(bool autoCreate, nsIInlineSpellChecker **_retval) override { return _to GetInlineSpellChecker(autoCreate, _retval); } \
  NS_IMETHOD SetSpellcheckUserOverride(bool enable) override { return _to SetSpellcheckUserOverride(enable); } \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD Cut(void) override { return _to Cut(); } \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD CanCut(bool *_retval) override { return _to CanCut(_retval); } \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD Copy(void) override { return _to Copy(); } \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD CanCopy(bool *_retval) override { return _to CanCopy(_retval); } \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD Paste(nsIClipboard::ClipboardType aClipboardType) override { return _to Paste(aClipboardType); } \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD PasteTransferable(nsITransferable *aTransferable) override { return _to PasteTransferable(aTransferable); } \
  NS_IMETHOD CanPaste(nsIClipboard::ClipboardType aClipboardType, bool *_retval) override { return _to CanPaste(aClipboardType, _retval); } \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD SelectAll(void) override { return _to SelectAll(); } \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD BeginningOfDocument(void) override { return _to BeginningOfDocument(); } \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD EndOfDocument(void) override { return _to EndOfDocument(); } \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD SetAttribute(mozilla::dom::Element *aElement, const nsAString& attributestr, const nsAString& attvalue) override { return _to SetAttribute(aElement, attributestr, attvalue); } \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD RemoveAttribute(mozilla::dom::Element *aElement, const nsAString& aAttribute) override { return _to RemoveAttribute(aElement, aAttribute); } \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD CloneAttributes(mozilla::dom::Element *aDestElement, mozilla::dom::Element *aSourceElement) override { return _to CloneAttributes(aDestElement, aSourceElement); } \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD InsertNode(nsINode *node, nsINode *parent, uint32_t aPosition, bool aPreserveSelection, uint8_t _argc) override { return _to InsertNode(node, parent, aPosition, aPreserveSelection, _argc); } \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD DeleteNode(nsINode *child, bool aPreserveSelection, uint8_t _argc) override { return _to DeleteNode(child, aPreserveSelection, _argc); } \
  NS_IMETHOD OutputToString(const nsAString& formatType, uint32_t flags, nsAString& _retval) override { return _to OutputToString(formatType, flags, _retval); } \
  NS_IMETHOD AddEditActionListener(nsIEditActionListener *listener) override { return _to AddEditActionListener(listener); } \
  NS_IMETHOD RemoveEditActionListener(nsIEditActionListener *listener) override { return _to RemoveEditActionListener(listener); } \
  NS_IMETHOD AddDocumentStateListener(nsIDocumentStateListener *listener) override { return _to AddDocumentStateListener(listener); } \
  NS_IMETHOD RemoveDocumentStateListener(nsIDocumentStateListener *listener) override { return _to RemoveDocumentStateListener(listener); } \
  NS_IMETHOD ForceCompositionEnd(void) override { return _to ForceCompositionEnd(); } \
  NS_IMETHOD GetComposing(bool *aComposing) override { return _to GetComposing(aComposing); } \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD Unmask(uint32_t aStart, int64_t aEnd, uint32_t aTimeout, uint8_t _argc) override { return _to Unmask(aStart, aEnd, aTimeout, _argc); } \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD Mask(void) override { return _to Mask(); } \
  NS_IMETHOD GetUnmaskedStart(uint32_t *aUnmaskedStart) override { return _to GetUnmaskedStart(aUnmaskedStart); } \
  NS_IMETHOD GetUnmaskedEnd(uint32_t *aUnmaskedEnd) override { return _to GetUnmaskedEnd(aUnmaskedEnd); } \
  NS_IMETHOD GetAutoMaskingEnabled(bool *aAutoMaskingEnabled) override { return _to GetAutoMaskingEnabled(aAutoMaskingEnabled); } \
  NS_IMETHOD GetPasswordMask(nsAString& aPasswordMask) override { return _to GetPasswordMask(aPasswordMask); } \
  NS_IMETHOD GetTextLength(uint32_t *aTextLength) override { return _to GetTextLength(aTextLength); } \
  NS_IMETHOD GetNewlineHandling(int32_t *aNewlineHandling) override { return _to GetNewlineHandling(aNewlineHandling); } \
  NS_IMETHOD SetNewlineHandling(int32_t aNewlineHandling) override { return _to SetNewlineHandling(aNewlineHandling); } \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD InsertText(const nsAString& aStringToInsert) override { return _to InsertText(aStringToInsert); } \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD InsertLineBreak(void) override { return _to InsertLineBreak(); } \

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIEDITOR(_to) \
  NS_IMETHOD GetSelection(mozilla::dom::Selection **aSelection) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetSelection(aSelection); } \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD SetAttributeOrEquivalent(mozilla::dom::Element *element, const nsAString& sourceAttrName, const nsAString& sourceAttrValue, bool aSuppressTransaction) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SetAttributeOrEquivalent(element, sourceAttrName, sourceAttrValue, aSuppressTransaction); } \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD RemoveAttributeOrEquivalent(mozilla::dom::Element *element, const nsAString& sourceAttrName, bool aSuppressTransaction) override { return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveAttributeOrEquivalent(element, sourceAttrName, aSuppressTransaction); } \
  NS_IMETHOD GetFlags(uint32_t *aFlags) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetFlags(aFlags); } \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD SetFlags(uint32_t aFlags) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SetFlags(aFlags); } \
  NS_IMETHOD GetContentsMIMEType(nsAString& aContentsMIMEType) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetContentsMIMEType(aContentsMIMEType); } \
  NS_IMETHOD SetContentsMIMEType(const nsAString& aContentsMIMEType) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SetContentsMIMEType(aContentsMIMEType); } \
  NS_IMETHOD GetIsDocumentEditable(bool *aIsDocumentEditable) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetIsDocumentEditable(aIsDocumentEditable); } \
  NS_IMETHOD GetIsSelectionEditable(bool *aIsSelectionEditable) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetIsSelectionEditable(aIsSelectionEditable); } \
  NS_IMETHOD GetDocument(mozilla::dom::Document **aDocument) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetDocument(aDocument); } \
  NS_IMETHOD GetRootElement(mozilla::dom::Element **aRootElement) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetRootElement(aRootElement); } \
  NS_IMETHOD GetSelectionController(nsISelectionController **aSelectionController) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetSelectionController(aSelectionController); } \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD DeleteSelection(int16_t action, int16_t stripWrappers) override { return !_to ? NS_ERROR_NULL_POINTER : _to->DeleteSelection(action, stripWrappers); } \
  NS_IMETHOD GetDocumentIsEmpty(bool *aDocumentIsEmpty) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetDocumentIsEmpty(aDocumentIsEmpty); } \
  NS_IMETHOD GetDocumentModified(bool *aDocumentModified) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetDocumentModified(aDocumentModified); } \
  NS_IMETHOD GetDocumentCharacterSet(nsACString& aDocumentCharacterSet) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetDocumentCharacterSet(aDocumentCharacterSet); } \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD SetDocumentCharacterSet(const nsACString& aDocumentCharacterSet) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SetDocumentCharacterSet(aDocumentCharacterSet); } \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD ResetModificationCount(void) override { return !_to ? NS_ERROR_NULL_POINTER : _to->ResetModificationCount(); } \
  NS_IMETHOD GetModificationCount(int32_t *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetModificationCount(_retval); } \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD IncrementModificationCount(int32_t aModCount) override { return !_to ? NS_ERROR_NULL_POINTER : _to->IncrementModificationCount(aModCount); } \
  NS_IMETHOD EnableUndo(bool enable) override { return !_to ? NS_ERROR_NULL_POINTER : _to->EnableUndo(enable); } \
  NS_IMETHOD GetUndoRedoEnabled(bool *aUndoRedoEnabled) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetUndoRedoEnabled(aUndoRedoEnabled); } \
  NS_IMETHOD GetCanUndo(bool *aCanUndo) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetCanUndo(aCanUndo); } \
  NS_IMETHOD GetCanRedo(bool *aCanRedo) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetCanRedo(aCanRedo); } \
  NS_IMETHOD ClearUndoRedoXPCOM(void) override { return !_to ? NS_ERROR_NULL_POINTER : _to->ClearUndoRedoXPCOM(); } \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD Undo(void) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Undo(); } \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD UndoAll(void) override { return !_to ? NS_ERROR_NULL_POINTER : _to->UndoAll(); } \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD Redo(void) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Redo(); } \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD BeginTransaction(void) override { return !_to ? NS_ERROR_NULL_POINTER : _to->BeginTransaction(); } \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD EndTransaction(void) override { return !_to ? NS_ERROR_NULL_POINTER : _to->EndTransaction(); } \
  NS_IMETHOD GetInlineSpellChecker(bool autoCreate, nsIInlineSpellChecker **_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetInlineSpellChecker(autoCreate, _retval); } \
  NS_IMETHOD SetSpellcheckUserOverride(bool enable) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SetSpellcheckUserOverride(enable); } \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD Cut(void) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Cut(); } \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD CanCut(bool *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->CanCut(_retval); } \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD Copy(void) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Copy(); } \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD CanCopy(bool *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->CanCopy(_retval); } \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD Paste(nsIClipboard::ClipboardType aClipboardType) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Paste(aClipboardType); } \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD PasteTransferable(nsITransferable *aTransferable) override { return !_to ? NS_ERROR_NULL_POINTER : _to->PasteTransferable(aTransferable); } \
  NS_IMETHOD CanPaste(nsIClipboard::ClipboardType aClipboardType, bool *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->CanPaste(aClipboardType, _retval); } \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD SelectAll(void) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SelectAll(); } \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD BeginningOfDocument(void) override { return !_to ? NS_ERROR_NULL_POINTER : _to->BeginningOfDocument(); } \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD EndOfDocument(void) override { return !_to ? NS_ERROR_NULL_POINTER : _to->EndOfDocument(); } \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD SetAttribute(mozilla::dom::Element *aElement, const nsAString& attributestr, const nsAString& attvalue) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SetAttribute(aElement, attributestr, attvalue); } \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD RemoveAttribute(mozilla::dom::Element *aElement, const nsAString& aAttribute) override { return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveAttribute(aElement, aAttribute); } \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD CloneAttributes(mozilla::dom::Element *aDestElement, mozilla::dom::Element *aSourceElement) override { return !_to ? NS_ERROR_NULL_POINTER : _to->CloneAttributes(aDestElement, aSourceElement); } \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD InsertNode(nsINode *node, nsINode *parent, uint32_t aPosition, bool aPreserveSelection, uint8_t _argc) override { return !_to ? NS_ERROR_NULL_POINTER : _to->InsertNode(node, parent, aPosition, aPreserveSelection, _argc); } \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD DeleteNode(nsINode *child, bool aPreserveSelection, uint8_t _argc) override { return !_to ? NS_ERROR_NULL_POINTER : _to->DeleteNode(child, aPreserveSelection, _argc); } \
  NS_IMETHOD OutputToString(const nsAString& formatType, uint32_t flags, nsAString& _retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->OutputToString(formatType, flags, _retval); } \
  NS_IMETHOD AddEditActionListener(nsIEditActionListener *listener) override { return !_to ? NS_ERROR_NULL_POINTER : _to->AddEditActionListener(listener); } \
  NS_IMETHOD RemoveEditActionListener(nsIEditActionListener *listener) override { return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveEditActionListener(listener); } \
  NS_IMETHOD AddDocumentStateListener(nsIDocumentStateListener *listener) override { return !_to ? NS_ERROR_NULL_POINTER : _to->AddDocumentStateListener(listener); } \
  NS_IMETHOD RemoveDocumentStateListener(nsIDocumentStateListener *listener) override { return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveDocumentStateListener(listener); } \
  NS_IMETHOD ForceCompositionEnd(void) override { return !_to ? NS_ERROR_NULL_POINTER : _to->ForceCompositionEnd(); } \
  NS_IMETHOD GetComposing(bool *aComposing) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetComposing(aComposing); } \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD Unmask(uint32_t aStart, int64_t aEnd, uint32_t aTimeout, uint8_t _argc) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Unmask(aStart, aEnd, aTimeout, _argc); } \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD Mask(void) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Mask(); } \
  NS_IMETHOD GetUnmaskedStart(uint32_t *aUnmaskedStart) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetUnmaskedStart(aUnmaskedStart); } \
  NS_IMETHOD GetUnmaskedEnd(uint32_t *aUnmaskedEnd) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetUnmaskedEnd(aUnmaskedEnd); } \
  NS_IMETHOD GetAutoMaskingEnabled(bool *aAutoMaskingEnabled) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetAutoMaskingEnabled(aAutoMaskingEnabled); } \
  NS_IMETHOD GetPasswordMask(nsAString& aPasswordMask) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetPasswordMask(aPasswordMask); } \
  NS_IMETHOD GetTextLength(uint32_t *aTextLength) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetTextLength(aTextLength); } \
  NS_IMETHOD GetNewlineHandling(int32_t *aNewlineHandling) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetNewlineHandling(aNewlineHandling); } \
  NS_IMETHOD SetNewlineHandling(int32_t aNewlineHandling) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SetNewlineHandling(aNewlineHandling); } \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD InsertText(const nsAString& aStringToInsert) override { return !_to ? NS_ERROR_NULL_POINTER : _to->InsertText(aStringToInsert); } \
  MOZ_CAN_RUN_SCRIPT NS_IMETHOD InsertLineBreak(void) override { return !_to ? NS_ERROR_NULL_POINTER : _to->InsertLineBreak(); } \


#endif /* __gen_nsIEditor_h__ */
