summaryrefslogtreecommitdiffstats
path: root/js/xpconnect/public/xpc_map_end.h
blob: 07f0f0b707c5b5364c8d2167f3f29c8dea51d088 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

// If you include this file you must also include xpc_make_class.h at the top
// of the file doing the including.

#ifndef XPC_MAP_CLASSNAME
#  error "Must #define XPC_MAP_CLASSNAME before #including xpc_map_end.h"
#endif

#ifndef XPC_MAP_QUOTED_CLASSNAME
#  error "Must #define XPC_MAP_QUOTED_CLASSNAME before #including xpc_map_end.h"
#endif

#ifndef XPC_MAP_FLAGS
#  error "Must #define XPC_MAP_FLAGS before #including xpc_map_end.h"
#endif

#include "js/Id.h"

/**************************************************************/

NS_IMETHODIMP XPC_MAP_CLASSNAME::GetClassName(nsACString& aClassName) {
  aClassName.AssignLiteral(XPC_MAP_QUOTED_CLASSNAME);
  return NS_OK;
}

/**************************************************************/

// virtual
uint32_t XPC_MAP_CLASSNAME::GetScriptableFlags() { return (XPC_MAP_FLAGS); }

// virtual
const JSClass* XPC_MAP_CLASSNAME::GetJSClass() {
  static const JSClassOps classOps = XPC_MAKE_CLASS_OPS(GetScriptableFlags());
  static const JSClass klass =
      XPC_MAKE_CLASS(XPC_MAP_QUOTED_CLASSNAME, GetScriptableFlags(), &classOps);
  return &klass;
}

/**************************************************************/

#if !((XPC_MAP_FLAGS)&XPC_SCRIPTABLE_WANT_PRECREATE)
NS_IMETHODIMP XPC_MAP_CLASSNAME::PreCreate(nsISupports* nativeObj,
                                           JSContext* cx, JSObject* globalObj,
                                           JSObject** parentObj) {
  NS_ERROR("never called");
  return NS_ERROR_NOT_IMPLEMENTED;
}
#endif

#if !((XPC_MAP_FLAGS)&XPC_SCRIPTABLE_WANT_NEWENUMERATE)
NS_IMETHODIMP XPC_MAP_CLASSNAME::NewEnumerate(
    nsIXPConnectWrappedNative* wrapper, JSContext* cx, JSObject* obj,
    JS::MutableHandleIdVector properties, bool enumerableOnly, bool* _retval) {
  NS_ERROR("never called");
  return NS_ERROR_NOT_IMPLEMENTED;
}
#endif

#if !((XPC_MAP_FLAGS)&XPC_SCRIPTABLE_WANT_RESOLVE)
NS_IMETHODIMP XPC_MAP_CLASSNAME::Resolve(nsIXPConnectWrappedNative* wrapper,
                                         JSContext* cx, JSObject* obj, jsid id,
                                         bool* resolvedp, bool* _retval) {
  NS_ERROR("never called");
  return NS_ERROR_NOT_IMPLEMENTED;
}
#endif

#if !((XPC_MAP_FLAGS)&XPC_SCRIPTABLE_WANT_FINALIZE)
NS_IMETHODIMP XPC_MAP_CLASSNAME::Finalize(nsIXPConnectWrappedNative* wrapper,
                                          JSFreeOp* fop, JSObject* obj) {
  NS_ERROR("never called");
  return NS_ERROR_NOT_IMPLEMENTED;
}
#endif

#if !((XPC_MAP_FLAGS)&XPC_SCRIPTABLE_WANT_CALL)
NS_IMETHODIMP XPC_MAP_CLASSNAME::Call(nsIXPConnectWrappedNative* wrapper,
                                      JSContext* cx, JSObject* obj,
                                      const JS::CallArgs& args, bool* _retval) {
  NS_ERROR("never called");
  return NS_ERROR_NOT_IMPLEMENTED;
}
#endif

#if !((XPC_MAP_FLAGS)&XPC_SCRIPTABLE_WANT_CONSTRUCT)
NS_IMETHODIMP XPC_MAP_CLASSNAME::Construct(nsIXPConnectWrappedNative* wrapper,
                                           JSContext* cx, JSObject* obj,
                                           const JS::CallArgs& args,
                                           bool* _retval) {
  NS_ERROR("never called");
  return NS_ERROR_NOT_IMPLEMENTED;
}
#endif

#if !((XPC_MAP_FLAGS)&XPC_SCRIPTABLE_WANT_HASINSTANCE)
NS_IMETHODIMP XPC_MAP_CLASSNAME::HasInstance(nsIXPConnectWrappedNative* wrapper,
                                             JSContext* cx, JSObject* obj,
                                             JS::HandleValue val, bool* bp,
                                             bool* _retval) {
  NS_ERROR("never called");
  return NS_ERROR_NOT_IMPLEMENTED;
}
#endif

/**************************************************************/

#undef XPC_MAP_CLASSNAME
#undef XPC_MAP_QUOTED_CLASSNAME
#undef XPC_MAP_FLAGS