1999-06-10 19:52:49 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
*
|
|
|
|
* The contents of this file are subject to the Netscape Public License
|
|
|
|
* Version 1.0 (the "NPL"); you may not use this file except in
|
|
|
|
* compliance with the NPL. You may obtain a copy of the NPL at
|
|
|
|
* http://www.mozilla.org/NPL/
|
|
|
|
*
|
|
|
|
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
|
|
|
* for the specific language governing rights and limitations under the
|
|
|
|
* NPL.
|
|
|
|
*
|
|
|
|
* The Initial Developer of this code under the NPL is Netscape
|
|
|
|
* Communications Corporation. Portions created by Netscape are
|
|
|
|
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
|
|
|
* Reserved.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
#include "domstubs.idl"
|
1999-06-22 21:36:45 +00:00
|
|
|
#include "nsIFileSpec.idl"
|
1999-06-10 19:52:49 +00:00
|
|
|
|
|
|
|
%{C++
|
|
|
|
|
|
|
|
class nsIDOMWindow;
|
|
|
|
class nsIDOMDocument;
|
|
|
|
class nsIDOMSelection;
|
|
|
|
class nsIDOMElement;
|
|
|
|
%}
|
|
|
|
|
1999-06-22 03:47:00 +00:00
|
|
|
interface nsIFileSpec;
|
1999-06-10 19:52:49 +00:00
|
|
|
|
|
|
|
[scriptable, uuid(9afff72b-ca9a-11d2-96c9-0060b0fb9956)]
|
|
|
|
interface nsIEditorShell : nsISupports
|
|
|
|
{
|
|
|
|
readonly attribute wstring contentsAsText;
|
|
|
|
readonly attribute wstring contentsAsHTML;
|
|
|
|
|
|
|
|
readonly attribute nsIDOMDocument editorDocument;
|
|
|
|
readonly attribute nsIDOMSelection editorSelection;
|
|
|
|
|
|
|
|
attribute wstring paragraphFormat;
|
|
|
|
attribute long wrapColumn;
|
|
|
|
|
|
|
|
/* Setup */
|
|
|
|
void SetEditorType(in wstring editorType);
|
|
|
|
|
|
|
|
void SetToolbarWindow(in nsIDOMWindow win);
|
|
|
|
void SetContentWindow(in nsIDOMWindow win);
|
|
|
|
void SetWebShellWindow(in nsIDOMWindow win);
|
|
|
|
void LoadUrl(in wstring url);
|
|
|
|
|
|
|
|
void Init();
|
|
|
|
|
|
|
|
/* Commands */
|
|
|
|
void NewWindow();
|
|
|
|
void Open();
|
|
|
|
void Save();
|
|
|
|
void SaveAs();
|
|
|
|
void CloseWindow();
|
|
|
|
void Print();
|
|
|
|
void Exit();
|
|
|
|
|
|
|
|
void Undo();
|
|
|
|
void Redo();
|
|
|
|
|
|
|
|
void Cut();
|
|
|
|
void Copy();
|
|
|
|
void Paste();
|
|
|
|
void PasteAsQuotation();
|
|
|
|
void PasteAsCitedQuotation(in wstring cite);
|
|
|
|
|
|
|
|
void InsertAsQuotation(in wstring quotedText);
|
|
|
|
void InsertAsCitedQuotation(in wstring quotedText, in wstring cite);
|
|
|
|
|
|
|
|
void SelectAll();
|
1999-06-14 20:02:46 +00:00
|
|
|
void DeleteSelection(in PRInt32 action);
|
1999-06-10 19:52:49 +00:00
|
|
|
|
|
|
|
void Find();
|
|
|
|
void FindNext();
|
|
|
|
|
|
|
|
/* Structure change */
|
|
|
|
void InsertText(in wstring textToInsert);
|
|
|
|
void InsertBreak();
|
|
|
|
|
|
|
|
void InsertLink();
|
|
|
|
void InsertImage();
|
|
|
|
void InsertList(in wstring listType);
|
|
|
|
void Indent(in wstring indent);
|
|
|
|
void Align(in wstring align);
|
|
|
|
|
|
|
|
nsIDOMElement GetSelectedElement(in wstring tagName);
|
|
|
|
nsIDOMElement CreateElementWithDefaults(in wstring tagName);
|
1999-06-11 19:03:37 +00:00
|
|
|
void InsertElement(in nsIDOMElement element, in boolean deleteSelection);
|
1999-06-12 21:22:12 +00:00
|
|
|
void SaveHLineSettings(in nsIDOMElement element);
|
1999-06-10 19:52:49 +00:00
|
|
|
void InsertLinkAroundSelection(in nsIDOMElement anchorElement);
|
|
|
|
void SelectElement(in nsIDOMElement element);
|
|
|
|
void SetSelectionAfterElement(in nsIDOMElement element);
|
|
|
|
|
|
|
|
/* Formatting */
|
|
|
|
void SetTextProperty(in wstring prop, in wstring attr, in wstring value);
|
|
|
|
void RemoveTextProperty(in wstring prop, in wstring attr);
|
|
|
|
void GetTextProperty(in wstring prop, in wstring attr, in wstring value, out wstring firstHas, out wstring anyHas, out wstring allHas);
|
|
|
|
void SetBodyAttribute(in wstring attr, in wstring value);
|
|
|
|
void SetBackgroundColor(in wstring color);
|
|
|
|
|
|
|
|
/* Utility */
|
|
|
|
wstring GetLocalFileURL(in nsIDOMWindow parent, in wstring filterType);
|
|
|
|
|
|
|
|
void BeginBatchChanges();
|
|
|
|
void EndBatchChanges();
|
|
|
|
void RunUnitTests();
|
1999-06-14 20:02:46 +00:00
|
|
|
|
|
|
|
void StartLogging(in nsIFileSpec logFile);
|
|
|
|
void StopLogging();
|
1999-06-10 19:52:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
%{C++
|
|
|
|
extern nsresult
|
|
|
|
NS_NewEditorShell(nsIEditorShell** aEditorShell);
|
|
|
|
%}
|
|
|
|
|