Back to index

lightning-sunbird  0.9+nobinonly
nsISupportsArray.idl
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
00002 /* ***** BEGIN LICENSE BLOCK *****
00003  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00004  *
00005  * The contents of this file are subject to the Mozilla Public License Version
00006  * 1.1 (the "License"); you may not use this file except in compliance with
00007  * the License. You may obtain a copy of the License at
00008  * http://www.mozilla.org/MPL/
00009  *
00010  * Software distributed under the License is distributed on an "AS IS" basis,
00011  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00012  * for the specific language governing rights and limitations under the
00013  * License.
00014  *
00015  * The Original Code is mozilla.org code.
00016  *
00017  * The Initial Developer of the Original Code is
00018  * Netscape Communications Corporation.
00019  * Portions created by the Initial Developer are Copyright (C) 1998
00020  * the Initial Developer. All Rights Reserved.
00021  *
00022  * Contributor(s):
00023  *
00024  * Alternatively, the contents of this file may be used under the terms of
00025  * either of the GNU General Public License Version 2 or later (the "GPL"),
00026  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00027  * in which case the provisions of the GPL or the LGPL are applicable instead
00028  * of those above. If you wish to allow use of your version of this file only
00029  * under the terms of either the GPL or the LGPL, and not to allow others to
00030  * use your version of this file under the terms of the MPL, indicate your
00031  * decision by deleting the provisions above and replace them with the notice
00032  * and other provisions required by the GPL or the LGPL. If you do not delete
00033  * the provisions above, a recipient may use your version of this file under
00034  * the terms of any one of the MPL, the GPL or the LGPL.
00035  *
00036  * ***** END LICENSE BLOCK ***** */
00037 
00038 
00039 #include "nsISupports.idl"
00040 #include "nsICollection.idl"
00041 
00042 /*
00043  * This entire interface is deprecated and should not be used.
00044  * See nsIArray and nsIMutableArray for the new implementations.
00045  *
00046  * 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
00047  * 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
00048  */
00049 
00050 native nsISupportsArrayEnumFunc(nsISupportsArrayEnumFunc);
00051 
00052 %{C++
00053 
00054 class nsIBidirectionalEnumerator;
00055  
00056 #define NS_SUPPORTSARRAY_CID                         \
00057 { /* bda17d50-0d6b-11d3-9331-00104ba0fd40 */         \
00058     0xbda17d50,                                      \
00059     0x0d6b,                                          \
00060     0x11d3,                                          \
00061     {0x93, 0x31, 0x00, 0x10, 0x4b, 0xa0, 0xfd, 0x40} \
00062 }
00063 #define NS_SUPPORTSARRAY_CONTRACTID "@mozilla.org/supports-array;1"
00064 #define NS_SUPPORTSARRAY_CLASSNAME "Supports Array"
00065  
00066 // Enumerator callback function. Return PR_FALSE to stop
00067 typedef PRBool (*nsISupportsArrayEnumFunc)(nsISupports* aElement, void *aData);
00068  
00069 %}
00070 
00071 [scriptable, uuid(791eafa0-b9e6-11d1-8031-006008159b5a)]
00072 interface nsISupportsArray : nsICollection {
00073 
00074   [notxpcom] boolean Equals([const] in nsISupportsArray other);
00075   
00076   [notxpcom] nsISupports ElementAt(in unsigned long aIndex);
00077   
00078   [notxpcom] long IndexOf([const] in nsISupports aPossibleElement);
00079   [notxpcom] long IndexOfStartingAt([const] in nsISupports aPossibleElement,
00080                                     in unsigned long aStartIndex);
00081   [notxpcom] long LastIndexOf([const] in nsISupports aPossibleElement);
00082   
00083   // xpcom-compatible versions
00084   long GetIndexOf(in nsISupports aPossibleElement);
00085   long GetIndexOfStartingAt(in nsISupports aPossibleElement,
00086                             in unsigned long aStartIndex);
00087   long GetLastIndexOf(in nsISupports aPossibleElement);  
00088   
00089   [notxpcom] boolean InsertElementAt(in nsISupports aElement,
00090                                      in unsigned long aIndex);
00091   [notxpcom] boolean ReplaceElementAt(in nsISupports aElement,
00092                                       in unsigned long aIndex);
00093 
00094   [notxpcom] boolean RemoveElementAt(in unsigned long aIndex);
00095   [notxpcom] boolean RemoveLastElement([const] in nsISupports aElement);
00096   
00097   // xpcom-compatible versions
00098   void DeleteLastElement(in nsISupports aElement);
00099   void DeleteElementAt(in unsigned long aIndex);
00100   
00101   [notxpcom] boolean AppendElements(in nsISupportsArray aElements);
00102   
00103   void Compact();
00104   
00105   [notxpcom, noscript]
00106       boolean EnumerateForwards(in nsISupportsArrayEnumFunc aFunc,
00107                                 in voidPtr aData);
00108   [notxpcom, noscript]
00109       boolean EnumerateBackwards(in nsISupportsArrayEnumFunc aFunc,
00110                                  in voidPtr aData);
00111 
00112   nsISupportsArray clone();
00113 
00114   [notxpcom] boolean MoveElement(in long aFrom,
00115                                  in long aTo);
00116 
00117   [notxpcom] boolean InsertElementsAt(in nsISupportsArray aOther,
00118                                       in unsigned long aIndex);
00119 
00120   [notxpcom] boolean RemoveElementsAt(in unsigned long aIndex,
00121                                       in unsigned long aCount);
00122 
00123   [notxpcom] boolean SizeTo(in long aSize);
00124   
00125 };
00126 
00127 %{C++
00128 
00129 // Construct and return a default implementation of nsISupportsArray:
00130 extern NS_COM nsresult
00131 NS_NewISupportsArray(nsISupportsArray** aInstancePtrResult);
00132 
00133 // Construct and return a default implementation of an enumerator for nsISupportsArrays:
00134 extern NS_COM nsresult
00135 NS_NewISupportsArrayEnumerator(nsISupportsArray* array,
00136                                nsIBidirectionalEnumerator* *aInstancePtrResult);
00137 
00138 
00139 %}