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 EditTxn_h__ michael@0: #define EditTxn_h__ michael@0: michael@0: #include "nsCycleCollectionParticipant.h" michael@0: #include "nsISupportsImpl.h" michael@0: #include "nsITransaction.h" michael@0: #include "nsPIEditorTransaction.h" michael@0: #include "nscore.h" michael@0: michael@0: /** michael@0: * Base class for all document editing transactions. michael@0: */ michael@0: class EditTxn : public nsITransaction, michael@0: public nsPIEditorTransaction michael@0: { michael@0: public: michael@0: NS_DECL_CYCLE_COLLECTING_ISUPPORTS michael@0: NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(EditTxn, nsITransaction) michael@0: michael@0: virtual ~EditTxn(); michael@0: michael@0: virtual void LastRelease() {} michael@0: michael@0: NS_IMETHOD RedoTransaction(void); michael@0: NS_IMETHOD GetIsTransient(bool *aIsTransient); michael@0: NS_IMETHOD Merge(nsITransaction *aTransaction, bool *aDidMerge); michael@0: }; michael@0: michael@0: #define NS_DECL_EDITTXN \ michael@0: NS_IMETHOD DoTransaction(); \ michael@0: NS_IMETHOD UndoTransaction(); \ michael@0: NS_IMETHOD GetTxnDescription(nsAString& aTxnDescription); michael@0: michael@0: #endif