/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- * * The contents of this file are subject to the Netscape Public * License Version 1.1 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.mozilla.org/NPL/ * * Software distributed under the License is distributed on an "AS * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or * implied. See the License for the specific language governing * rights and limitations under the License. * * The Original Code is Mozilla Communicator client code, released * March 31, 1998. * * The Initial Developer of the Original Code is Netscape * Communications Corporation. Portions created by Netscape are * Copyright (C) 1998 Netscape Communications Corporation. All * Rights Reserved. * * Contributor(s): * John Bandhauer (original author) * * Alternatively, the contents of this file may be used under the * terms of the GNU Public License (the "GPL"), in which case the * provisions of the GPL are applicable instead of those above. * If you wish to allow use of your version of this file only * under the terms of the GPL and not to allow others to use your * version of this file under the NPL, indicate your decision by * deleting the provisions above and replace them with the notice * and other provisions required by the GPL. If you do not delete * the provisions above, a recipient may use your version of this * file under either the NPL or the GPL. */ #include "nsISupports.idl" #include "nsIXPConnect.idl" [uuid(fa2c3b80-0e9d-11d5-9092-0010a4e73d9a)] interface nsIXPCScriptable : nsISupports { /* bitflags used for 'flags' (only 32 bits available!) */ const PRUint32 WANT_PRECREATE = 1 << 0; const PRUint32 WANT_CREATE = 1 << 1; const PRUint32 WANT_POSTCREATE = 1 << 2; const PRUint32 WANT_ADDPROPERTY = 1 << 3; const PRUint32 WANT_DELPROPERTY = 1 << 4; const PRUint32 WANT_GETPROPERTY = 1 << 5; const PRUint32 WANT_SETPROPERTY = 1 << 6; const PRUint32 WANT_ENUMERATE = 1 << 7; const PRUint32 WANT_NEWENUMERATE = 1 << 8; const PRUint32 WANT_NEWRESOLVE = 1 << 9; const PRUint32 WANT_CONVERT = 1 << 10; const PRUint32 WANT_FINALIZE = 1 << 11; const PRUint32 WANT_CHECKACCESS = 1 << 12; const PRUint32 WANT_CALL = 1 << 13; const PRUint32 WANT_CONSTRUCT = 1 << 14; const PRUint32 WANT_HASINSTANCE = 1 << 15; const PRUint32 WANT_MARK = 1 << 16; const PRUint32 USE_JSSTUB_FOR_ADDPROPERTY = 1 << 17; const PRUint32 USE_JSSTUB_FOR_DELPROPERTY = 1 << 18; const PRUint32 USE_JSSTUB_FOR_SETPROPERTY = 1 << 19; const PRUint32 DONT_ENUM_STATIC_PROPS = 1 << 20; const PRUint32 DONT_ENUM_QUERY_INTERFACE = 1 << 21; const PRUint32 DONT_ASK_INSTANCE_FOR_SCRIPTABLE = 1 << 22; const PRUint32 CLASSINFO_INTERFACES_ONLY = 1 << 23; const PRUint32 ALLOW_PROP_MODS_DURING_RESOLVE = 1 << 24; const PRUint32 ALLOW_PROP_MODS_TO_PROTOTYPE = 1 << 25; const PRUint32 DONT_SHARE_PROTOTYPE = 1 << 26; const PRUint32 DONT_REFLECT_INTERFACE_NAMES = 1 << 27; // The high order bit is RESERVED for consumers of these flags. // No implementor of this interface should ever return flags // with this bit set. const PRUint32 RESERVED = 1 << 31; readonly attribute string className; readonly attribute PRUint32 scriptableFlags; void preCreate(in nsISupports nativeObj, in JSContextPtr cx, in JSObjectPtr globalObj, out JSObjectPtr parentObj); void create(in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj); void postCreate(in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj); PRBool addProperty(in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj, in JSVal id, in JSValPtr vp); PRBool delProperty(in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj, in JSVal id, in JSValPtr vp); PRBool getProperty(in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj, in JSVal id, in JSValPtr vp); PRBool setProperty(in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj, in JSVal id, in JSValPtr vp); PRBool enumerate(in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj); PRBool newEnumerate(in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj, in PRUint32 enum_op, in JSValPtr statep, out JSID idp); PRBool newResolve(in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj, in JSVal id, in PRUint32 flags, out JSObjectPtr objp); PRBool convert(in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj, in PRUint32 type, in JSValPtr vp); void finalize(in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj); PRBool checkAccess(in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj, in JSVal id, in PRUint32 mode, in JSValPtr vp); PRBool call(in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj, in PRUint32 argc, in JSValPtr argv, in JSValPtr vp); PRBool construct(in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj, in PRUint32 argc, in JSValPtr argv, in JSValPtr vp); PRBool hasInstance(in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj, in JSVal val, out PRBool bp); PRUint32 mark(in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj, in voidPtr arg); }; .