2001-09-20 04:02:59 +04:00
|
|
|
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
*
|
2012-05-21 15:12:37 +04:00
|
|
|
* 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/. */
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
2013-09-06 21:50:24 +04:00
|
|
|
#include "nsIClassInfo.idl"
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2012-11-09 19:59:41 +04:00
|
|
|
%{C++
|
|
|
|
#ifdef XP_WIN
|
|
|
|
#undef GetClassName
|
|
|
|
#endif
|
2013-09-10 00:37:37 +04:00
|
|
|
|
|
|
|
#include "js/TypeDecls.h"
|
|
|
|
|
2020-11-23 19:21:38 +03:00
|
|
|
namespace JS {
|
|
|
|
class CallArgs;
|
|
|
|
}
|
|
|
|
|
2012-11-09 19:59:41 +04:00
|
|
|
%}
|
|
|
|
|
2013-09-10 00:37:37 +04:00
|
|
|
interface nsIXPConnectWrappedNative;
|
|
|
|
|
|
|
|
[ptr] native JSContextPtr(JSContext);
|
|
|
|
[ptr] native JSObjectPtr(JSObject);
|
|
|
|
[ptr] native JSValPtr(JS::Value);
|
2022-03-10 11:40:03 +03:00
|
|
|
[ptr] native JSGCContextPtr(JS::GCContext);
|
2013-09-10 00:37:37 +04:00
|
|
|
[ref] native JSCallArgsRef(const JS::CallArgs);
|
2017-01-10 04:47:57 +03:00
|
|
|
[ptr] native JSClassPtr(const JSClass);
|
2022-10-29 02:11:46 +03:00
|
|
|
native JSMutableHandleIdVector(JS::MutableHandleVector<JS::PropertyKey>);
|
2013-09-10 00:37:37 +04:00
|
|
|
|
2017-01-23 05:33:58 +03:00
|
|
|
%{ C++
|
|
|
|
// nsIXPCScriptable flags (only 32 bits available!). They are defined via
|
|
|
|
// #defines so they can be used in #ifndef guards in xpc_map_end.h.
|
|
|
|
|
|
|
|
#define XPC_SCRIPTABLE_WANT_PRECREATE (1 << 0)
|
2017-08-25 11:10:56 +03:00
|
|
|
// (1 << 1) is unused
|
|
|
|
// (1 << 2) is unused
|
2020-10-07 23:06:18 +03:00
|
|
|
// (1 << 3) is unused
|
2017-01-23 05:33:58 +03:00
|
|
|
#define XPC_SCRIPTABLE_WANT_NEWENUMERATE (1 << 4)
|
|
|
|
#define XPC_SCRIPTABLE_WANT_RESOLVE (1 << 5)
|
|
|
|
#define XPC_SCRIPTABLE_WANT_FINALIZE (1 << 6)
|
|
|
|
#define XPC_SCRIPTABLE_WANT_CALL (1 << 7)
|
|
|
|
#define XPC_SCRIPTABLE_WANT_CONSTRUCT (1 << 8)
|
|
|
|
#define XPC_SCRIPTABLE_WANT_HASINSTANCE (1 << 9)
|
|
|
|
#define XPC_SCRIPTABLE_USE_JSSTUB_FOR_ADDPROPERTY (1 << 10)
|
|
|
|
#define XPC_SCRIPTABLE_USE_JSSTUB_FOR_DELPROPERTY (1 << 11)
|
2017-08-16 10:01:56 +03:00
|
|
|
// (1 << 12) is unused
|
2017-01-23 05:33:58 +03:00
|
|
|
#define XPC_SCRIPTABLE_DONT_ENUM_QUERY_INTERFACE (1 << 13)
|
2018-03-22 12:37:43 +03:00
|
|
|
// (1 << 14) is unused
|
|
|
|
// (1 << 15) is unused
|
2017-01-23 05:33:58 +03:00
|
|
|
#define XPC_SCRIPTABLE_ALLOW_PROP_MODS_DURING_RESOLVE (1 << 16)
|
2018-03-22 12:37:43 +03:00
|
|
|
// (1 << 17) is unused
|
2017-01-23 05:33:58 +03:00
|
|
|
#define XPC_SCRIPTABLE_IS_GLOBAL_OBJECT (1 << 18)
|
|
|
|
#define XPC_SCRIPTABLE_DONT_REFLECT_INTERFACE_NAMES (1 << 19)
|
|
|
|
%}
|
|
|
|
|
2005-07-29 19:11:08 +04:00
|
|
|
/**
|
|
|
|
* Note: This is not really an XPCOM interface. For example, callers must
|
|
|
|
* guarantee that they set the *_retval of the various methods that return a
|
2012-10-25 20:32:24 +04:00
|
|
|
* boolean to PR_TRUE before making the call. Implementations may skip writing
|
|
|
|
* to *_retval unless they want to return PR_FALSE.
|
2005-07-29 19:11:08 +04:00
|
|
|
*/
|
2022-09-27 21:31:50 +03:00
|
|
|
[uuid(19b70b26-7c3f-437f-a04a-2a8f9e28b617)]
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
interface nsIXPCScriptable : nsISupports
|
|
|
|
{
|
2017-10-18 05:17:26 +03:00
|
|
|
readonly attribute AUTF8String className;
|
2012-08-22 19:56:38 +04:00
|
|
|
[notxpcom,nostdcall] uint32_t getScriptableFlags();
|
2017-01-10 04:47:57 +03:00
|
|
|
[notxpcom,nostdcall] JSClassPtr getJSClass();
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
|
|
|
void preCreate(in nsISupports nativeObj, in JSContextPtr cx,
|
|
|
|
in JSObjectPtr globalObj, out JSObjectPtr parentObj);
|
2012-07-13 12:55:14 +04:00
|
|
|
|
2011-08-07 09:03:32 +04:00
|
|
|
boolean newEnumerate(in nsIXPConnectWrappedNative wrapper,
|
2022-10-29 02:11:46 +03:00
|
|
|
in JSContextPtr cx, in JSObjectPtr obj,
|
|
|
|
in JSMutableHandleIdVector properties,
|
|
|
|
in boolean enumerableOnly);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2014-11-08 03:07:12 +03:00
|
|
|
boolean resolve(in nsIXPConnectWrappedNative wrapper,
|
|
|
|
in JSContextPtr cx, in JSObjectPtr obj, in jsid id,
|
|
|
|
out boolean resolvedp);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
|
|
|
void finalize(in nsIXPConnectWrappedNative wrapper,
|
2022-03-10 11:40:03 +03:00
|
|
|
in JSGCContextPtr gcx, in JSObjectPtr obj);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2011-08-07 09:03:32 +04:00
|
|
|
boolean call(in nsIXPConnectWrappedNative wrapper,
|
2022-10-29 02:11:46 +03:00
|
|
|
in JSContextPtr cx, in JSObjectPtr obj,
|
|
|
|
in JSCallArgsRef args);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2011-08-07 09:03:32 +04:00
|
|
|
boolean construct(in nsIXPConnectWrappedNative wrapper,
|
2022-10-29 02:11:46 +03:00
|
|
|
in JSContextPtr cx, in JSObjectPtr obj,
|
|
|
|
in JSCallArgsRef args);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2011-08-07 09:03:32 +04:00
|
|
|
boolean hasInstance(in nsIXPConnectWrappedNative wrapper,
|
2022-10-29 02:11:46 +03:00
|
|
|
in JSContextPtr cx, in JSObjectPtr obj,
|
|
|
|
in jsval val, out boolean bp);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2016-12-23 08:14:32 +03:00
|
|
|
%{ C++
|
2017-01-23 05:33:58 +03:00
|
|
|
#define GET_IT(f_, c_) \
|
|
|
|
bool f_() { \
|
|
|
|
return 0 != (GetScriptableFlags() & XPC_SCRIPTABLE_##c_); \
|
2016-12-23 08:14:32 +03:00
|
|
|
}
|
|
|
|
|
2017-01-23 05:33:58 +03:00
|
|
|
GET_IT(WantPreCreate, WANT_PRECREATE)
|
|
|
|
GET_IT(WantNewEnumerate, WANT_NEWENUMERATE)
|
|
|
|
GET_IT(WantResolve, WANT_RESOLVE)
|
|
|
|
GET_IT(WantFinalize, WANT_FINALIZE)
|
|
|
|
GET_IT(WantCall, WANT_CALL)
|
|
|
|
GET_IT(WantConstruct, WANT_CONSTRUCT)
|
|
|
|
GET_IT(WantHasInstance, WANT_HASINSTANCE)
|
|
|
|
GET_IT(UseJSStubForAddProperty, USE_JSSTUB_FOR_ADDPROPERTY)
|
|
|
|
GET_IT(UseJSStubForDelProperty, USE_JSSTUB_FOR_DELPROPERTY)
|
|
|
|
GET_IT(DontEnumQueryInterface, DONT_ENUM_QUERY_INTERFACE)
|
|
|
|
GET_IT(AllowPropModsDuringResolve, ALLOW_PROP_MODS_DURING_RESOLVE)
|
|
|
|
GET_IT(IsGlobalObject, IS_GLOBAL_OBJECT)
|
|
|
|
GET_IT(DontReflectInterfaceNames, DONT_REFLECT_INTERFACE_NAMES)
|
|
|
|
|
|
|
|
#undef GET_IT
|
2016-12-23 08:14:32 +03:00
|
|
|
%}
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
};
|