Bug 1509459 - Get the flexbox highlighter state if the highlighter is ready in the...
[gecko.git] / editor / nsIPlaintextEditor.idl
blobe27d77e66732789e2c80fcf85e3df13cf30e0d0f
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/. */
6 #include "nsISupports.idl"
8 [scriptable, builtinclass, uuid(b74fb158-1265-4102-91eb-edd0136b49f8)]
9 interface nsIPlaintextEditor : nsISupports
12 // XXX Why aren't these in nsIEditor?
13 // only plain text entry is allowed via events
14 const long eEditorPlaintextMask = 0x0001;
15 // enter key and CR-LF handled specially
16 const long eEditorSingleLineMask = 0x0002;
17 // text is not entered into content, only a representative character
18 const long eEditorPasswordMask = 0x0004;
19 // editing events are disabled. Editor may still accept focus.
20 const long eEditorReadonlyMask = 0x0008;
21 // all events are disabled (like scrolling). Editor will not accept focus.
22 const long eEditorDisabledMask = 0x0010;
23 // text input is limited to certain character types, use mFilter
24 const long eEditorFilterInputMask = 0x0020;
25 // use mail-compose editing rules
26 const long eEditorMailMask = 0x0040;
27 // allow the editor to set font: monospace on the root node
28 const long eEditorEnableWrapHackMask = 0x0080;
29 // bit for widgets (form elements)
30 const long eEditorWidgetMask = 0x0100;
31 // this HTML editor should not create css styles
32 const long eEditorNoCSSMask = 0x0200;
33 // whether HTML document specific actions are executed or not.
34 // e.g., if this flag is set, the editor doesn't handle Tab key.
35 // besides, anchors of HTML are not clickable.
36 const long eEditorAllowInteraction = 0x0400;
37 // when this is set, the characters in password editor are always masked.
38 // see bug 530367 for the detail.
39 const long eEditorDontEchoPassword = 0x0800;
40 // when this flag is set, the internal direction of the editor is RTL.
41 // if neither of the direction flags are set, the direction is determined
42 // from the text control's content node.
43 const long eEditorRightToLeft = 0x1000;
44 // when this flag is set, the internal direction of the editor is LTR.
45 const long eEditorLeftToRight = 0x2000;
46 // when this flag is set, the editor's text content is not spell checked.
47 const long eEditorSkipSpellCheck = 0x4000;
50 * The valid values for newlines handling.
51 * Can't change the values unless we remove
52 * use of the pref.
54 const long eNewlinesPasteIntact = 0;
55 const long eNewlinesPasteToFirst = 1;
56 const long eNewlinesReplaceWithSpaces = 2;
57 const long eNewlinesStrip = 3;
58 const long eNewlinesReplaceWithCommas = 4;
59 const long eNewlinesStripSurroundingWhitespace = 5;
61 /**
62 * The length of the contents in characters.
63 * XXX change this type to 'unsigned long'
65 readonly attribute long textLength;
67 /** Get and set the body wrap width.
69 * Special values:
70 * 0 = wrap to window width
71 * -1 = no wrap at all
73 attribute long wrapWidth;
75 /**
76 * Similar to the setter for wrapWidth, but just sets the editor
77 * internal state without actually changing the content being edited
78 * to wrap at that column. This should only be used by callers who
79 * are sure that their content is already set up correctly.
81 void setWrapColumn(in long aWrapColumn);
83 /** Get and set newline handling.
85 * Values are the constants defined above.
87 attribute long newlineHandling;
89 /**
90 * Inserts a string at the current location,
91 * given by the selection.
92 * If the selection is not collapsed, the selection is deleted
93 * and the insertion takes place at the resulting collapsed selection.
95 * @param aString the string to be inserted
97 void insertText(in AString aStringToInsert);
99 /**
100 * Insert a line break into the content model.
101 * The interpretation of a break is up to the implementation:
102 * it may enter a character, split a node in the tree, etc.
103 * This may be more efficient than calling InsertText with a newline.
105 void insertLineBreak();