Wed, 31 Dec 2014 07:16:47 +0100
Revert simplistic fix pending revisit of Mozilla integration attempt.
michael@0 | 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | #include "nsISupports.idl" |
michael@0 | 7 | |
michael@0 | 8 | interface nsITransaction; |
michael@0 | 9 | |
michael@0 | 10 | /* |
michael@0 | 11 | * The nsITransactionList interface. |
michael@0 | 12 | * <P> |
michael@0 | 13 | * The implementation for this interface is provided by the Transaction Manager. |
michael@0 | 14 | * This interface provides a mechanism for accessing the transactions on the |
michael@0 | 15 | * Undo or Redo stacks as well as any auto-aggregated children that a |
michael@0 | 16 | * transaction may have. |
michael@0 | 17 | */ |
michael@0 | 18 | [scriptable, uuid(d007ceff-c978-486a-b697-384ca01997be)] |
michael@0 | 19 | |
michael@0 | 20 | interface nsITransactionList : nsISupports |
michael@0 | 21 | { |
michael@0 | 22 | /** |
michael@0 | 23 | * The number of transactions contained in this list. |
michael@0 | 24 | */ |
michael@0 | 25 | readonly attribute long numItems; |
michael@0 | 26 | |
michael@0 | 27 | /** |
michael@0 | 28 | * itemIsBatch() returns true if the item at aIndex is a batch. Note that |
michael@0 | 29 | * currently there is no requirement for a TransactionManager implementation |
michael@0 | 30 | * to associate a toplevel nsITransaction with a batch so it is possible for |
michael@0 | 31 | * itemIsBatch() to return true and getItem() to return null. However, you |
michael@0 | 32 | * can still access the transactions contained in the batch with a call to |
michael@0 | 33 | * getChildListForItem(). |
michael@0 | 34 | * @param aIndex The index of the item in the list. |
michael@0 | 35 | */ |
michael@0 | 36 | boolean itemIsBatch(in long aIndex); |
michael@0 | 37 | |
michael@0 | 38 | /** |
michael@0 | 39 | * getItem() returns the transaction at the given index in the list. Note that |
michael@0 | 40 | * a null can be returned here if the item is a batch. The transaction |
michael@0 | 41 | * returned is AddRef'd so it is up to the caller to Release the transaction |
michael@0 | 42 | * when it is done. |
michael@0 | 43 | * @param aIndex The index of the item in the list. |
michael@0 | 44 | */ |
michael@0 | 45 | nsITransaction getItem(in long aIndex); |
michael@0 | 46 | |
michael@0 | 47 | /** |
michael@0 | 48 | * getData() returns the data (of type nsISupports array) associated with |
michael@0 | 49 | * the transaction list. |
michael@0 | 50 | */ |
michael@0 | 51 | void getData(in long aIndex, [optional] out unsigned long aLength, |
michael@0 | 52 | [array, size_is(aLength), retval] out nsISupports aData); |
michael@0 | 53 | |
michael@0 | 54 | /** |
michael@0 | 55 | * getNumChildrenForItem() returns the number of child (auto-aggreated) |
michael@0 | 56 | * transactions the item at aIndex has. |
michael@0 | 57 | * @param aIndex The index of the item in the list. |
michael@0 | 58 | */ |
michael@0 | 59 | long getNumChildrenForItem(in long aIndex); |
michael@0 | 60 | |
michael@0 | 61 | /** |
michael@0 | 62 | * getChildListForItem() returns the list of children associated with the |
michael@0 | 63 | * item at aIndex. Implementations may return null if there are no children, |
michael@0 | 64 | * or an empty list. The list returned is AddRef'd so it is up to the caller |
michael@0 | 65 | * to Release the transaction when it is done. |
michael@0 | 66 | * @param aIndex The index of the item in the list. |
michael@0 | 67 | */ |
michael@0 | 68 | nsITransactionList getChildListForItem(in long aIndex); |
michael@0 | 69 | }; |
michael@0 | 70 |