~ubuntu-branches/ubuntu/precise/kompozer/precise

« back to all changes in this revision

Viewing changes to mozilla/editor/idl/nsIPlaintextEditor.idl

  • Committer: Bazaar Package Importer
  • Author(s): Anthony Yarusso
  • Date: 2007-08-27 01:11:03 UTC
  • Revision ID: james.westby@ubuntu.com-20070827011103-2jgf4s6532gqu2ka
Tags: upstream-0.7.10
ImportĀ upstreamĀ versionĀ 0.7.10

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
4
 *
 
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/
 
9
 *
 
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
 
13
 * License.
 
14
 *
 
15
 * The Original Code is mozilla.org code.
 
16
 *
 
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.
 
21
 *
 
22
 * Contributor(s):
 
23
 *
 
24
 *
 
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.
 
36
 *
 
37
 * ***** END LICENSE BLOCK ***** */
 
38
 
 
39
#include "nsISupports.idl"
 
40
 
 
41
%{C++
 
42
#include "nsIDOMKeyEvent.h"
 
43
%}
 
44
 
 
45
[ptr] native nsIDOMKeyEvent(nsIDOMKeyEvent);
 
46
 
 
47
[scriptable, uuid(b5f39ed4-1dd1-11b2-9d00-fd54d6f54962)]
 
48
interface nsIPlaintextEditor : nsISupports
 
49
{
 
50
 
 
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 */
 
63
 
 
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;
 
75
 
 
76
  /**
 
77
    * The length of the contents in characters.
 
78
    */
 
79
  readonly attribute long textLength;
 
80
 
 
81
  /**
 
82
    * The maximum number of characters allowed.
 
83
    */
 
84
  attribute long maxTextLength;
 
85
 
 
86
  /** Get and set the body wrap width.
 
87
    * 
 
88
    * Special values:
 
89
    *    0 = wrap to window width
 
90
    *   -1 = no wrap at all
 
91
    */
 
92
  attribute long wrapWidth;
 
93
 
 
94
  /** 
 
95
   * EditorKeyPress consumes a keyevent.
 
96
   * @param aKeyEvent    key event to consume
 
97
   */
 
98
  [noscript]void handleKeyPress(in nsIDOMKeyEvent aKeyEvent);
 
99
 
 
100
  /**
 
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.
 
105
   *
 
106
   * @param aString   the string to be inserted
 
107
   */
 
108
   void insertText(in DOMString aStringToInsert);
 
109
  
 
110
  /**
 
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.
 
115
   */
 
116
  void insertLineBreak();
 
117
};