editor/libeditor/base/nsStyleSheetTxns.h

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     2 /* This Source Code Form is subject to the terms of the Mozilla Public
     3  * License, v. 2.0. If a copy of the MPL was not distributed with this
     4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     6 #ifndef nsStylesheetTxns_h__
     7 #define nsStylesheetTxns_h__
     9 #include "EditTxn.h"                    // for EditTxn, NS_DECL_EDITTXN
    10 #include "nsAutoPtr.h"                  // for nsRefPtr
    11 #include "nsCSSStyleSheet.h"            // for nsCSSStyleSheet
    12 #include "nsCycleCollectionParticipant.h"
    13 #include "nsID.h"                       // for REFNSIID
    14 #include "nsISupportsImpl.h"            // for nsCSSStyleSheet::Release
    15 #include "nscore.h"                     // for NS_IMETHOD
    17 class nsIEditor;
    19 class AddStyleSheetTxn : public EditTxn
    20 {
    21 public:
    22   /** Initialize the transaction.
    23     * @param aEditor the object providing core editing operations
    24     * @param aSheet   the stylesheet to add
    25     */
    26   NS_IMETHOD Init(nsIEditor         *aEditor,
    27                   nsCSSStyleSheet   *aSheet);
    29   AddStyleSheetTxn();
    31   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(AddStyleSheetTxn, EditTxn)
    32   NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr);
    34   NS_DECL_EDITTXN
    36 protected:
    38   nsIEditor*  mEditor;                  // the editor that created this transaction
    39   nsRefPtr<nsCSSStyleSheet>  mSheet;    // the style sheet to add
    41 };
    44 class RemoveStyleSheetTxn : public EditTxn
    45 {
    46 public:
    47   /** Initialize the transaction.
    48     * @param aEditor the object providing core editing operations
    49     * @param aSheet   the stylesheet to remove
    50     */
    51   NS_IMETHOD Init(nsIEditor         *aEditor,
    52                   nsCSSStyleSheet   *aSheet);
    54   RemoveStyleSheetTxn();
    56   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(RemoveStyleSheetTxn, EditTxn)
    57   NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr);
    59   NS_DECL_EDITTXN
    61 protected:
    63   nsIEditor*  mEditor;                  // the editor that created this transaction
    64   nsRefPtr<nsCSSStyleSheet>  mSheet;    // the style sheet to remove
    66 };
    69 #endif /* nsStylesheetTxns_h__ */

mercurial