1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2
/* ***** BEGIN LICENSE BLOCK *****
3
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
5
* The contents of this file are subject to the Netscape Public License
6
* Version 1.1 (the "License"); you may not use this file except in
7
* compliance with the License. You may obtain a copy of the License at
8
* http://www.mozilla.org/NPL/
10
* Software distributed under the License is distributed on an "AS IS" basis,
11
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12
* for the specific language governing rights and limitations under the
15
* The Original Code is mozilla.org code.
17
* The Initial Developer of the Original Code is
18
* Netscape Communications Corporation.
19
* Portions created by the Initial Developer are Copyright (C) 1998
20
* the Initial Developer. All Rights Reserved.
25
* Alternatively, the contents of this file may be used under the terms of
26
* either the GNU General Public License Version 2 or later (the "GPL"), or
27
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
28
* in which case the provisions of the GPL or the LGPL are applicable instead
29
* of those above. If you wish to allow use of your version of this file only
30
* under the terms of either the GPL or the LGPL, and not to allow others to
31
* use your version of this file under the terms of the NPL, indicate your
32
* decision by deleting the provisions above and replace them with the notice
33
* and other provisions required by the GPL or the LGPL. If you do not delete
34
* the provisions above, a recipient may use your version of this file under
35
* the terms of any one of the NPL, the GPL or the LGPL.
37
* ***** END LICENSE BLOCK ***** */
39
#include "nsISupports.idl"
42
#include "nsIDOMKeyEvent.h"
45
[ptr] native nsIDOMKeyEvent(nsIDOMKeyEvent);
47
[scriptable, uuid(b5f39ed4-1dd1-11b2-9d00-fd54d6f54962)]
48
interface nsIPlaintextEditor : nsISupports
51
/* the bits in an editor behavior mask. */
52
const short eEditorPlaintextBit = 0; /* only plain text entry is allowed via events */
53
const short eEditorSingleLineBit = 1; /* enter key and CR-LF handled specially */
54
const short eEditorPasswordBit = 2; /* text is not entered into content, only a representative character */
55
const short eEditorReadonlyBit = 3; /* editing events are disabled. Editor may still accept focus. */
56
const short eEditorDisabledBit = 4; /* all events are disabled (like scrolling). Editor will not accept focus. */
57
const short eEditorFilterInputBit = 5; /* text input is limited to certain character types, use mFilter */
58
const short eEditorMailBit = 6; /* use mail-compose editting rules */
59
const short eEditorUseAsyncUpdatesBit = 7; /* prevent immediate reflows and view refreshes */
60
const short eEditorEnableWrapHackBit = 8; /* allow the editor to set font: monospace on the root node */
61
const short eEditorWidgetBit = 9; /* bit for widgets */
62
const short eEditorNoCSSBit = 10; /* this HTML editor should not create css styles */
64
const long eEditorPlaintextMask = 1;
65
const long eEditorSingleLineMask = 2;
66
const long eEditorPasswordMask = 4;
67
const long eEditorReadonlyMask = 8;
68
const long eEditorDisabledMask = 16;
69
const long eEditorFilterInputMask = 32;
70
const long eEditorMailMask = 64;
71
const long eEditorUseAsyncUpdatesMask = 128;
72
const long eEditorEnableWrapHackMask = 256;
73
const long eEditorWidgetMask = 512;
74
const long eEditorNoCSSMask = 1024;
77
* The length of the contents in characters.
79
readonly attribute long textLength;
82
* The maximum number of characters allowed.
84
attribute long maxTextLength;
86
/** Get and set the body wrap width.
89
* 0 = wrap to window width
92
attribute long wrapWidth;
95
* EditorKeyPress consumes a keyevent.
96
* @param aKeyEvent key event to consume
98
[noscript]void handleKeyPress(in nsIDOMKeyEvent aKeyEvent);
101
* Inserts a string at the current location,
102
* given by the selection.
103
* If the selection is not collapsed, the selection is deleted
104
* and the insertion takes place at the resulting collapsed selection.
106
* @param aString the string to be inserted
108
void insertText(in DOMString aStringToInsert);
111
* Insert a line break into the content model.
112
* The interpretation of a break is up to the implementation:
113
* it may enter a character, split a node in the tree, etc.
114
* This may be more efficient than calling InsertText with a newline.
116
void insertLineBreak();