Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Attributes | Private Member Functions | Friends
RemoveStyleSheetTxn Class Reference

#include <nsStyleSheetTxns.h>

Inheritance diagram for RemoveStyleSheetTxn:
Inheritance graph
[legend]
Collaboration diagram for RemoveStyleSheetTxn:
Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual ~RemoveStyleSheetTxn ()
NS_IMETHOD Init (nsIEditor *aEditor, nsICSSStyleSheet *aSheet)
 Initialize the transaction.
NS_IMETHOD DoTransaction (void)
NS_IMETHOD UndoTransaction (void)
NS_IMETHOD RedoTransaction (void)
NS_IMETHOD Merge (nsITransaction *aTransaction, PRBool *aDidMerge)
NS_IMETHOD GetTxnDescription (nsAString &aTxnDescription)
NS_IMETHOD GetIsTransient (PRBool *aIsTransient)
void doTransaction ()
 Executes the transaction.
void undoTransaction ()
 Restores the state to what it was before the transaction was executed.
void redoTransaction ()
 Executes the transaction again.
boolean merge (in nsITransaction aTransaction)
 Attempts to merge a transaction into "this" transaction.

Static Public Member Functions

static const nsIIDGetCID ()

Public Attributes

readonly attribute boolean isTransient
 The transaction's transient state.
readonly attribute DOMString txnDescription

Protected Attributes

nsIEditormEditor
nsCOMPtr< nsICSSStyleSheetmSheet

Private Member Functions

 RemoveStyleSheetTxn ()

Friends

class TransactionFactory

Detailed Description

Definition at line 95 of file nsStyleSheetTxns.h.


Constructor & Destructor Documentation

Definition at line 157 of file nsStyleSheetTxns.cpp.

{
}

Definition at line 151 of file nsStyleSheetTxns.cpp.

:  EditTxn()
,  mEditor(NULL)
{
}

Member Function Documentation

Executes the transaction.

Reimplemented from EditTxn.

Definition at line 178 of file nsStyleSheetTxns.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

static const nsIID& RemoveStyleSheetTxn::GetCID ( ) [inline, static]

Reimplemented from EditTxn.

Definition at line 101 of file nsStyleSheetTxns.h.

{ static const nsIID iid = REMOVE_STYLESHEET_TXN_CID; return iid; }

Here is the caller graph for this function:

NS_IMETHODIMP EditTxn::GetIsTransient ( PRBool aIsTransient) [inherited]

Reimplemented in JoinElementTxn, SetDocTitleTxn, and EditAggregateTxn.

Definition at line 66 of file EditTxn.cpp.

{
  if (aIsTransient)
    *aIsTransient = PR_FALSE;
  return NS_OK;
}
NS_IMETHODIMP RemoveStyleSheetTxn::GetTxnDescription ( nsAString &  aTxnDescription)

Reimplemented from EditTxn.

Definition at line 215 of file nsStyleSheetTxns.cpp.

{
  aString.AssignLiteral("RemoveStyleSheetTxn");
  return NS_OK;
}

Initialize the transaction.

Parameters:
aEditorthe object providing core editing operations
aSheetthe stylesheet to remove

Definition at line 162 of file nsStyleSheetTxns.cpp.

{
  if (!aEditor)
    return NS_ERROR_INVALID_ARG;

  if (!aSheet)
    return NS_ERROR_INVALID_ARG;

  mEditor = aEditor;
  mSheet = do_QueryInterface(aSheet);
  
  return NS_OK;
}

Here is the call graph for this function:

boolean nsITransaction::merge ( in nsITransaction  aTransaction) [inherited]

Attempts to merge a transaction into "this" transaction.

Both transactions must be in their undo state, doTransaction() methods already called. The transaction manager calls this method to coalesce a new transaction with the transaction on the top of the undo stack. This method returns a boolean value that indicates the merge result. A true value indicates that the transactions were merged successfully, a false value if the merge was not possible or failed. If true, the transaction manager will Release() the new transacton instead of pushing it on the undo stack.

Parameters:
aTransactionthe previously executed transaction to merge.
NS_IMETHODIMP RemoveStyleSheetTxn::Merge ( nsITransaction aTransaction,
PRBool aDidMerge 
)

Reimplemented from EditTxn.

Definition at line 204 of file nsStyleSheetTxns.cpp.

{
  // set out param default value
  if (!aDidMerge)
    return NS_ERROR_NULL_POINTER;
    
  *aDidMerge = PR_FALSE;
  return NS_OK;
}

Executes the transaction again.

Can only be called on a transaction that was previously undone.

In most cases, the redoTransaction() method will actually call the doTransaction() method to execute the transaction again.

Reimplemented from EditTxn.

Definition at line 198 of file nsStyleSheetTxns.cpp.

{
   return DoTransaction();
}

Here is the call graph for this function:

Restores the state to what it was before the transaction was executed.

Reimplemented from EditTxn.

Definition at line 188 of file nsStyleSheetTxns.cpp.

Here is the call graph for this function:


Friends And Related Function Documentation

friend class TransactionFactory [friend]

Definition at line 97 of file nsStyleSheetTxns.h.


Member Data Documentation

The transaction's transient state.

This attribute is checked by the transaction manager after the transaction's Execute() method is called. If the transient state is false, a reference to the transaction is held by the transaction manager so that the transactions' undoTransaction() and redoTransaction() methods can be called. If the transient state is true, the transaction manager returns immediately after the transaction's doTransaction() method is called, no references to the transaction are maintained. Transient transactions cannot be undone or redone by the transaction manager.

Definition at line 79 of file nsITransaction.idl.

Definition at line 129 of file nsStyleSheetTxns.h.

Definition at line 130 of file nsStyleSheetTxns.h.

readonly attribute DOMString nsPIEditorTransaction::txnDescription [inherited]

Definition at line 50 of file nsPIEditorTransaction.idl.


The documentation for this class was generated from the following files: