sbMediaListEnumArrayHelper.h
Go to the documentation of this file.
1 /*
2  *=BEGIN SONGBIRD GPL
3  *
4  * This file is part of the Songbird web player.
5  *
6  * Copyright(c) 2005-2010 POTI, Inc.
7  * http://www.songbirdnest.com
8  *
9  * This file may be licensed under the terms of of the
10  * GNU General Public License Version 2 (the ``GPL'').
11  *
12  * Software distributed under the License is distributed
13  * on an ``AS IS'' basis, WITHOUT WARRANTY OF ANY KIND, either
14  * express or implied. See the GPL for the specific language
15  * governing rights and limitations.
16  *
17  * You should have received a copy of the GPL along with this
18  * program. If not, go to http://www.gnu.org/licenses/gpl.html
19  * or write to the Free Software Foundation, Inc.,
20  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21  *
22  *=END SONGBIRD GPL
23  */
24 
25 #ifndef sbMediaListEnumArrayHelper_h_
26 #define sbMediaListEnumArrayHelper_h_
27 
28 #include <nsCOMPtr.h>
29 #include <nsIMutableArray.h>
30 #include <sbIMediaListListener.h>
31 
32 
33 //------------------------------------------------------------------------------
34 //
35 // Helper class for fetching an array of media items during an enumeration.
36 //
37 //------------------------------------------------------------------------------
38 
40 {
41 public:
44 
46  NS_DECL_SBIMEDIALISTENUMERATIONLISTENER
47 
54  static sbMediaListEnumArrayHelper * New(nsIArray * aArray = nsnull);
60  nsresult Init(nsIArray * aArray = nsnull);
61 
62  NS_IMETHOD GetMediaItemsArray(nsIArray **aOutArray);
63 
64 protected:
65  nsCOMPtr<nsIMutableArray> mItemsArray;
66 };
67 
68 #endif // sbMediaListEnumArrayHelper_h_
69 
nsresult Init(nsIArray *aArray=nsnull)
Resets and clears the media items array. Be sure to call this method before using this class as a enu...
Interface used to enumerate the items in a media list.
NS_IMETHOD GetMediaItemsArray(nsIArray **aOutArray)
nsCOMPtr< nsIMutableArray > mItemsArray
NS_DECL_ISUPPORTS static NS_DECL_SBIMEDIALISTENUMERATIONLISTENER sbMediaListEnumArrayHelper * New(nsIArray *aArray=nsnull)
Creates a enum array helper and initializes it.