michael@0: /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: michael@0: #include "nsICollection.idl" michael@0: michael@0: /* michael@0: * This entire interface is deprecated and should not be used. michael@0: * See nsIArray and nsIMutableArray for the new implementations. michael@0: * michael@0: * http://groups.google.com/groups?q=nsisupportsarray+group:netscape.public.mozilla.xpcom&hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=3D779491.3050506%40netscape.com&rnum=2 michael@0: * http://groups.google.com/groups?q=nsisupportsarray+group:netscape.public.mozilla.xpcom&hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=al8412%245ab2%40ripley.netscape.com&rnum=8 michael@0: */ michael@0: michael@0: %{C++ michael@0: michael@0: class nsIBidirectionalEnumerator; michael@0: class nsISupportsArray; michael@0: michael@0: #define NS_SUPPORTSARRAY_CID \ michael@0: { /* bda17d50-0d6b-11d3-9331-00104ba0fd40 */ \ michael@0: 0xbda17d50, \ michael@0: 0x0d6b, \ michael@0: 0x11d3, \ michael@0: {0x93, 0x31, 0x00, 0x10, 0x4b, 0xa0, 0xfd, 0x40} \ michael@0: } michael@0: #define NS_SUPPORTSARRAY_CONTRACTID "@mozilla.org/supports-array;1" michael@0: michael@0: %} michael@0: michael@0: [scriptable, uuid(241addc8-3608-4e73-8083-2fd6fa09eba2)] michael@0: interface nsISupportsArray : nsICollection { michael@0: michael@0: [notxpcom] boolean Equals([const] in nsISupportsArray other); michael@0: michael@0: [notxpcom] long IndexOf([const] in nsISupports aPossibleElement); michael@0: [notxpcom] long IndexOfStartingAt([const] in nsISupports aPossibleElement, michael@0: in unsigned long aStartIndex); michael@0: [notxpcom] long LastIndexOf([const] in nsISupports aPossibleElement); michael@0: michael@0: // xpcom-compatible versions michael@0: long GetIndexOf(in nsISupports aPossibleElement); michael@0: long GetIndexOfStartingAt(in nsISupports aPossibleElement, michael@0: in unsigned long aStartIndex); michael@0: long GetLastIndexOf(in nsISupports aPossibleElement); michael@0: michael@0: [notxpcom] boolean InsertElementAt(in nsISupports aElement, michael@0: in unsigned long aIndex); michael@0: [notxpcom] boolean ReplaceElementAt(in nsISupports aElement, michael@0: in unsigned long aIndex); michael@0: michael@0: [notxpcom] boolean RemoveElementAt(in unsigned long aIndex); michael@0: [notxpcom] boolean RemoveLastElement([const] in nsISupports aElement); michael@0: michael@0: // xpcom-compatible versions michael@0: void DeleteLastElement(in nsISupports aElement); michael@0: void DeleteElementAt(in unsigned long aIndex); michael@0: michael@0: [notxpcom] boolean AppendElements(in nsISupportsArray aElements); michael@0: michael@0: void Compact(); michael@0: michael@0: michael@0: nsISupportsArray clone(); michael@0: michael@0: [notxpcom] boolean MoveElement(in long aFrom, michael@0: in long aTo); michael@0: michael@0: [notxpcom] boolean InsertElementsAt(in nsISupportsArray aOther, michael@0: in unsigned long aIndex); michael@0: michael@0: [notxpcom] boolean RemoveElementsAt(in unsigned long aIndex, michael@0: in unsigned long aCount); michael@0: michael@0: [notxpcom] boolean SizeTo(in long aSize); michael@0: michael@0: }; michael@0: michael@0: %{C++ michael@0: michael@0: // Construct and return a default implementation of nsISupportsArray: michael@0: extern nsresult michael@0: NS_NewISupportsArray(nsISupportsArray** aInstancePtrResult); michael@0: michael@0: %}