editor/idl/nsIPlaintextEditor.idl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/editor/idl/nsIPlaintextEditor.idl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,112 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 + 
     1.9 +#include "nsISupports.idl"
    1.10 +
    1.11 +[scriptable, uuid(07b6d070-ccea-4a00-84b4-f4b94dd9eb52)]
    1.12 +interface nsIPlaintextEditor : nsISupports
    1.13 +{
    1.14 +
    1.15 +  // XXX Why aren't these in nsIEditor?
    1.16 +  // only plain text entry is allowed via events
    1.17 +  const long eEditorPlaintextMask       = 0x0001;
    1.18 +  // enter key and CR-LF handled specially
    1.19 +  const long eEditorSingleLineMask      = 0x0002;
    1.20 +  // text is not entered into content, only a representative character
    1.21 +  const long eEditorPasswordMask        = 0x0004;
    1.22 +  // editing events are disabled.  Editor may still accept focus.
    1.23 +  const long eEditorReadonlyMask        = 0x0008;
    1.24 +  // all events are disabled (like scrolling).  Editor will not accept focus.
    1.25 +  const long eEditorDisabledMask        = 0x0010;
    1.26 +  // text input is limited to certain character types, use mFilter
    1.27 +  const long eEditorFilterInputMask     = 0x0020;
    1.28 +  // use mail-compose editing rules
    1.29 +  const long eEditorMailMask            = 0x0040;
    1.30 +  // allow the editor to set font: monospace on the root node
    1.31 +  const long eEditorEnableWrapHackMask  = 0x0080;
    1.32 +  // bit for widgets (form elements)
    1.33 +  const long eEditorWidgetMask          = 0x0100;
    1.34 +  // this HTML editor should not create css styles
    1.35 +  const long eEditorNoCSSMask           = 0x0200;
    1.36 +  // whether HTML document specific actions are executed or not.
    1.37 +  // e.g., if this flag is set, the editor doesn't handle Tab key.
    1.38 +  // besides, anchors of HTML are not clickable.
    1.39 +  const long eEditorAllowInteraction    = 0x0400;
    1.40 +  // when this is set, the characters in password editor are always masked.
    1.41 +  // see bug 530367 for the detail.
    1.42 +  const long eEditorDontEchoPassword    = 0x0800;
    1.43 +  // when this flag is set, the internal direction of the editor is RTL.
    1.44 +  // if neither of the direction flags are set, the direction is determined
    1.45 +  // from the text control's content node.
    1.46 +  const long eEditorRightToLeft         = 0x1000;
    1.47 +  // when this flag is set, the internal direction of the editor is LTR.
    1.48 +  const long eEditorLeftToRight         = 0x2000;
    1.49 +  // when this flag is set, the editor's text content is not spell checked.
    1.50 +  const long eEditorSkipSpellCheck      = 0x4000;
    1.51 +
    1.52 +  /*
    1.53 +   * The valid values for newlines handling.
    1.54 +   * Can't change the values unless we remove
    1.55 +   * use of the pref.
    1.56 +   */
    1.57 +  const long eNewlinesPasteIntact                = 0;
    1.58 +  const long eNewlinesPasteToFirst               = 1;
    1.59 +  const long eNewlinesReplaceWithSpaces          = 2;
    1.60 +  const long eNewlinesStrip                      = 3;
    1.61 +  const long eNewlinesReplaceWithCommas          = 4;
    1.62 +  const long eNewlinesStripSurroundingWhitespace = 5;
    1.63 +
    1.64 +  /**
    1.65 +    * The length of the contents in characters.
    1.66 +    * XXX change this type to 'unsigned long'
    1.67 +    */
    1.68 +  readonly attribute long textLength;
    1.69 +
    1.70 +  /**
    1.71 +    * The maximum number of characters allowed.
    1.72 +    *   default: -1 (unlimited).
    1.73 +    */
    1.74 +  attribute long maxTextLength;
    1.75 +
    1.76 +  /** Get and set the body wrap width.
    1.77 +    * 
    1.78 +    * Special values:
    1.79 +    *    0 = wrap to window width
    1.80 +    *   -1 = no wrap at all
    1.81 +    */
    1.82 +  attribute long wrapWidth;
    1.83 +
    1.84 +  /**
    1.85 +   * Similar to the setter for wrapWidth, but just sets the editor
    1.86 +   * internal state without actually changing the content being edited
    1.87 +   * to wrap at that column.  This should only be used by callers who
    1.88 +   * are sure that their content is already set up correctly.
    1.89 +   */
    1.90 +  void setWrapColumn(in long aWrapColumn);
    1.91 +
    1.92 +  /** Get and set newline handling.
    1.93 +   *
    1.94 +   *  Values are the constants defined above.
    1.95 +   */
    1.96 +  attribute long newlineHandling;
    1.97 +
    1.98 +  /**
    1.99 +   * Inserts a string at the current location,
   1.100 +   * given by the selection.
   1.101 +   * If the selection is not collapsed, the selection is deleted
   1.102 +   * and the insertion takes place at the resulting collapsed selection.
   1.103 +   *
   1.104 +   * @param aString   the string to be inserted
   1.105 +   */
   1.106 +   void insertText(in DOMString aStringToInsert);
   1.107 +  
   1.108 +  /**
   1.109 +   * Insert a line break into the content model.
   1.110 +   * The interpretation of a break is up to the implementation:
   1.111 +   * it may enter a character, split a node in the tree, etc.
   1.112 +   * This may be more efficient than calling InsertText with a newline.
   1.113 +   */
   1.114 +  void insertLineBreak();
   1.115 +};

mercurial