editor/composer/public/nsIEditingSession.idl

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     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"
     7 #include "domstubs.idl"
     9 interface nsIEditor;
    11 [scriptable, uuid(24f3f4da-18a4-448d-876d-7360fefac029)]
    13 interface nsIEditingSession : nsISupports
    14 {
    15   /**
    16    *  Error codes when we fail to create an editor
    17    *  is placed in attribute editorStatus
    18    */
    19   const long eEditorOK = 0;
    20   const long eEditorCreationInProgress = 1;
    21   const long eEditorErrorCantEditMimeType = 2;
    22   const long eEditorErrorFileNotFound = 3;
    23   const long eEditorErrorCantEditFramesets = 8;
    24   const long eEditorErrorUnknown = 9;
    26   /**
    27    *  Status after editor creation and document loading
    28    *  Value is one of the above error codes
    29    */
    30   readonly attribute unsigned long editorStatus;
    32   /**
    33    *  Make this window editable
    34    *  @param aWindow nsIDOMWindow, the window the embedder needs to make editable
    35    *  @param aEditorType string, "html" "htmlsimple" "text" "textsimple"
    36    *  @param aMakeWholeDocumentEditable if PR_TRUE make the whole document in
    37    *                                    aWindow editable, otherwise it's the
    38    *                                    embedder who should make the document
    39    *                                    (or part of it) editable.
    40    *  @param aInteractive if PR_FALSE turn off scripting and plugins
    41    */
    42   void makeWindowEditable(in nsIDOMWindow window, in string aEditorType,
    43                           in boolean doAfterUriLoad,
    44                           in boolean aMakeWholeDocumentEditable,
    45                           in boolean aInteractive);
    47   /**
    48    *  Test whether a specific window has had its editable flag set; it may have an editor
    49    *  now, or will get one after the uri load.
    50    *  
    51    *  Use this, passing the content root window, to test if we've set up editing
    52    *  for this content.
    53    */
    54   boolean windowIsEditable(in nsIDOMWindow window);
    56   /**
    57    *  Get the editor for this window. May return null
    58    */
    59 	nsIEditor getEditorForWindow(in nsIDOMWindow window);	
    61   /** 
    62    *  Setup editor and related support objects
    63    */
    64   void setupEditorOnWindow(in nsIDOMWindow window);
    66   /** 
    67    *   Destroy editor and related support objects
    68    */
    69   void tearDownEditorOnWindow(in nsIDOMWindow window);
    71   void setEditorOnControllers(in nsIDOMWindow aWindow,
    72                               in nsIEditor aEditor);
    74   /**
    75    * Disable scripts and plugins in aWindow.
    76    */
    77   void disableJSAndPlugins(in nsIDOMWindow aWindow);
    79   /**
    80    * Restore JS and plugins (enable/disable them) according to the state they
    81    * were before the last call to disableJSAndPlugins.
    82    */
    83   void restoreJSAndPlugins(in nsIDOMWindow aWindow);
    85   /**
    86    * Removes all the editor's controllers/listeners etc and makes the window
    87    * uneditable.
    88    */
    89   void detachFromWindow(in nsIDOMWindow aWindow);
    91   /**
    92    * Undos detachFromWindow(), reattaches this editing session/editor
    93    * to the window.
    94    */
    95   void reattachToWindow(in nsIDOMWindow aWindow);
    97   /**
    98    * Whether this session has disabled JS and plugins.
    99    */
   100   readonly attribute boolean jsAndPluginsDisabled;
   101 };

mercurial