1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/editor/libeditor/base/nsStyleSheetTxns.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,69 @@ 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 nsStylesheetTxns_h__ 1.10 +#define nsStylesheetTxns_h__ 1.11 + 1.12 +#include "EditTxn.h" // for EditTxn, NS_DECL_EDITTXN 1.13 +#include "nsAutoPtr.h" // for nsRefPtr 1.14 +#include "nsCSSStyleSheet.h" // for nsCSSStyleSheet 1.15 +#include "nsCycleCollectionParticipant.h" 1.16 +#include "nsID.h" // for REFNSIID 1.17 +#include "nsISupportsImpl.h" // for nsCSSStyleSheet::Release 1.18 +#include "nscore.h" // for NS_IMETHOD 1.19 + 1.20 +class nsIEditor; 1.21 + 1.22 +class AddStyleSheetTxn : public EditTxn 1.23 +{ 1.24 +public: 1.25 + /** Initialize the transaction. 1.26 + * @param aEditor the object providing core editing operations 1.27 + * @param aSheet the stylesheet to add 1.28 + */ 1.29 + NS_IMETHOD Init(nsIEditor *aEditor, 1.30 + nsCSSStyleSheet *aSheet); 1.31 + 1.32 + AddStyleSheetTxn(); 1.33 + 1.34 + NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(AddStyleSheetTxn, EditTxn) 1.35 + NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr); 1.36 + 1.37 + NS_DECL_EDITTXN 1.38 + 1.39 +protected: 1.40 + 1.41 + nsIEditor* mEditor; // the editor that created this transaction 1.42 + nsRefPtr<nsCSSStyleSheet> mSheet; // the style sheet to add 1.43 + 1.44 +}; 1.45 + 1.46 + 1.47 +class RemoveStyleSheetTxn : public EditTxn 1.48 +{ 1.49 +public: 1.50 + /** Initialize the transaction. 1.51 + * @param aEditor the object providing core editing operations 1.52 + * @param aSheet the stylesheet to remove 1.53 + */ 1.54 + NS_IMETHOD Init(nsIEditor *aEditor, 1.55 + nsCSSStyleSheet *aSheet); 1.56 + 1.57 + RemoveStyleSheetTxn(); 1.58 + 1.59 + NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(RemoveStyleSheetTxn, EditTxn) 1.60 + NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr); 1.61 + 1.62 + NS_DECL_EDITTXN 1.63 + 1.64 +protected: 1.65 + 1.66 + nsIEditor* mEditor; // the editor that created this transaction 1.67 + nsRefPtr<nsCSSStyleSheet> mSheet; // the style sheet to remove 1.68 + 1.69 +}; 1.70 + 1.71 + 1.72 +#endif /* nsStylesheetTxns_h__ */