Bug 1060051 - Make editor related interfaces builtin classes if it's possible r?ehsan, smaug
If we make nsIEditor a builtin class, that means that its instance can be only TextEditor or HTMLEditor. Then, users of nsIEditor can use concrete classes such as EditorBase, TextEditor or HTMLEditor instead. Then, the users can reduce unnecessary QI and a lot of virtual calls if we'll create non-virtual methods.
So, let's make editor related interfaces builtin classes.
MozReview-Commit-ID: 93WfsSDuJiJ
--- a/editor/composer/nsIEditingSession.idl
+++ b/editor/composer/nsIEditingSession.idl
@@ -4,17 +4,17 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsISupports.idl"
#include "domstubs.idl"
interface mozIDOMWindowProxy;
interface nsIEditor;
-[scriptable, uuid(24f963d1-e6fc-43ea-a206-99ac5fcc5265)]
+[scriptable, builtinclass, uuid(24f963d1-e6fc-43ea-a206-99ac5fcc5265)]
interface nsIEditingSession : nsISupports
{
/**
* Error codes when we fail to create an editor
* is placed in attribute editorStatus
*/
const long eEditorOK = 0;
--- a/editor/nsIEditor.idl
+++ b/editor/nsIEditor.idl
@@ -26,17 +26,17 @@ namespace mozilla {
namespace widget {
struct IMEState;
} // namespace widget
} // namespace mozilla
%}
native IMEState(mozilla::widget::IMEState);
-[scriptable, uuid(094be624-f0bf-400f-89e2-6a84baab9474)]
+[scriptable, builtinclass, uuid(094be624-f0bf-400f-89e2-6a84baab9474)]
interface nsIEditor : nsISupports
{
%{C++
typedef short EDirection;
typedef short EStripWrappers;
%}
const short eNone = 0;
const short eNext = 1;
--- a/editor/nsIEditorMailSupport.idl
+++ b/editor/nsIEditorMailSupport.idl
@@ -3,17 +3,17 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsISupports.idl"
interface nsIArray;
interface nsIDOMNode;
-[scriptable, uuid(fdf23301-4a94-11d3-9ce4-9960496c41bc)]
+[scriptable, builtinclass, uuid(fdf23301-4a94-11d3-9ce4-9960496c41bc)]
interface nsIEditorMailSupport : nsISupports
{
/** Paste the text in the OS clipboard at the cursor position,
* as a quotation (whose representation is dependant on the editor type),
* replacing the selected text (if any).
* @param aSelectionType Text or html?
*/
--- a/editor/nsIEditorStyleSheets.idl
+++ b/editor/nsIEditorStyleSheets.idl
@@ -1,16 +1,16 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsISupports.idl"
-[scriptable, uuid(4805e682-49b9-11d3-9ce4-ed60bd6cb5bc)]
+[scriptable, builtinclass, uuid(4805e682-49b9-11d3-9ce4-ed60bd6cb5bc)]
interface nsIEditorStyleSheets : nsISupports
{
/** Load and apply the style sheet, specified by aURL, to the
* editor's document, replacing the last style sheet added (if any).
* This is always asynchronous, and may cause network I/O.
*
* @param aURL The style sheet to be loaded and applied.
--- a/editor/nsIEditorUtils.idl
+++ b/editor/nsIEditorUtils.idl
@@ -5,17 +5,17 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsISupports.idl"
#include "domstubs.idl"
interface nsIDOMBlob;
interface mozIDOMWindowProxy;
-[scriptable, uuid(eb8b8ad9-5d8f-43bd-8ce5-5b943c180d56)]
+[scriptable, builtinclass, uuid(eb8b8ad9-5d8f-43bd-8ce5-5b943c180d56)]
interface nsIEditorBlobListener : nsISupports
{
void onResult(in ACString aResult);
void onError(in AString aErrorName);
};
/**
* A collection of utility functions that editors can use that are more easily
--- a/editor/nsIHTMLAbsPosEditor.idl
+++ b/editor/nsIHTMLAbsPosEditor.idl
@@ -1,17 +1,17 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsISupports.idl"
#include "domstubs.idl"
-[scriptable, uuid(91375f52-20e6-4757-9835-eb04fabe5498)]
+[scriptable, builtinclass, uuid(91375f52-20e6-4757-9835-eb04fabe5498)]
interface nsIHTMLAbsPosEditor : nsISupports
{
/**
* true if the selection container is absolutely positioned
*/
readonly attribute boolean selectionContainerAbsolutelyPositioned;
--- a/editor/nsIHTMLEditor.idl
+++ b/editor/nsIHTMLEditor.idl
@@ -17,17 +17,17 @@ namespace mozilla {
namespace dom {
class Element;
}
}
%}
[ptr] native Element (mozilla::dom::Element);
-[scriptable, uuid(87ee993e-985f-4a43-a974-0d9512da2fb0)]
+[scriptable, builtinclass, uuid(87ee993e-985f-4a43-a974-0d9512da2fb0)]
interface nsIHTMLEditor : nsISupports
{
%{C++
typedef short EAlignment;
%}
// used by GetAlignment()
const short eLeft = 0;
--- a/editor/nsIHTMLInlineTableEditor.idl
+++ b/editor/nsIHTMLInlineTableEditor.idl
@@ -1,17 +1,17 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsISupports.idl"
#include "domstubs.idl"
-[scriptable, uuid(eda2e65c-a758-451f-9b05-77cb8de74ed2)]
+[scriptable, builtinclass, uuid(eda2e65c-a758-451f-9b05-77cb8de74ed2)]
interface nsIHTMLInlineTableEditor : nsISupports
{
/**
* boolean indicating if inline table editing is enabled in the editor.
* When inline table editing is enabled, and when the selection is
* contained in a table cell, special buttons allowing to add/remove
* a line/column are available on the cell's border.
--- a/editor/nsIHTMLObjectResizer.idl
+++ b/editor/nsIHTMLObjectResizer.idl
@@ -1,17 +1,17 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsISupports.idl"
#include "domstubs.idl"
-[scriptable, uuid(8b396020-69d3-451f-80c1-1a96a7da25a9)]
+[scriptable, builtinclass, uuid(8b396020-69d3-451f-80c1-1a96a7da25a9)]
interface nsIHTMLObjectResizer : nsISupports
{
%{C++
typedef short EResizerLocation;
%}
const short eTopLeft = 0;
const short eTop = 1;
--- a/editor/nsIPlaintextEditor.idl
+++ b/editor/nsIPlaintextEditor.idl
@@ -1,16 +1,16 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsISupports.idl"
-[scriptable, uuid(b74fb158-1265-4102-91eb-edd0136b49f8)]
+[scriptable, builtinclass, uuid(b74fb158-1265-4102-91eb-edd0136b49f8)]
interface nsIPlaintextEditor : nsISupports
{
// XXX Why aren't these in nsIEditor?
// only plain text entry is allowed via events
const long eEditorPlaintextMask = 0x0001;
// enter key and CR-LF handled specially
const long eEditorSingleLineMask = 0x0002;
--- a/editor/nsITableEditor.idl
+++ b/editor/nsITableEditor.idl
@@ -5,17 +5,17 @@
#include "nsISupports.idl"
interface nsIDOMNode;
interface nsIDOMElement;
interface nsIDOMRange;
-[scriptable, uuid(4805e684-49b9-11d3-9ce4-ed60bd6cb5bc)]
+[scriptable, builtinclass, uuid(4805e684-49b9-11d3-9ce4-ed60bd6cb5bc)]
interface nsITableEditor : nsISupports
{
const short eNoSearch = 0;
const short ePreviousColumn = 1;
const short ePreviousRow = 2;
/* ------------ Table editing Methods -------------- */