/* -*- 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/. */ #ifndef mozilla_TextEditor_h #define mozilla_TextEditor_h #include "mozilla/EditorBase.h" #include "mozilla/EditorForwards.h" #include "mozilla/TextControlState.h" #include "mozilla/UniquePtr.h" #include "nsCOMPtr.h" #include "nsCycleCollectionParticipant.h" #include "nsINamed.h" #include "nsISupportsImpl.h" #include "nsITimer.h" #include "nscore.h" class nsIContent; class nsIDocumentEncoder; class nsIOutputStream; class nsIPrincipal; class nsISelectionController; class nsITransferable; namespace mozilla { namespace dom { class Selection; } // namespace dom /** * The text editor implementation. * Use to edit text document represented as a DOM tree. */ class TextEditor final : public EditorBase, public nsITimerCallback, public nsINamed { public: /**************************************************************************** * NOTE: DO NOT MAKE YOUR NEW METHODS PUBLIC IF they are called by other * classes under libeditor except EditorEventListener and * HTMLEditorEventListener because each public method which may fire * eEditorInput event will need to instantiate new stack class for * managing input type value of eEditorInput and cache some objects * for smarter handling. In other words, when you add new root * method to edit the DOM tree, you can make your new method public. ****************************************************************************/ NS_DECL_ISUPPORTS_INHERITED NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(TextEditor, EditorBase) TextEditor(); /** * Note that TextEditor::Init() shouldn't cause running script synchronously. * So, `MOZ_CAN_RUN_SCRIPT_BOUNDARY` is safe here. * * @param aDocument The document which aAnonymousDivElement belongs to. * @param aAnonymousDivElement * The root editable element for this editor. * @param aSelectionController * The selection controller for independent selections * in the `` or `