michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef nsIDOMScriptObjectFactory_h__ michael@0: #define nsIDOMScriptObjectFactory_h__ michael@0: michael@0: #include "nsISupports.h" michael@0: #include "nsIDOMClassInfo.h" michael@0: #include "nsString.h" michael@0: michael@0: #define NS_IDOM_SCRIPT_OBJECT_FACTORY_IID \ michael@0: { 0x2a50e17c, 0x46ff, 0x4150, \ michael@0: { 0xbb, 0x46, 0xd8, 0x07, 0xb3, 0x36, 0xde, 0xab } } michael@0: michael@0: class nsIScriptContext; michael@0: class nsIScriptGlobalObject; michael@0: class nsIDOMEventListener; michael@0: michael@0: typedef nsXPCClassInfo* (*nsDOMClassInfoExternalConstructorFnc) michael@0: (const char* aName); michael@0: michael@0: class nsIDOMScriptObjectFactory : public nsISupports { michael@0: public: michael@0: NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOM_SCRIPT_OBJECT_FACTORY_IID) michael@0: michael@0: NS_IMETHOD_(nsISupports *) GetClassInfoInstance(nsDOMClassInfoID aID) = 0; michael@0: NS_IMETHOD_(nsISupports *) GetExternalClassInfoInstance(const nsAString& aName) = 0; michael@0: michael@0: // Register the info for an external class. aName must be static michael@0: // data, it will not be deleted by the DOM code. aProtoChainInterface michael@0: // must be registered in the JAVASCRIPT_DOM_INTERFACE category, or michael@0: // prototypes for this class won't work (except if the interface michael@0: // name starts with nsIDOM). michael@0: NS_IMETHOD RegisterDOMClassInfo(const char *aName, michael@0: nsDOMClassInfoExternalConstructorFnc aConstructorFptr, michael@0: const nsIID *aProtoChainInterface, michael@0: const nsIID **aInterfaces, michael@0: uint32_t aScriptableFlags, michael@0: bool aHasClassInterface, michael@0: const nsCID *aConstructorCID) = 0; michael@0: }; michael@0: michael@0: NS_DEFINE_STATIC_IID_ACCESSOR(nsIDOMScriptObjectFactory, michael@0: NS_IDOM_SCRIPT_OBJECT_FACTORY_IID) michael@0: michael@0: #endif /* nsIDOMScriptObjectFactory_h__ */