mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-28 00:07:28 +00:00
Changed interface and implementation to us NS_IMETHOD and NS_IMPMETHOD macros.
This commit is contained in:
parent
f2d3f915e0
commit
8245590ade
@ -52,24 +52,24 @@ public:
|
||||
* stack is pruned or when the transaction manager is destroyed.
|
||||
* @param aTransaction the transaction to do.
|
||||
*/
|
||||
virtual nsresult Do(nsITransaction *aTransaction) = 0;
|
||||
NS_IMETHOD Do(nsITransaction *aTransaction) = 0;
|
||||
|
||||
/**
|
||||
* Pops the topmost transaction on the undo stack, calls it's Undo() method,
|
||||
* then pushes it on the redo stack.
|
||||
*/
|
||||
virtual nsresult Undo(void) = 0;
|
||||
NS_IMETHOD Undo(void) = 0;
|
||||
|
||||
/**
|
||||
* Pops the topmost transaction on the redo stack, calls it's Redo() method,
|
||||
* then pushes it on the undo stack.
|
||||
*/
|
||||
virtual nsresult Redo(void) = 0;
|
||||
NS_IMETHOD Redo(void) = 0;
|
||||
|
||||
/**
|
||||
* Clears the undo and redo stacks.
|
||||
*/
|
||||
virtual nsresult Clear(void) = 0;
|
||||
NS_IMETHOD Clear(void) = 0;
|
||||
|
||||
/**
|
||||
* Turns on the transaction manager's batch mode, forcing all transactions
|
||||
@ -78,24 +78,24 @@ public:
|
||||
* execute and group together several independent transactions so they
|
||||
* can be undone with a single call to Undo().
|
||||
*/
|
||||
virtual nsresult BeginBatch() = 0;
|
||||
NS_IMETHOD BeginBatch() = 0;
|
||||
|
||||
/**
|
||||
* Turns off the transaction manager's batch mode.
|
||||
*/
|
||||
virtual nsresult EndBatch() = 0;
|
||||
NS_IMETHOD EndBatch() = 0;
|
||||
|
||||
/**
|
||||
* Returns the number of items on the undo stack.
|
||||
* @param aNumItems will contain number of items.
|
||||
*/
|
||||
virtual nsresult GetNumberOfUndoItems(PRInt32 *aNumItems) = 0;
|
||||
NS_IMETHOD GetNumberOfUndoItems(PRInt32 *aNumItems) = 0;
|
||||
|
||||
/**
|
||||
* Returns the number of items on the redo stack.
|
||||
* @param aNumItems will contain number of items.
|
||||
*/
|
||||
virtual nsresult GetNumberOfRedoItems(PRInt32 *aNumItems) = 0;
|
||||
NS_IMETHOD GetNumberOfRedoItems(PRInt32 *aNumItems) = 0;
|
||||
|
||||
/**
|
||||
* Sets the maximum number of transaction items the transaction manager will
|
||||
@ -110,19 +110,19 @@ public:
|
||||
* stacks if the value specified is less than the number of items that exist
|
||||
* on both the undo and redo stacks.
|
||||
*/
|
||||
virtual nsresult SetMaxTransactionCount(PRInt32 aMaxCount) = 0;
|
||||
NS_IMETHOD SetMaxTransactionCount(PRInt32 aMaxCount) = 0;
|
||||
|
||||
/**
|
||||
* Returns a pointer to the transaction at the top of the undo stack.
|
||||
* @param aTransaction will contain pointer to the transaction.
|
||||
*/
|
||||
virtual nsresult PeekUndoStack(nsITransaction **aTransaction) = 0;
|
||||
NS_IMETHOD PeekUndoStack(nsITransaction **aTransaction) = 0;
|
||||
|
||||
/**
|
||||
* Returns a pointer to the transaction at the top of the redo stack.
|
||||
* @param aTransaction will contain pointer to the transaction.
|
||||
*/
|
||||
virtual nsresult PeekRedoStack(nsITransaction **aTransaction) = 0;
|
||||
NS_IMETHOD PeekRedoStack(nsITransaction **aTransaction) = 0;
|
||||
|
||||
/**
|
||||
* Writes a stream representation of the transaction manager and it's
|
||||
@ -130,7 +130,7 @@ public:
|
||||
* execution stacks.
|
||||
* @param aOutputStream the stream to write to.
|
||||
*/
|
||||
virtual nsresult Write(nsIOutputStream *aOutputStream) = 0;
|
||||
NS_IMETHOD Write(nsIOutputStream *aOutputStream) = 0;
|
||||
|
||||
/**
|
||||
* Adds a listener to the transaction manager's notification list. Listeners
|
||||
@ -139,7 +139,7 @@ public:
|
||||
* The listener's AddRef() method is called.
|
||||
* @param aListener the lister to add.
|
||||
*/
|
||||
virtual nsresult AddListener(nsITransactionListener *aListener) = 0;
|
||||
NS_IMETHOD AddListener(nsITransactionListener *aListener) = 0;
|
||||
|
||||
/**
|
||||
* Removes a listener from the transaction manager's notification list.
|
||||
@ -147,7 +147,7 @@ public:
|
||||
* The listener's Release() method is called.
|
||||
* @param aListener the lister to remove.
|
||||
*/
|
||||
virtual nsresult RemoveListener(nsITransactionListener *aListener) = 0;
|
||||
NS_IMETHOD RemoveListener(nsITransactionListener *aListener) = 0;
|
||||
};
|
||||
|
||||
#endif // nsITransactionManager_h__
|
||||
|
@ -81,7 +81,7 @@ NS_IMPL_RELEASE(nsTransactionManager)
|
||||
|
||||
#endif
|
||||
|
||||
nsresult
|
||||
NS_IMETHODIMP
|
||||
nsTransactionManager::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
{
|
||||
if (nsnull == aInstancePtr) {
|
||||
@ -101,7 +101,7 @@ nsTransactionManager::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
nsresult
|
||||
NS_IMETHODIMP
|
||||
nsTransactionManager::Do(nsITransaction *aTransaction)
|
||||
{
|
||||
nsresult result;
|
||||
@ -143,7 +143,7 @@ nsTransactionManager::Do(nsITransaction *aTransaction)
|
||||
return result;
|
||||
}
|
||||
|
||||
nsresult
|
||||
NS_IMETHODIMP
|
||||
nsTransactionManager::Undo()
|
||||
{
|
||||
nsresult result = NS_OK;
|
||||
@ -222,7 +222,7 @@ nsTransactionManager::Undo()
|
||||
return result;
|
||||
}
|
||||
|
||||
nsresult
|
||||
NS_IMETHODIMP
|
||||
nsTransactionManager::Redo()
|
||||
{
|
||||
nsresult result = NS_OK;
|
||||
@ -301,7 +301,7 @@ nsTransactionManager::Redo()
|
||||
return result;
|
||||
}
|
||||
|
||||
nsresult
|
||||
NS_IMETHODIMP
|
||||
nsTransactionManager::Clear()
|
||||
{
|
||||
nsresult result;
|
||||
@ -322,7 +322,7 @@ nsTransactionManager::Clear()
|
||||
return result;
|
||||
}
|
||||
|
||||
nsresult
|
||||
NS_IMETHODIMP
|
||||
nsTransactionManager::BeginBatch()
|
||||
{
|
||||
nsresult result;
|
||||
@ -358,7 +358,7 @@ nsTransactionManager::BeginBatch()
|
||||
return result;
|
||||
}
|
||||
|
||||
nsresult
|
||||
NS_IMETHODIMP
|
||||
nsTransactionManager::EndBatch()
|
||||
{
|
||||
nsTransactionItem *tx = 0;
|
||||
@ -417,7 +417,7 @@ nsTransactionManager::EndBatch()
|
||||
return result;
|
||||
}
|
||||
|
||||
nsresult
|
||||
NS_IMETHODIMP
|
||||
nsTransactionManager::GetNumberOfUndoItems(PRInt32 *aNumItems)
|
||||
{
|
||||
nsresult result;
|
||||
@ -429,7 +429,7 @@ nsTransactionManager::GetNumberOfUndoItems(PRInt32 *aNumItems)
|
||||
return result;
|
||||
}
|
||||
|
||||
nsresult
|
||||
NS_IMETHODIMP
|
||||
nsTransactionManager::GetNumberOfRedoItems(PRInt32 *aNumItems)
|
||||
{
|
||||
nsresult result;
|
||||
@ -441,7 +441,7 @@ nsTransactionManager::GetNumberOfRedoItems(PRInt32 *aNumItems)
|
||||
return result;
|
||||
}
|
||||
|
||||
nsresult
|
||||
NS_IMETHODIMP
|
||||
nsTransactionManager::SetMaxTransactionCount(PRInt32 aMaxCount)
|
||||
{
|
||||
PRInt32 numUndoItems = 0, numRedoItems = 0, total = 0;
|
||||
@ -543,7 +543,7 @@ nsTransactionManager::SetMaxTransactionCount(PRInt32 aMaxCount)
|
||||
return result;
|
||||
}
|
||||
|
||||
nsresult
|
||||
NS_IMETHODIMP
|
||||
nsTransactionManager::PeekUndoStack(nsITransaction **aTransaction)
|
||||
{
|
||||
nsTransactionItem *tx = 0;
|
||||
@ -570,7 +570,7 @@ nsTransactionManager::PeekUndoStack(nsITransaction **aTransaction)
|
||||
return result;
|
||||
}
|
||||
|
||||
nsresult
|
||||
NS_IMETHODIMP
|
||||
nsTransactionManager::PeekRedoStack(nsITransaction **aTransaction)
|
||||
{
|
||||
nsTransactionItem *tx = 0;
|
||||
@ -597,7 +597,7 @@ nsTransactionManager::PeekRedoStack(nsITransaction **aTransaction)
|
||||
return result;
|
||||
}
|
||||
|
||||
nsresult
|
||||
NS_IMETHODIMP
|
||||
nsTransactionManager::Write(nsIOutputStream *aOutputStream)
|
||||
{
|
||||
PRUint32 len;
|
||||
@ -614,7 +614,7 @@ nsTransactionManager::Write(nsIOutputStream *aOutputStream)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult
|
||||
NS_IMETHODIMP
|
||||
nsTransactionManager::AddListener(nsITransactionListener *aListener)
|
||||
{
|
||||
if (!aListener)
|
||||
@ -643,7 +643,7 @@ nsTransactionManager::AddListener(nsITransactionListener *aListener)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult
|
||||
NS_IMETHODIMP
|
||||
nsTransactionManager::RemoveListener(nsITransactionListener *aListener)
|
||||
{
|
||||
if (!aListener)
|
||||
|
@ -54,20 +54,20 @@ public:
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
/* nsITransactionManager method implementations. */
|
||||
virtual nsresult Do(nsITransaction *aTransaction);
|
||||
virtual nsresult Undo(void);
|
||||
virtual nsresult Redo(void);
|
||||
virtual nsresult Clear(void);
|
||||
virtual nsresult BeginBatch(void);
|
||||
virtual nsresult EndBatch(void);
|
||||
virtual nsresult GetNumberOfUndoItems(PRInt32 *aNumItems);
|
||||
virtual nsresult GetNumberOfRedoItems(PRInt32 *aNumItems);
|
||||
virtual nsresult SetMaxTransactionCount(PRInt32 aMaxCount);
|
||||
virtual nsresult PeekUndoStack(nsITransaction **aTransaction);
|
||||
virtual nsresult PeekRedoStack(nsITransaction **aTransaction);
|
||||
virtual nsresult Write(nsIOutputStream *aOutputStream);
|
||||
virtual nsresult AddListener(nsITransactionListener *aListener);
|
||||
virtual nsresult RemoveListener(nsITransactionListener *aListener);
|
||||
NS_IMETHOD Do(nsITransaction *aTransaction);
|
||||
NS_IMETHOD Undo(void);
|
||||
NS_IMETHOD Redo(void);
|
||||
NS_IMETHOD Clear(void);
|
||||
NS_IMETHOD BeginBatch(void);
|
||||
NS_IMETHOD EndBatch(void);
|
||||
NS_IMETHOD GetNumberOfUndoItems(PRInt32 *aNumItems);
|
||||
NS_IMETHOD GetNumberOfRedoItems(PRInt32 *aNumItems);
|
||||
NS_IMETHOD SetMaxTransactionCount(PRInt32 aMaxCount);
|
||||
NS_IMETHOD PeekUndoStack(nsITransaction **aTransaction);
|
||||
NS_IMETHOD PeekRedoStack(nsITransaction **aTransaction);
|
||||
NS_IMETHOD Write(nsIOutputStream *aOutputStream);
|
||||
NS_IMETHOD AddListener(nsITransactionListener *aListener);
|
||||
NS_IMETHOD RemoveListener(nsITransactionListener *aListener);
|
||||
|
||||
/* nsTransactionManager specific methods. */
|
||||
virtual nsresult ClearUndoStack(void);
|
||||
|
Loading…
x
Reference in New Issue
Block a user