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/. */
6 #ifndef DeleteRangeTxn_h__
7 #define DeleteRangeTxn_h__
9 #include "EditAggregateTxn.h"
11 #include "nsAutoPtr.h"
12 #include "nsCycleCollectionParticipant.h"
14 #include "nsIEditor.h"
15 #include "nsISupportsImpl.h"
24 * A transaction that deletes an entire range in the content tree
26 class DeleteRangeTxn
: public EditAggregateTxn
29 /** initialize the transaction.
30 * @param aEditor the object providing basic editing operations
31 * @param aRange the range to delete
33 nsresult
Init(nsEditor
* aEditor
,
35 nsRangeUpdater
* aRangeUpdater
);
39 NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(DeleteRangeTxn
, EditAggregateTxn
)
40 NS_IMETHOD
QueryInterface(REFNSIID aIID
, void** aInstancePtr
) override
;
44 NS_IMETHOD
RedoTransaction() override
;
46 virtual void LastRelease() override
49 EditAggregateTxn::LastRelease();
53 nsresult
CreateTxnsToDeleteBetween(nsINode
* aNode
,
57 nsresult
CreateTxnsToDeleteNodesBetween();
59 nsresult
CreateTxnsToDeleteContent(nsINode
* aParent
,
61 nsIEditor::EDirection aAction
);
65 /** p1 in the range */
66 RefPtr
<nsRange
> mRange
;
68 /** the editor for this transaction */
71 /** range updater object */
72 nsRangeUpdater
* mRangeUpdater
;