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 DeleteNodeTxn_h__
7 #define DeleteNodeTxn_h__
11 #include "nsCycleCollectionParticipant.h"
12 #include "nsIContent.h"
14 #include "nsISupportsImpl.h"
21 * A transaction that deletes a single element
23 class DeleteNodeTxn
: public EditTxn
26 /** initialize the transaction.
27 * @param aElement the node to delete
29 nsresult
Init(nsEditor
* aEditor
, nsINode
* aNode
,
30 nsRangeUpdater
* aRangeUpdater
);
34 NS_DECL_ISUPPORTS_INHERITED
35 NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(DeleteNodeTxn
, EditTxn
)
39 NS_IMETHOD
RedoTransaction();
42 virtual ~DeleteNodeTxn();
44 /** the element to delete */
45 nsCOMPtr
<nsINode
> mNode
;
47 /** parent of node to delete */
48 nsCOMPtr
<nsINode
> mParent
;
50 /** next sibling to remember for undo/redo purposes */
51 nsCOMPtr
<nsIContent
> mRefNode
;
53 /** the editor for this transaction */
56 /** range updater object */
57 nsRangeUpdater
* mRangeUpdater
;