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
|
|
|
|
|
|
|
#ifndef DeleteElementTxn_h__
|
|
|
|
#define DeleteElementTxn_h__
|
|
|
|
|
|
|
|
#include "EditTxn.h"
|
|
|
|
|
|
|
|
#include "nsIDOMNode.h"
|
2007-06-27 19:48:16 -07:00
|
|
|
#include "nsIEditor.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
|
|
|
|
class nsRangeUpdater;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A transaction that deletes a single element
|
|
|
|
*/
|
|
|
|
class DeleteElementTxn : public EditTxn
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/** initialize the transaction.
|
|
|
|
* @param aElement the node to delete
|
|
|
|
*/
|
2007-06-27 19:48:16 -07:00
|
|
|
NS_IMETHOD Init(nsIEditor *aEditor, nsIDOMNode *aElement, nsRangeUpdater *aRangeUpdater);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
DeleteElementTxn();
|
|
|
|
|
2011-02-19 14:18:37 -08:00
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
2009-05-08 21:59:25 -07:00
|
|
|
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(DeleteElementTxn, EditTxn)
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
NS_DECL_EDITTXN
|
|
|
|
|
|
|
|
NS_IMETHOD RedoTransaction();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
/** the element to delete */
|
|
|
|
nsCOMPtr<nsIDOMNode> mElement;
|
|
|
|
|
|
|
|
/** parent of node to delete */
|
|
|
|
nsCOMPtr<nsIDOMNode> mParent;
|
|
|
|
|
|
|
|
/** next sibling to remember for undo/redo purposes */
|
|
|
|
nsCOMPtr<nsIDOMNode> mRefNode;
|
|
|
|
|
2007-06-27 19:48:16 -07:00
|
|
|
/** the editor for this transaction */
|
|
|
|
nsIEditor* mEditor;
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
/** range updater object */
|
|
|
|
nsRangeUpdater *mRangeUpdater;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|