2001-09-25 22:53:13 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 11:12:37 +00: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/. */
|
1999-07-02 03:56:25 +00:00
|
|
|
|
|
|
|
#ifndef nsStylesheetTxns_h__
|
|
|
|
#define nsStylesheetTxns_h__
|
|
|
|
|
2012-07-13 06:33:42 +00:00
|
|
|
#include "EditTxn.h" // for EditTxn, NS_DECL_EDITTXN
|
|
|
|
#include "nsAutoPtr.h" // for nsRefPtr
|
2014-06-20 10:32:49 +00:00
|
|
|
#include "mozilla/CSSStyleSheet.h" // for mozilla::CSSStyleSheet
|
2012-07-13 06:33:42 +00:00
|
|
|
#include "nsCycleCollectionParticipant.h"
|
|
|
|
#include "nsID.h" // for REFNSIID
|
2014-06-20 10:32:49 +00:00
|
|
|
#include "nsISupportsImpl.h" // for CSSStyleSheet::Release
|
2012-07-13 06:33:42 +00:00
|
|
|
#include "nscore.h" // for NS_IMETHOD
|
|
|
|
|
|
|
|
class nsIEditor;
|
1999-07-02 03:56:25 +00:00
|
|
|
|
|
|
|
class AddStyleSheetTxn : public EditTxn
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/** Initialize the transaction.
|
|
|
|
* @param aEditor the object providing core editing operations
|
|
|
|
* @param aSheet the stylesheet to add
|
|
|
|
*/
|
2014-06-20 10:32:49 +00:00
|
|
|
NS_IMETHOD Init(nsIEditor* aEditor,
|
|
|
|
mozilla::CSSStyleSheet* aSheet);
|
1999-07-02 03:56:25 +00:00
|
|
|
|
|
|
|
AddStyleSheetTxn();
|
|
|
|
|
2009-05-09 04:59:25 +00:00
|
|
|
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(AddStyleSheetTxn, EditTxn)
|
2015-03-21 16:28:04 +00:00
|
|
|
NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr) override;
|
2009-05-09 04:59:25 +00:00
|
|
|
|
2007-01-11 14:38:02 +00:00
|
|
|
NS_DECL_EDITTXN
|
1999-09-21 22:31:27 +00:00
|
|
|
|
1999-07-02 03:56:25 +00:00
|
|
|
protected:
|
|
|
|
|
2014-06-20 10:32:49 +00:00
|
|
|
nsIEditor* mEditor; // the editor that created this transaction
|
|
|
|
nsRefPtr<mozilla::CSSStyleSheet> mSheet; // the style sheet to add
|
2010-05-11 20:41:47 +00:00
|
|
|
|
1999-07-02 03:56:25 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class RemoveStyleSheetTxn : public EditTxn
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/** Initialize the transaction.
|
|
|
|
* @param aEditor the object providing core editing operations
|
|
|
|
* @param aSheet the stylesheet to remove
|
|
|
|
*/
|
2014-06-20 10:32:49 +00:00
|
|
|
NS_IMETHOD Init(nsIEditor* aEditor,
|
|
|
|
mozilla::CSSStyleSheet* aSheet);
|
2010-05-11 20:41:47 +00:00
|
|
|
|
1999-07-02 03:56:25 +00:00
|
|
|
RemoveStyleSheetTxn();
|
|
|
|
|
2009-05-09 04:59:25 +00:00
|
|
|
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(RemoveStyleSheetTxn, EditTxn)
|
2015-03-21 16:28:04 +00:00
|
|
|
NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr) override;
|
2009-05-09 04:59:25 +00:00
|
|
|
|
2007-01-11 14:38:02 +00:00
|
|
|
NS_DECL_EDITTXN
|
1999-09-21 22:31:27 +00:00
|
|
|
|
1999-07-02 03:56:25 +00:00
|
|
|
protected:
|
|
|
|
|
2014-06-20 10:32:49 +00:00
|
|
|
nsIEditor* mEditor; // the editor that created this transaction
|
|
|
|
nsRefPtr<mozilla::CSSStyleSheet> mSheet; // the style sheet to remove
|
2010-05-11 20:41:47 +00:00
|
|
|
|
1999-07-02 03:56:25 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* nsStylesheetTxns_h__ */
|