1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 // If you include this file you must also include xpc_make_class.h at the top
8 // of the file doing the including.
10 #ifndef XPC_MAP_CLASSNAME
11 # error "Must #define XPC_MAP_CLASSNAME before #including xpc_map_end.h"
14 #ifndef XPC_MAP_QUOTED_CLASSNAME
15 # error "Must #define XPC_MAP_QUOTED_CLASSNAME before #including xpc_map_end.h"
19 # error "Must #define XPC_MAP_FLAGS before #including xpc_map_end.h"
24 /**************************************************************/
26 NS_IMETHODIMP
XPC_MAP_CLASSNAME::GetClassName(nsACString
& aClassName
) {
27 aClassName
.AssignLiteral(XPC_MAP_QUOTED_CLASSNAME
);
31 /**************************************************************/
34 uint32_t XPC_MAP_CLASSNAME::GetScriptableFlags() { return (XPC_MAP_FLAGS
); }
37 const JSClass
* XPC_MAP_CLASSNAME::GetJSClass() {
38 static const JSClassOps classOps
= XPC_MAKE_CLASS_OPS(GetScriptableFlags());
39 static const JSClass klass
=
40 XPC_MAKE_CLASS(XPC_MAP_QUOTED_CLASSNAME
, GetScriptableFlags(), &classOps
);
44 /**************************************************************/
46 #if !((XPC_MAP_FLAGS) & XPC_SCRIPTABLE_WANT_PRECREATE)
47 NS_IMETHODIMP
XPC_MAP_CLASSNAME::PreCreate(nsISupports
* nativeObj
,
48 JSContext
* cx
, JSObject
* globalObj
,
49 JSObject
** parentObj
) {
50 NS_ERROR("never called");
51 return NS_ERROR_NOT_IMPLEMENTED
;
55 #if !((XPC_MAP_FLAGS) & XPC_SCRIPTABLE_WANT_NEWENUMERATE)
56 NS_IMETHODIMP
XPC_MAP_CLASSNAME::NewEnumerate(
57 nsIXPConnectWrappedNative
* wrapper
, JSContext
* cx
, JSObject
* obj
,
58 JS::MutableHandleIdVector properties
, bool enumerableOnly
, bool* _retval
) {
59 NS_ERROR("never called");
60 return NS_ERROR_NOT_IMPLEMENTED
;
64 #if !((XPC_MAP_FLAGS) & XPC_SCRIPTABLE_WANT_RESOLVE)
65 NS_IMETHODIMP
XPC_MAP_CLASSNAME::Resolve(nsIXPConnectWrappedNative
* wrapper
,
66 JSContext
* cx
, JSObject
* obj
, jsid id
,
67 bool* resolvedp
, bool* _retval
) {
68 NS_ERROR("never called");
69 return NS_ERROR_NOT_IMPLEMENTED
;
73 #if !((XPC_MAP_FLAGS) & XPC_SCRIPTABLE_WANT_FINALIZE)
74 NS_IMETHODIMP
XPC_MAP_CLASSNAME::Finalize(nsIXPConnectWrappedNative
* wrapper
,
75 JS::GCContext
* gcx
, JSObject
* obj
) {
76 NS_ERROR("never called");
77 return NS_ERROR_NOT_IMPLEMENTED
;
81 #if !((XPC_MAP_FLAGS) & XPC_SCRIPTABLE_WANT_CALL)
82 NS_IMETHODIMP
XPC_MAP_CLASSNAME::Call(nsIXPConnectWrappedNative
* wrapper
,
83 JSContext
* cx
, JSObject
* obj
,
84 const JS::CallArgs
& args
, bool* _retval
) {
85 NS_ERROR("never called");
86 return NS_ERROR_NOT_IMPLEMENTED
;
90 #if !((XPC_MAP_FLAGS) & XPC_SCRIPTABLE_WANT_CONSTRUCT)
91 NS_IMETHODIMP
XPC_MAP_CLASSNAME::Construct(nsIXPConnectWrappedNative
* wrapper
,
92 JSContext
* cx
, JSObject
* obj
,
93 const JS::CallArgs
& args
,
95 NS_ERROR("never called");
96 return NS_ERROR_NOT_IMPLEMENTED
;
100 #if !((XPC_MAP_FLAGS) & XPC_SCRIPTABLE_WANT_HASINSTANCE)
101 NS_IMETHODIMP
XPC_MAP_CLASSNAME::HasInstance(nsIXPConnectWrappedNative
* wrapper
,
102 JSContext
* cx
, JSObject
* obj
,
103 JS::HandleValue val
, bool* bp
,
105 NS_ERROR("never called");
106 return NS_ERROR_NOT_IMPLEMENTED
;
110 /**************************************************************/
112 #undef XPC_MAP_CLASSNAME
113 #undef XPC_MAP_QUOTED_CLASSNAME