mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-02 15:15:23 +00:00
7140e129f6
--HG-- rename : editor/txmgr/idl/nsITransaction.idl => editor/txmgr/nsITransaction.idl rename : editor/txmgr/idl/nsITransactionList.idl => editor/txmgr/nsITransactionList.idl rename : editor/txmgr/idl/nsITransactionListener.idl => editor/txmgr/nsITransactionListener.idl rename : editor/txmgr/idl/nsITransactionManager.idl => editor/txmgr/nsITransactionManager.idl rename : editor/txmgr/src/nsTransactionItem.cpp => editor/txmgr/nsTransactionItem.cpp rename : editor/txmgr/src/nsTransactionItem.h => editor/txmgr/nsTransactionItem.h rename : editor/txmgr/src/nsTransactionList.cpp => editor/txmgr/nsTransactionList.cpp rename : editor/txmgr/src/nsTransactionList.h => editor/txmgr/nsTransactionList.h rename : editor/txmgr/src/nsTransactionManager.cpp => editor/txmgr/nsTransactionManager.cpp rename : editor/txmgr/src/nsTransactionManager.h => editor/txmgr/nsTransactionManager.h rename : editor/txmgr/public/nsTransactionManagerCID.h => editor/txmgr/nsTransactionManagerCID.h rename : editor/txmgr/src/nsTransactionManagerFactory.cpp => editor/txmgr/nsTransactionManagerFactory.cpp rename : editor/txmgr/src/nsTransactionStack.cpp => editor/txmgr/nsTransactionStack.cpp rename : editor/txmgr/src/nsTransactionStack.h => editor/txmgr/nsTransactionStack.h
64 lines
2.4 KiB
Plaintext
64 lines
2.4 KiB
Plaintext
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
/* 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/. */
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
/*
|
|
* The nsITransaction interface.
|
|
* <P>
|
|
* This interface is implemented by an object that needs to
|
|
* execute some behavior that must be tracked by the transaction manager.
|
|
*/
|
|
[scriptable, uuid(58e330c1-7b48-11d2-98b9-00805f297d89)]
|
|
interface nsITransaction : nsISupports
|
|
{
|
|
/**
|
|
* Executes the transaction.
|
|
*/
|
|
void doTransaction();
|
|
|
|
/**
|
|
* Restores the state to what it was before the transaction was executed.
|
|
*/
|
|
void undoTransaction();
|
|
|
|
/**
|
|
* Executes the transaction again. Can only be called on a transaction that
|
|
* was previously undone.
|
|
* <P>
|
|
* In most cases, the redoTransaction() method will actually call the
|
|
* doTransaction() method to execute the transaction again.
|
|
*/
|
|
void redoTransaction();
|
|
|
|
/**
|
|
* 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.
|
|
*/
|
|
readonly attribute boolean isTransient;
|
|
|
|
/**
|
|
* 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.
|
|
* @param aTransaction the previously executed transaction to merge.
|
|
*/
|
|
boolean merge(in nsITransaction aTransaction);
|
|
};
|
|
|