sbScriptableFunction.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_FUNCTION_H__
28 #define __SB_SCRIPTABLE_FUNCTION_H__
29 
30 #include "sbXPCScriptableStub.h"
31 
32 #include <nsCOMPtr.h>
33 #include <nsIClassInfo.h>
34 #include <nsISecurityCheckedComponent.h>
35 
43  public sbXPCScriptableStub
44 {
45 public:
47  NS_DECL_NSICLASSINFO
48  NS_DECL_NSISECURITYCHECKEDCOMPONENT
49 
50  /* nsIXPCScriptable */
51  NS_IMETHOD GetClassName(char * *aClassName);
52  NS_IMETHOD GetScriptableFlags(PRUint32 *aScriptableFlags);
53  /* not implemented base classes must impl */
54  NS_IMETHOD Call( nsIXPConnectWrappedNative *wrapper,
55  JSContext *cx,
56  JSObject *obj,
57  PRUint32 argc,
58  jsval *argv,
59  jsval *vp,
60  PRBool *_retval ) = 0;
61 
62 protected:
64  virtual ~sbScriptableFunctionBase();
65 };
66 
68 {
69 public:
70  NS_DECL_ISUPPORTS_INHERITED
71 
72  /* nsIXPCScriptable */
73  NS_IMETHOD Call(nsIXPConnectWrappedNative *wrapper,
74  JSContext *cx,
75  JSObject *obj,
76  PRUint32 argc,
77  jsval *argv,
78  jsval *vp,
79  PRBool *_retval );
80 
81  sbScriptableLibraryFunction( nsISupports *aObject, const nsIID& aIID );
82 
83 protected:
85 
86  nsCOMPtr<nsISupports> mObject;
87  nsIID mIID;
88 };
89 
91 {
92 public:
93  NS_DECL_ISUPPORTS_INHERITED
94 
95  /* nsIXPCScriptable */
96  NS_IMETHOD Call( nsIXPConnectWrappedNative *wrapper,
97  JSContext * cx,
98  JSObject * obj,
99  PRUint32 argc,
100  jsval * argv,
101  jsval * vp,
102  PRBool *_retval );
103 
105 
106 protected:
108 };
109 
110 #endif // __SB_SCRIPTABLE_FUNCTION_H__
NS_IMETHOD Call(nsIXPConnectWrappedNative *wrapper, JSContext *cx, JSObject *obj, PRUint32 argc, jsval *argv, jsval *vp, PRBool *_retval)=0
NS_DECL_ISUPPORTS_INHERITED NS_IMETHOD Call(nsIXPConnectWrappedNative *wrapper, JSContext *cx, JSObject *obj, PRUint32 argc, jsval *argv, jsval *vp, PRBool *_retval)
NS_DECL_ISUPPORTS_INHERITED NS_IMETHOD Call(nsIXPConnectWrappedNative *wrapper, JSContext *cx, JSObject *obj, PRUint32 argc, jsval *argv, jsval *vp, PRBool *_retval)
sbScriptableLibraryFunction(nsISupports *aObject, const nsIID &aIID)
nsISecurityCheckedComponent
nsCOMPtr< nsISupports > mObject
NS_DECL_ISUPPORTS NS_DECL_NSICLASSINFO NS_DECL_NSISECURITYCHECKEDCOMPONENT NS_IMETHOD GetClassName(char **aClassName)
NS_IMETHOD GetScriptableFlags(PRUint32 *aScriptableFlags)