EditorForwards.h (8724B)
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/. */ 5 6 #ifndef mozilla_EditorHelperForwards_h 7 #define mozilla_EditorHelperForwards_h 8 9 #include "mozilla/EnumSet.h" 10 11 #include <cstdint> 12 13 /****************************************************************************** 14 * Forward declarations of other modules' 15 ******************************************************************************/ 16 class nsIContent; 17 class nsINode; 18 19 template <typename T> 20 class nsCOMPtr; 21 22 template <typename T> 23 class RefPtr; 24 25 namespace mozilla { 26 27 template <typename V, typename E> 28 class Result; 29 30 template <typename T> 31 class OwningNonNull; 32 33 namespace dom { 34 class Element; 35 class Text; 36 } // namespace dom 37 38 /****************************************************************************** 39 * enum classes 40 ******************************************************************************/ 41 42 enum class BlockInlineCheck : uint8_t; // HTMLEditHelpers.h 43 enum class CollectChildrenOption; // HTMLEditUtils.h 44 enum class EditAction; // mozilla/EditAction.h 45 enum class EditorCommandParamType : uint16_t; // mozilla/EditorCommands.h 46 enum class EditSubAction : int32_t; // mozilla/EditAction.h 47 enum class ParagraphSeparator; // mozilla/HTMLEditor.h 48 enum class SpecifiedStyle : uint8_t; // mozilla/PendingStyles.h 49 enum class StopTracking : bool; // mozilla/SelectionState.h 50 enum class SuggestCaret; // EditorUtils.h 51 enum class WithTransaction; // HTMLEditHelpers.h 52 53 /****************************************************************************** 54 * enum sets 55 ******************************************************************************/ 56 57 using CollectChildrenOptions = EnumSet<CollectChildrenOption>; 58 using SuggestCaretOptions = EnumSet<SuggestCaret>; 59 60 /****************************************************************************** 61 * classes or structs which are required for template classes/structs 62 ******************************************************************************/ 63 64 template <typename PT, typename CT> 65 class EditorDOMPointBase; // mozilla/EditorDOMPoint.h 66 67 using EditorDOMPoint = 68 EditorDOMPointBase<nsCOMPtr<nsINode>, nsCOMPtr<nsIContent>>; 69 using EditorRawDOMPoint = EditorDOMPointBase<nsINode*, nsIContent*>; 70 using EditorDOMPointInText = EditorDOMPointBase<RefPtr<dom::Text>, nsIContent*>; 71 using EditorRawDOMPointInText = EditorDOMPointBase<dom::Text*, nsIContent*>; 72 73 template <typename CT> 74 class EditorLineBreakBase; // EditorLineBreak.h 75 76 using EditorLineBreak = EditorLineBreakBase<nsCOMPtr<nsIContent>>; 77 using EditorRawLineBreak = EditorLineBreakBase<nsIContent*>; 78 79 /****************************************************************************** 80 * classes 81 ******************************************************************************/ 82 83 class AutoPendingStyleCacheArray; // mozilla/PendingStyles.h 84 class EditTransactionBase; // mozilla/EditTransactionBase.h 85 class EditorBase; // mozilla/EditorBase.h 86 class HTMLEditor; // mozilla/HTMLEditor.h 87 class ManualNACPtr; // mozilla/ManualNAC.h 88 class PendingStyle; // mozilla/PendingStyles.h 89 class PendingStyleCache; // mozilla/PendingStyles.h 90 class PendingStyles; // mozilla/PendingStyles.h 91 class RangeUpdater; // mozilla/SelectionState.h 92 class SelectionState; // mozilla/SelectionState.h 93 class TextEditor; // mozilla/TextEditor.h 94 95 class AutoClonedRangeArray; // AutoClonedRangeArray.h 96 class AutoClonedSelectionRangeArray; // AutoClonedRangeArray.h 97 class AutoDOMAPIWrapperBase; // EditorDOMAPIWrapper.h 98 class AutoSelectionRestorer; // AutoSelectionRestorer.h 99 class AutoSelectionRangeArray; // EditorUtils.h 100 class CaretPoint; // EditorUtils.h 101 class ChangeAttributeTransaction; // ChangeAttributeTransaction.h 102 class ChangeStyleTransaction; // ChangeStyleTransaction.h 103 class CompositionInTextNodeTransaction; // CompositionTransaction.h 104 class CompositionTransaction; // CompositionTransaction.h 105 class CreateLineBreakResult; // EditorLineBreak.h 106 class CSSEditUtils; // CSSEditUtils.h 107 class DeleteContentTransactionBase; // DeleteContentTransactionBase.h 108 class DeleteMultipleRangesTransaction; // DeleteMultipleRangesTransaction.h 109 class DeleteNodeTransaction; // DeleteNodeTransaction.h 110 class DeleteRangeResult; // HTMLEditHelpers.h 111 class DeleteRangeTransaction; // DeleteRangeTransaction.h 112 class DeleteTextFromTextNodeTransaction; // DeleteTextTransaction.h 113 class DeleteTextTransaction; // DeleteTextTransaction.h 114 class EditActionResult; // EditorUtils.h 115 class EditAggregateTransaction; // EditAggregateTransaction.h 116 class EditorEventListener; // EditorEventListener.h 117 class EditResult; // HTMLEditHelpers.h 118 class HTMLEditorEventListener; // HTMLEditorEventListener.h 119 class InsertNodeTransaction; // InsertNodeTransaction.h 120 class InsertTextIntoTextNodeTransaction; // InsertTextTransaction.h 121 class InsertTextResult; // EditorUtils.h 122 class InsertTextTransaction; // InsertTextTransaction.h 123 class InterCiter; // InterCiter.h 124 class JoinNodesResult; // HTMLEditHelpers.h 125 class JoinNodesTransaction; // JoinNodesTransaction.h 126 class MoveNodeResult; // HTMLEditHelpers.h 127 class MoveNodeTransaction; // MoveNodeTransaction.h 128 class MoveNodeTransactionBase; // MoveNodeTransaction.h 129 class MoveSiblingsTransaction; // MoveNodeTransaction.h 130 class PlaceholderTransaction; // PlaceholderTransaction.h 131 class ReplaceTextInTextNodeTransaction; // ReplaceTextTransaction.h 132 class ReplaceTextTransaction; // ReplaceTextTransaction.h 133 class SplitNodeResult; // HTMLEditHelpers.h 134 class SplitNodeTransaction; // SplitNodeTransaction.h 135 class SplitRangeOffFromNodeResult; // HTMLEditHelpers.h 136 class SplitRangeOffResult; // HTMLEditHelpers.h 137 class WhiteSpaceVisibilityKeeper; // WhiteSpaceVisibilityKeeper.h 138 class WSRunScanner; // WSRunScanner.h 139 class WSScanResult; // WSRunScanner.h 140 141 /****************************************************************************** 142 * structs 143 ******************************************************************************/ 144 145 class EditorElementStyle; // HTMLEditHelpers.h 146 struct EditorInlineStyle; // HTMLEditHelpers.h 147 struct EditorInlineStyleAndValue; // HTMLEditHelpers.h 148 struct RangeItem; // mozilla/SelectionState.h 149 150 /****************************************************************************** 151 * template classes 152 ******************************************************************************/ 153 154 template <typename EditorDOMPointType> 155 class EditorDOMRangeBase; // mozilla/EditorDOMPoint.h 156 157 template <typename NodeType> 158 class CreateNodeResultBase; // EditorUtils.h 159 160 template <typename EditorDOMPointType> 161 class ReplaceRangeDataBase; // EditorUtils.h 162 163 /****************************************************************************** 164 * aliases 165 ******************************************************************************/ 166 167 using CreateContentResult = CreateNodeResultBase<nsIContent>; 168 using CreateElementResult = CreateNodeResultBase<dom::Element>; 169 using CreateTextResult = CreateNodeResultBase<dom::Text>; 170 171 // InsertParagraphResult is an alias of CreateElementResult because it returns 172 // new paragraph from point of view of users (i.e., right paragraph if split) 173 // instead of newly created paragraph element. 174 using InsertParagraphResult = CreateElementResult; 175 176 using EditorDOMRange = EditorDOMRangeBase<EditorDOMPoint>; 177 using EditorRawDOMRange = EditorDOMRangeBase<EditorRawDOMPoint>; 178 using EditorDOMRangeInTexts = EditorDOMRangeBase<EditorDOMPointInText>; 179 using EditorRawDOMRangeInTexts = EditorDOMRangeBase<EditorRawDOMPointInText>; 180 181 using ReplaceRangeData = ReplaceRangeDataBase<EditorDOMPoint>; 182 using ReplaceRangeInTextsData = ReplaceRangeDataBase<EditorDOMPointInText>; 183 184 } // namespace mozilla 185 186 #endif // #ifndef mozilla_EditorHelperForwards_h