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 DeleteNodeTxn_h__ michael@0: #define DeleteNodeTxn_h__ michael@0: michael@0: #include "EditTxn.h" michael@0: #include "nsCOMPtr.h" michael@0: #include "nsCycleCollectionParticipant.h" michael@0: #include "nsIContent.h" michael@0: #include "nsINode.h" michael@0: #include "nsISupportsImpl.h" michael@0: #include "nscore.h" michael@0: michael@0: class nsEditor; michael@0: class nsRangeUpdater; michael@0: michael@0: /** michael@0: * A transaction that deletes a single element michael@0: */ michael@0: class DeleteNodeTxn : public EditTxn michael@0: { michael@0: public: michael@0: /** initialize the transaction. michael@0: * @param aElement the node to delete michael@0: */ michael@0: nsresult Init(nsEditor* aEditor, nsINode* aNode, michael@0: nsRangeUpdater* aRangeUpdater); michael@0: michael@0: DeleteNodeTxn(); michael@0: michael@0: NS_DECL_ISUPPORTS_INHERITED michael@0: NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(DeleteNodeTxn, EditTxn) michael@0: michael@0: NS_DECL_EDITTXN michael@0: michael@0: NS_IMETHOD RedoTransaction(); michael@0: michael@0: protected: michael@0: michael@0: /** the element to delete */ michael@0: nsCOMPtr mNode; michael@0: michael@0: /** parent of node to delete */ michael@0: nsCOMPtr mParent; michael@0: michael@0: /** next sibling to remember for undo/redo purposes */ michael@0: nsCOMPtr mRefNode; michael@0: michael@0: /** the editor for this transaction */ michael@0: nsEditor* mEditor; michael@0: michael@0: /** range updater object */ michael@0: nsRangeUpdater* mRangeUpdater; michael@0: }; michael@0: michael@0: #endif