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 InsertNodeTxn_h__
7 #define InsertNodeTxn_h__
9 #include "EditTxn.h" // for EditTxn, NS_DECL_EDITTXN
10 #include "nsCOMPtr.h" // for nsCOMPtr
11 #include "nsCycleCollectionParticipant.h"
12 #include "nsIContent.h" // for nsIContent
13 #include "nsISupportsImpl.h" // for NS_DECL_ISUPPORTS_INHERITED
21 * A transaction that inserts a single element
23 class InsertNodeTxn
: public EditTxn
26 /** initialize the transaction.
27 * @param aNode the node to insert
28 * @param aParent the node to insert into
29 * @param aOffset the offset in aParent to insert aNode
31 InsertNodeTxn(nsIContent
& aNode
, nsINode
& aParent
, int32_t aOffset
,
34 NS_DECL_ISUPPORTS_INHERITED
35 NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(InsertNodeTxn
, EditTxn
)
40 virtual ~InsertNodeTxn();
42 /** the element to insert */
43 nsCOMPtr
<nsIContent
> mNode
;
45 /** the node into which the new node will be inserted */
46 nsCOMPtr
<nsINode
> mParent
;
48 /** the index in mParent for the new node */
51 /** the editor for this transaction */
56 } // namespace mozilla