1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/editor/libeditor/base/EditTxn.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,39 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#ifndef EditTxn_h__ 1.10 +#define EditTxn_h__ 1.11 + 1.12 +#include "nsCycleCollectionParticipant.h" 1.13 +#include "nsISupportsImpl.h" 1.14 +#include "nsITransaction.h" 1.15 +#include "nsPIEditorTransaction.h" 1.16 +#include "nscore.h" 1.17 + 1.18 +/** 1.19 + * Base class for all document editing transactions. 1.20 + */ 1.21 +class EditTxn : public nsITransaction, 1.22 + public nsPIEditorTransaction 1.23 +{ 1.24 +public: 1.25 + NS_DECL_CYCLE_COLLECTING_ISUPPORTS 1.26 + NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(EditTxn, nsITransaction) 1.27 + 1.28 + virtual ~EditTxn(); 1.29 + 1.30 + virtual void LastRelease() {} 1.31 + 1.32 + NS_IMETHOD RedoTransaction(void); 1.33 + NS_IMETHOD GetIsTransient(bool *aIsTransient); 1.34 + NS_IMETHOD Merge(nsITransaction *aTransaction, bool *aDidMerge); 1.35 +}; 1.36 + 1.37 +#define NS_DECL_EDITTXN \ 1.38 + NS_IMETHOD DoTransaction(); \ 1.39 + NS_IMETHOD UndoTransaction(); \ 1.40 + NS_IMETHOD GetTxnDescription(nsAString& aTxnDescription); 1.41 + 1.42 +#endif