2001-09-26 02:53:13 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
2004-04-18 18:21:17 +04:00
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
2000-11-17 03:10:37 +03:00
|
|
|
*
|
2004-04-18 18:21:17 +04:00
|
|
|
* The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
* the License. You may obtain a copy of the License at
|
|
|
|
* http://www.mozilla.org/MPL/
|
2000-11-17 03:10:37 +03:00
|
|
|
*
|
2001-09-26 02:53:13 +04:00
|
|
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
* for the specific language governing rights and limitations under the
|
|
|
|
* License.
|
2000-11-17 03:10:37 +03:00
|
|
|
*
|
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
2004-04-18 18:21:17 +04:00
|
|
|
* The Initial Developer of the Original Code is
|
2001-09-26 02:53:13 +04:00
|
|
|
* Netscape Communications Corporation.
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 1998
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
2000-11-17 03:10:37 +03:00
|
|
|
*
|
2001-09-26 02:53:13 +04:00
|
|
|
* Contributor(s):
|
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
2004-04-18 18:21:17 +04:00
|
|
|
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
|
|
|
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
2001-09-26 02:53:13 +04:00
|
|
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
* of those above. If you wish to allow use of your version of this file only
|
|
|
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
2004-04-18 18:21:17 +04:00
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
2001-09-26 02:53:13 +04:00
|
|
|
* decision by deleting the provisions above and replace them with the notice
|
|
|
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
* the provisions above, a recipient may use your version of this file under
|
2004-04-18 18:21:17 +04:00
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
2001-09-26 02:53:13 +04:00
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
2000-11-17 03:10:37 +03:00
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
|
2005-12-20 23:12:54 +03:00
|
|
|
interface nsIDOMKeyEvent;
|
2000-11-17 03:10:37 +03:00
|
|
|
|
2007-06-28 06:48:16 +04:00
|
|
|
[scriptable, uuid(35d74f2b-3d03-43c5-8ace-9d90c3e31244)]
|
2000-11-17 03:10:37 +03:00
|
|
|
interface nsIPlaintextEditor : nsISupports
|
|
|
|
{
|
2001-01-28 23:13:07 +03:00
|
|
|
|
2007-06-28 06:48:16 +04:00
|
|
|
// XXX Why aren't these in nsIEditor?
|
|
|
|
const long eEditorPlaintextMask = 0x0001; /* only plain text entry is allowed via events */
|
|
|
|
const long eEditorSingleLineMask = 0x0002; /* enter key and CR-LF handled specially */
|
|
|
|
const long eEditorPasswordMask = 0x0004; /* text is not entered into content, only a representative character */
|
|
|
|
const long eEditorReadonlyMask = 0x0008; /* editing events are disabled. Editor may still accept focus. */
|
|
|
|
const long eEditorDisabledMask = 0x0010; /* all events are disabled (like scrolling). Editor will not accept focus. */
|
|
|
|
const long eEditorFilterInputMask = 0x0020; /* text input is limited to certain character types, use mFilter */
|
|
|
|
const long eEditorMailMask = 0x0040; /* use mail-compose editing rules */
|
|
|
|
const long eEditorUseAsyncUpdatesMask = 0x0080; /* prevent immediate reflows and view refreshes */
|
|
|
|
const long eEditorEnableWrapHackMask = 0x0100; /* allow the editor to set font: monospace on the root node */
|
|
|
|
const long eEditorWidgetMask = 0x0200; /* bit for widgets */
|
|
|
|
const long eEditorNoCSSMask = 0x0400; /* this HTML editor should not create css styles */
|
|
|
|
const long eEditorAllowInteraction = 0x0800; /* */
|
2002-02-05 18:16:14 +03:00
|
|
|
|
2005-12-20 23:12:54 +03:00
|
|
|
/*
|
|
|
|
* The valid values for newlines handling.
|
|
|
|
* Can't change the values unless we remove
|
|
|
|
* use of the pref.
|
|
|
|
*/
|
|
|
|
const long eNewlinesPasteIntact = 0;
|
|
|
|
const long eNewlinesPasteToFirst = 1;
|
|
|
|
const long eNewlinesReplaceWithSpaces = 2;
|
|
|
|
const long eNewlinesStrip = 3;
|
|
|
|
const long eNewlinesReplaceWithCommas = 4;
|
|
|
|
const long eNewlinesStripSurroundingWhitespace = 5;
|
|
|
|
|
2000-11-17 03:10:37 +03:00
|
|
|
/**
|
|
|
|
* The length of the contents in characters.
|
2005-10-17 04:54:02 +04:00
|
|
|
* XXX change this type to 'unsigned long'
|
2000-11-17 03:10:37 +03:00
|
|
|
*/
|
|
|
|
readonly attribute long textLength;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The maximum number of characters allowed.
|
2005-10-17 04:54:02 +04:00
|
|
|
* default: -1 (unlimited).
|
2000-11-17 03:10:37 +03:00
|
|
|
*/
|
|
|
|
attribute long maxTextLength;
|
|
|
|
|
|
|
|
/** Get and set the body wrap width.
|
|
|
|
*
|
|
|
|
* Special values:
|
|
|
|
* 0 = wrap to window width
|
|
|
|
* -1 = no wrap at all
|
|
|
|
*/
|
2001-01-09 00:01:29 +03:00
|
|
|
attribute long wrapWidth;
|
2000-11-17 03:10:37 +03:00
|
|
|
|
2005-12-20 23:12:54 +03:00
|
|
|
/** Get and set newline handling.
|
|
|
|
*
|
|
|
|
* Values are the constants defined above.
|
|
|
|
*/
|
|
|
|
attribute long newlineHandling;
|
|
|
|
|
2000-11-17 03:10:37 +03:00
|
|
|
/**
|
|
|
|
* EditorKeyPress consumes a keyevent.
|
|
|
|
* @param aKeyEvent key event to consume
|
|
|
|
*/
|
2005-12-20 23:12:54 +03:00
|
|
|
void handleKeyPress(in nsIDOMKeyEvent aKeyEvent);
|
2000-11-17 03:10:37 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Inserts a string at the current location,
|
|
|
|
* given by the selection.
|
|
|
|
* If the selection is not collapsed, the selection is deleted
|
|
|
|
* and the insertion takes place at the resulting collapsed selection.
|
|
|
|
*
|
|
|
|
* @param aString the string to be inserted
|
|
|
|
*/
|
2001-04-07 04:45:26 +04:00
|
|
|
void insertText(in DOMString aStringToInsert);
|
2003-04-22 22:11:12 +04:00
|
|
|
|
2000-11-17 03:10:37 +03:00
|
|
|
/**
|
|
|
|
* Insert a line break into the content model.
|
|
|
|
* The interpretation of a break is up to the implementation:
|
|
|
|
* it may enter a character, split a node in the tree, etc.
|
|
|
|
* This may be more efficient than calling InsertText with a newline.
|
|
|
|
*/
|
|
|
|
void insertLineBreak();
|
|
|
|
};
|