tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

nsIEditActionListener.idl (2931B)


      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 
      6 #include "nsISupports.idl"
      7 #include "domstubs.idl"
      8 
      9 webidl CharacterData;
     10 webidl Node;
     11 webidl Range;
     12 
     13 %{C++
     14 #include "mozilla/EditorDOMPoint.h"
     15 class nsINode;
     16 class nsIContent;
     17 %}
     18 
     19 [ref] native EditorRawDOMPointRef(mozilla::EditorDOMPointBase<nsINode*, nsIContent*>);
     20 
     21 /*
     22 Editor Action Listener interface to outside world
     23 */
     24 
     25 
     26 /**
     27 * A generic editor action listener interface.
     28 * <P>
     29 * nsIEditActionListener is the interface used by applications wishing to be notified
     30 * when the editor modifies the DOM tree.
     31 *
     32 * Note:  this is the wrong class to implement if you are interested in generic
     33 * change notifications.  For generic notifications, you should implement
     34 * nsIDocumentObserver.
     35 */
     36 [scriptable, uuid(b22907b1-ee93-11d2-8d50-000064657374)]
     37 interface nsIEditActionListener : nsISupports
     38 {
     39  /**
     40   * Called after the editor deletes a node.
     41   * @param aChild    The node to delete
     42   * @param aResult   The result of the delete node operation.
     43   */
     44  void DidDeleteNode(in Node aChild, in nsresult aResult);
     45 
     46  /**
     47   * Called after the editor joins 2 nodes.
     48   * @param aJoinedPoint   The joined point.  If aLeftNodeWasRemoved is true,
     49   *                       it points after inserted left node content in the
     50   *                       right node.  Otherwise, it points start of inserted
     51   *                       right node content in the left node.
     52   * @param aRemovedNode   The removed node.
     53   */
     54  [noscript]
     55  void DidJoinContents([const] in EditorRawDOMPointRef aJoinedPoint,
     56                       [const] in Node aRemovedNode);
     57 
     58  /**
     59   * Called after the editor inserts text.
     60   * @param aTextNode   This node getting inserted text.
     61   * @param aOffset     The offset in aTextNode to insert at.
     62   * @param aString     The string that gets inserted.
     63   * @param aResult     The result of the insert text operation.
     64   */
     65  void DidInsertText(in CharacterData       aTextNode,
     66                     in long                aOffset,
     67                     in AString             aString,
     68                     in nsresult            aResult);
     69 
     70  /**
     71   * Called before the editor deletes text.
     72   * @param aTextNode   This node getting text deleted.
     73   * @param aOffset     The offset in aTextNode to delete at.
     74   * @param aLength     The amount of text to delete.
     75   */
     76  void WillDeleteText(in CharacterData       aTextNode,
     77                      in long                aOffset,
     78                      in long                aLength);
     79 
     80  /**
     81   * Called before the editor deletes the ranges.
     82   * @param aRangesToDelete     The ranges to be deleted.
     83   */
     84  void WillDeleteRanges(in Array<Range> aRangesToDelete);
     85 };