michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef InsertElementTxn_h__ michael@0: #define InsertElementTxn_h__ michael@0: michael@0: #include "EditTxn.h" // for EditTxn, NS_DECL_EDITTXN michael@0: #include "nsCOMPtr.h" // for nsCOMPtr michael@0: #include "nsCycleCollectionParticipant.h" michael@0: #include "nsIDOMNode.h" // for nsIDOMNode michael@0: #include "nsISupportsImpl.h" // for NS_DECL_ISUPPORTS_INHERITED michael@0: #include "nscore.h" // for NS_IMETHOD michael@0: michael@0: class nsIEditor; michael@0: michael@0: /** michael@0: * A transaction that inserts a single element michael@0: */ michael@0: class InsertElementTxn : public EditTxn michael@0: { michael@0: public: michael@0: /** initialize the transaction. michael@0: * @param aNode the node to insert michael@0: * @param aParent the node to insert into michael@0: * @param aOffset the offset in aParent to insert aNode michael@0: */ michael@0: NS_IMETHOD Init(nsIDOMNode *aNode, michael@0: nsIDOMNode *aParent, michael@0: int32_t aOffset, michael@0: nsIEditor *aEditor); michael@0: michael@0: InsertElementTxn(); michael@0: michael@0: NS_DECL_ISUPPORTS_INHERITED michael@0: NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(InsertElementTxn, EditTxn) michael@0: michael@0: NS_DECL_EDITTXN michael@0: michael@0: protected: michael@0: michael@0: /** the element to insert */ michael@0: nsCOMPtr mNode; michael@0: michael@0: /** the node into which the new node will be inserted */ michael@0: nsCOMPtr mParent; michael@0: michael@0: /** the editor for this transaction */ michael@0: nsIEditor* mEditor; michael@0: michael@0: /** the index in mParent for the new node */ michael@0: int32_t mOffset; michael@0: }; michael@0: michael@0: #endif