Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
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__
9 #include "EditTxn.h"
10 #include "nsCOMPtr.h"
11 #include "nsCycleCollectionParticipant.h"
12 #include "nsIContent.h"
13 #include "nsINode.h"
14 #include "nsISupportsImpl.h"
15 #include "nscore.h"
17 class nsEditor;
18 class nsRangeUpdater;
20 /**
21 * A transaction that deletes a single element
22 */
23 class DeleteNodeTxn : public EditTxn
24 {
25 public:
26 /** initialize the transaction.
27 * @param aElement the node to delete
28 */
29 nsresult Init(nsEditor* aEditor, nsINode* aNode,
30 nsRangeUpdater* aRangeUpdater);
32 DeleteNodeTxn();
34 NS_DECL_ISUPPORTS_INHERITED
35 NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(DeleteNodeTxn, EditTxn)
37 NS_DECL_EDITTXN
39 NS_IMETHOD RedoTransaction();
41 protected:
43 /** the element to delete */
44 nsCOMPtr<nsINode> mNode;
46 /** parent of node to delete */
47 nsCOMPtr<nsINode> mParent;
49 /** next sibling to remember for undo/redo purposes */
50 nsCOMPtr<nsIContent> mRefNode;
52 /** the editor for this transaction */
53 nsEditor* mEditor;
55 /** range updater object */
56 nsRangeUpdater* mRangeUpdater;
57 };
59 #endif