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 nsStylesheetTxns_h__ michael@0: #define nsStylesheetTxns_h__ michael@0: michael@0: #include "EditTxn.h" // for EditTxn, NS_DECL_EDITTXN michael@0: #include "nsAutoPtr.h" // for nsRefPtr michael@0: #include "nsCSSStyleSheet.h" // for nsCSSStyleSheet michael@0: #include "nsCycleCollectionParticipant.h" michael@0: #include "nsID.h" // for REFNSIID michael@0: #include "nsISupportsImpl.h" // for nsCSSStyleSheet::Release michael@0: #include "nscore.h" // for NS_IMETHOD michael@0: michael@0: class nsIEditor; michael@0: michael@0: class AddStyleSheetTxn : public EditTxn michael@0: { michael@0: public: michael@0: /** Initialize the transaction. michael@0: * @param aEditor the object providing core editing operations michael@0: * @param aSheet the stylesheet to add michael@0: */ michael@0: NS_IMETHOD Init(nsIEditor *aEditor, michael@0: nsCSSStyleSheet *aSheet); michael@0: michael@0: AddStyleSheetTxn(); michael@0: michael@0: NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(AddStyleSheetTxn, EditTxn) michael@0: NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr); michael@0: michael@0: NS_DECL_EDITTXN michael@0: michael@0: protected: michael@0: michael@0: nsIEditor* mEditor; // the editor that created this transaction michael@0: nsRefPtr mSheet; // the style sheet to add michael@0: michael@0: }; michael@0: michael@0: michael@0: class RemoveStyleSheetTxn : public EditTxn michael@0: { michael@0: public: michael@0: /** Initialize the transaction. michael@0: * @param aEditor the object providing core editing operations michael@0: * @param aSheet the stylesheet to remove michael@0: */ michael@0: NS_IMETHOD Init(nsIEditor *aEditor, michael@0: nsCSSStyleSheet *aSheet); michael@0: michael@0: RemoveStyleSheetTxn(); michael@0: michael@0: NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(RemoveStyleSheetTxn, EditTxn) michael@0: NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr); michael@0: michael@0: NS_DECL_EDITTXN michael@0: michael@0: protected: michael@0: michael@0: nsIEditor* mEditor; // the editor that created this transaction michael@0: nsRefPtr mSheet; // the style sheet to remove michael@0: michael@0: }; michael@0: michael@0: michael@0: #endif /* nsStylesheetTxns_h__ */