1 /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
15 * The Original Code is mozilla.org code.
17 * The Initial Developer of the Original Code is
18 * Netscape Communications Corporation.
19 * Portions created by the Initial Developer are Copyright (C) 1998
20 * the Initial Developer. All Rights Reserved.
23 * Scott Collins <scc@mozilla.org>: |do_QueryElementAt|
25 * Alternatively, the contents of this file may be used under the terms of
26 * either of the GNU General Public License Version 2 or later (the "GPL"),
27 * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
28 * in which case the provisions of the GPL or the LGPL are applicable instead
29 * of those above. If you wish to allow use of your version of this file only
30 * under the terms of either the GPL or the LGPL, and not to allow others to
31 * use your version of this file under the terms of the MPL, indicate your
32 * decision by deleting the provisions above and replace them with the notice
33 * and other provisions required by the GPL or the LGPL. If you do not delete
34 * the provisions above, a recipient may use your version of this file under
35 * the terms of any one of the MPL, the GPL or the LGPL.
37 * ***** END LICENSE BLOCK ***** */
39 #include
"nsISerializable.idl"
40 #include
"nsIEnumerator.idl"
42 [scriptable
, uuid(83b6019c
-cbc4
-11d2
-8cca
-0060b0fc14a3
)]
43 interface nsICollection
: nsISerializable
47 nsISupports GetElementAt
(in PRUint32 index
);
48 void QueryElementAt
(in PRUint32 index
, in nsIIDRef
uuid,
49 [iid_is(uuid),retval] out nsQIResult result
);
50 void SetElementAt
(in PRUint32 index
, in nsISupports item
);
51 void AppendElement
(in nsISupports item
);
52 void RemoveElement
(in nsISupports item
);
54 nsIEnumerator Enumerate
();
66 class NS_COM nsQueryElementAt
: public nsCOMPtr_helper
69 nsQueryElementAt
( nsICollection
* aCollection
, PRUint32 aIndex
, nsresult
* aErrorPtr
)
70 : mCollection
(aCollection
),
74 // nothing else to do here
77 virtual nsresult NS_FASTCALL operator
()( const nsIID
& aIID
, void** ) const;
80 nsICollection
* mCollection
;
86 const nsQueryElementAt
87 do_QueryElementAt
( nsICollection
* aCollection
, PRUint32 aIndex
, nsresult
* aErrorPtr
= 0 )
89 return nsQueryElementAt
(aCollection
, aIndex
, aErrorPtr
);