![]() |
|
|
Transaction Manager Interface Class:
class nsITransactionManager : public nsISupports{
public:
virtual nsresult Do(nsITransaction *aTransaction) = 0;
virtual nsresult Undo(void) = 0;
virtual nsresult Redo(void) = 0;
virtual nsresult Clear(void) = 0;
virtual nsresult BeginBatch(void) = 0;
virtual nsresult EndBatch(void) = 0;
virtual nsresult GetNumberOfUndoItems(PRInt32 *aNumItems) = 0;
virtual nsresult GetNumberOfRedoItems(PRInt32 *aNumItems) = 0;
virtual nsresult SetMaxTransactionCount(PRInt32 aMaxCount) = 0;
virtual nsresult PeekUndoStack(nsITransaction **aTransaction) = 0;
virtual nsresult PeekRedoStack(nsITransaction **aTransaction) = 0;
virtual nsresult Write(nsIOutputStream *aOutputStream) = 0;
virtual nsresult AddListener(nsITransactionListener *aListener) = 0;
virtual nsresult RemoveListener(nsITransactionListener *aListener) = 0;
};
Transaction Manager Interface Methods:nsresult Do(nsITransaction *aTransaction)Calls a transaction's Do() method, then pushes it on the undo stack. This method calls the transaction's AddRef() method. The transaction's Release() method will be called when the undo or redo stack is pruned or when the transaction manager is destroyed. Parameter:
aTransaction - the transaction to do.
Parameter:
aNumItems - will contain number of items.
Parameter:
aNumItems - will contain number of items.
Parameter:
aMaxCount - A value of -1 means no limit. A value of zero means the
transaction manager will execute each transaction, then immediately release
all references it has to the transaction without pushing it on the undo
stack. A value greater than zero indicates the max number of transactions
that can exist at any time on both the undo and redo stacks. This method
will prune the neccessary number of transactions on the undo and redo
stacks if the value specified is less than the number of items that exist
on both the undo and redo stacks.
Parameter:
aTransaction - will contain pointer to the transaction.
Parameter:
aTransaction - will contain pointer to the transaction.
Parameter:
aOutputStream - the stream to write to.
The listener's AddRef() method is called. Parameter:
aListener - the lister to add.
Removes a listener from the transaction manager's notification list. The listener's Release() method is called. Parameter: aListener - the lister to remove.
|
|||||||
| Copyright © 1998 The Mozilla Organization. | ||||||||