DeleteMultipleRangesTransaction.h (1694B)
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 DeleteMultipleRangesTransactionBase_h 7 #define DeleteMultipleRangesTransactionBase_h 8 9 #include "DeleteContentTransactionBase.h" 10 #include "EditAggregateTransaction.h" 11 12 #include "EditorForwards.h" 13 14 #include "nsCycleCollectionParticipant.h" 15 #include "nsISupportsImpl.h" 16 17 namespace mozilla { 18 19 /** 20 * An abstract transaction that removes text or node. 21 */ 22 class DeleteMultipleRangesTransaction final : public EditAggregateTransaction { 23 public: 24 static already_AddRefed<DeleteMultipleRangesTransaction> Create() { 25 RefPtr<DeleteMultipleRangesTransaction> transaction = 26 new DeleteMultipleRangesTransaction(); 27 return transaction.forget(); 28 } 29 30 NS_DECL_ISUPPORTS_INHERITED 31 NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(DeleteMultipleRangesTransaction, 32 EditAggregateTransaction) 33 34 NS_DECL_EDITTRANSACTIONBASE 35 NS_DECL_EDITTRANSACTIONBASE_GETASMETHODS_OVERRIDE( 36 DeleteMultipleRangesTransaction) 37 38 MOZ_CAN_RUN_SCRIPT NS_IMETHOD RedoTransaction() final; 39 40 void AppendChild(DeleteContentTransactionBase& aTransaction); 41 void AppendChild(DeleteRangeTransaction& aTransaction); 42 43 /** 44 * Return latest caret point suggestion of child transaction. 45 */ 46 EditorDOMPoint SuggestPointToPutCaret() const; 47 48 protected: 49 ~DeleteMultipleRangesTransaction() = default; 50 }; 51 52 } // namespace mozilla 53 54 #endif // #ifndef DeleteMultipleRangesTransaction_h