2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 04:12:37 -07:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2012-06-19 06:23:36 -07:00
|
|
|
#ifndef DeleteNodeTxn_h__
|
|
|
|
#define DeleteNodeTxn_h__
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
#include "EditTxn.h"
|
|
|
|
#include "nsCOMPtr.h"
|
2012-07-12 23:33:42 -07:00
|
|
|
#include "nsCycleCollectionParticipant.h"
|
|
|
|
#include "nsIContent.h"
|
|
|
|
#include "nsINode.h"
|
|
|
|
#include "nsISupportsImpl.h"
|
|
|
|
#include "nscore.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2012-06-19 06:23:36 -07:00
|
|
|
class nsEditor;
|
2012-07-12 23:33:42 -07:00
|
|
|
class nsRangeUpdater;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* A transaction that deletes a single element
|
|
|
|
*/
|
2012-06-19 06:23:36 -07:00
|
|
|
class DeleteNodeTxn : public EditTxn
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
/** initialize the transaction.
|
|
|
|
* @param aElement the node to delete
|
|
|
|
*/
|
2012-06-19 06:23:36 -07:00
|
|
|
nsresult Init(nsEditor* aEditor, nsINode* aNode,
|
|
|
|
nsRangeUpdater* aRangeUpdater);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2012-06-19 06:23:36 -07:00
|
|
|
DeleteNodeTxn();
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2011-02-19 14:18:37 -08:00
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
2012-06-19 06:23:36 -07:00
|
|
|
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(DeleteNodeTxn, EditTxn)
|
2009-05-08 21:59:25 -07:00
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
NS_DECL_EDITTXN
|
|
|
|
|
2015-03-21 09:28:04 -07:00
|
|
|
NS_IMETHOD RedoTransaction() override;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
protected:
|
2014-07-08 14:23:18 -07:00
|
|
|
virtual ~DeleteNodeTxn();
|
2012-06-19 06:23:36 -07:00
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
/** the element to delete */
|
2012-06-19 06:23:36 -07:00
|
|
|
nsCOMPtr<nsINode> mNode;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
/** parent of node to delete */
|
2012-06-19 06:23:36 -07:00
|
|
|
nsCOMPtr<nsINode> mParent;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
/** next sibling to remember for undo/redo purposes */
|
2012-06-19 06:23:36 -07:00
|
|
|
nsCOMPtr<nsIContent> mRefNode;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2007-06-27 19:48:16 -07:00
|
|
|
/** the editor for this transaction */
|
2012-06-19 06:23:36 -07:00
|
|
|
nsEditor* mEditor;
|
2007-06-27 19:48:16 -07:00
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
/** range updater object */
|
2012-06-19 06:23:36 -07:00
|
|
|
nsRangeUpdater* mRangeUpdater;
|
2007-03-22 10:30:00 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|