Backed out changeset 9157ea42ff41 (bug 914925) for Android/B2G test bustage.
[gecko.git] / dom / base / nsIDOMScriptObjectFactory.h
blob4dcd3d210dbe63bf465a8f0332a34b788c24b6b0
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef nsIDOMScriptObjectFactory_h__
7 #define nsIDOMScriptObjectFactory_h__
9 #include "nsISupports.h"
10 #include "nsIDOMClassInfo.h"
11 #include "nsStringGlue.h"
13 #define NS_IDOM_SCRIPT_OBJECT_FACTORY_IID \
14 { 0x2a50e17c, 0x46ff, 0x4150, \
15 { 0xbb, 0x46, 0xd8, 0x07, 0xb3, 0x36, 0xde, 0xab } }
17 class nsIScriptContext;
18 class nsIScriptGlobalObject;
19 class nsIDOMEventListener;
21 typedef nsXPCClassInfo* (*nsDOMClassInfoExternalConstructorFnc)
22 (const char* aName);
24 class nsIDOMScriptObjectFactory : public nsISupports {
25 public:
26 NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOM_SCRIPT_OBJECT_FACTORY_IID)
28 NS_IMETHOD_(nsISupports *) GetClassInfoInstance(nsDOMClassInfoID aID) = 0;
29 NS_IMETHOD_(nsISupports *) GetExternalClassInfoInstance(const nsAString& aName) = 0;
31 // Register the info for an external class. aName must be static
32 // data, it will not be deleted by the DOM code. aProtoChainInterface
33 // must be registered in the JAVASCRIPT_DOM_INTERFACE category, or
34 // prototypes for this class won't work (except if the interface
35 // name starts with nsIDOM).
36 NS_IMETHOD RegisterDOMClassInfo(const char *aName,
37 nsDOMClassInfoExternalConstructorFnc aConstructorFptr,
38 const nsIID *aProtoChainInterface,
39 const nsIID **aInterfaces,
40 uint32_t aScriptableFlags,
41 bool aHasClassInterface,
42 const nsCID *aConstructorCID) = 0;
45 NS_DEFINE_STATIC_IID_ACCESSOR(nsIDOMScriptObjectFactory,
46 NS_IDOM_SCRIPT_OBJECT_FACTORY_IID)
48 #endif /* nsIDOMScriptObjectFactory_h__ */