sbScriptableFilterItems.h
Go to the documentation of this file.
1 /*
2 //
3 // BEGIN SONGBIRD GPL
4 //
5 // This file is part of the Songbird web player.
6 //
7 // Copyright(c) 2005-2008 POTI, Inc.
8 // http://songbirdnest.com
9 //
10 // This file may be licensed under the terms of of the
11 // GNU General Public License Version 2 (the "GPL").
12 //
13 // Software distributed under the License is distributed
14 // on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
15 // express or implied. See the GPL for the specific language
16 // governing rights and limitations.
17 //
18 // You should have received a copy of the GPL along with this
19 // program. If not, go to http://www.gnu.org/licenses/gpl.html
20 // or write to the Free Software Foundation, Inc.,
21 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 //
23 // END SONGBIRD GPL
24 //
25  */
26 
27 #ifndef __SB_SCRIPTABLE_FILTER_ITEMS_H__
28 #define __SB_SCRIPTABLE_FILTER_ITEMS_H__
29 
30 #include "sbXPCScriptableStub.h"
31 
32 #include <nsAutoPtr.h>
33 #include <nsCOMArray.h>
34 #include <nsCOMPtr.h>
35 #include <nsIClassInfo.h>
36 #include <nsISecurityCheckedComponent.h>
37 #include <nsISimpleEnumerator.h>
38 #include <nsVoidArray.h>
39 
40 #include <set>
41 
43 class sbIMediaItem;
44 class sbRemotePlayer;
45 
51  public nsISimpleEnumerator,
52  public sbXPCScriptableStub
53 {
54 // this is used for QI, to ensure that we indeed have an instance of this class
55 // {E26A6BC3-7FFE-44f5-8348-D499F2A6CD12}
56 #define SB_SCRIPTABLE_FILETER_ITEMS_CID \
57  { 0xe26a6bc3, 0x7ffe, 0x44f5, \
58  { 0x83, 0x48, 0xd4, 0x99, 0xf2, 0xa6, 0xcd, 0x12 } }
59 public:
60  NS_DECLARE_STATIC_IID_ACCESSOR(SB_SCRIPTABLE_FILETER_ITEMS_CID)
62  NS_DECL_NSICLASSINFO
63  NS_DECL_NSISECURITYCHECKEDCOMPONENT
64  NS_DECL_NSISIMPLEENUMERATOR
65 
66  /* nsIXPCScriptable */
67  NS_IMETHOD GetClassName(char * *aClassName);
68  NS_IMETHOD GetScriptableFlags(PRUint32 *aScriptableFlags);
69  NS_IMETHOD GetProperty(nsIXPConnectWrappedNative *wrapper, JSContext * cx, JSObject * obj, jsval id, jsval * vp, PRBool *_retval);
70  NS_IMETHOD NewEnumerate(nsIXPConnectWrappedNative *wrapper, JSContext * cx, JSObject * obj, PRUint32 enum_op, jsval * statep, jsid *idp, PRBool *_retval);
71  NS_IMETHOD NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext * cx, JSObject * obj, jsval id, PRUint32 flags, JSObject * *objp, PRBool *_retval);
72  NS_IMETHOD Equality( nsIXPConnectWrappedNative *wrapper,
73  JSContext * cx,
74  JSObject * obj,
75  jsval val,
76  PRBool *_retval );
77 
79  sbRemotePlayer *aPlayer );
80  sbScriptableFilterItems( const nsCOMArray<sbIMediaItem>& aItems,
81  sbRemotePlayer *aPlayer );
82 
83 private:
85 
86 protected:
87  // iterator over the enumerator and fill out the list
88  nsresult ReadEnumerator();
89 
90 protected:
92  nsCOMArray<sbIMediaItem> mItems;
93  PRBool mHasItems;
96 };
97 
98 #endif // __SB_SCRIPTABLE_FILTER_ITEMS_H__
NS_IMETHOD GetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx, JSObject *obj, jsval id, jsval *vp, PRBool *_retval)
#define SB_SCRIPTABLE_FILETER_ITEMS_CID
sbDeviceFirmwareAutoCheckForUpdate prototype flags
NS_IMETHOD NewEnumerate(nsIXPConnectWrappedNative *wrapper, JSContext *cx, JSObject *obj, PRUint32 enum_op, jsval *statep, jsid *idp, PRBool *_retval)
nsISecurityCheckedComponent
NS_IMETHOD Equality(nsIXPConnectWrappedNative *wrapper, JSContext *cx, JSObject *obj, jsval val, PRBool *_retval)
Control the filter settings on a media list.
nsCOMPtr< sbIFilterableMediaListView > mListView
this _dialogInput val(dateText)
NS_IMETHOD NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx, JSObject *obj, jsval id, PRUint32 flags, JSObject **objp, PRBool *_retval)
nsCOMArray< sbIMediaItem > mItems
nsRefPtr< sbRemotePlayer > mPlayer
NS_DECL_ISUPPORTS NS_DECL_NSICLASSINFO NS_DECL_NSISECURITYCHECKEDCOMPONENT NS_DECL_NSISIMPLEENUMERATOR NS_IMETHOD GetClassName(char **aClassName)
Interface that defines a single item of media in the system.
NS_IMETHOD GetScriptableFlags(PRUint32 *aScriptableFlags)