1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/base/nsIDOMScriptObjectFactory.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,48 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#ifndef nsIDOMScriptObjectFactory_h__ 1.10 +#define nsIDOMScriptObjectFactory_h__ 1.11 + 1.12 +#include "nsISupports.h" 1.13 +#include "nsIDOMClassInfo.h" 1.14 +#include "nsString.h" 1.15 + 1.16 +#define NS_IDOM_SCRIPT_OBJECT_FACTORY_IID \ 1.17 +{ 0x2a50e17c, 0x46ff, 0x4150, \ 1.18 + { 0xbb, 0x46, 0xd8, 0x07, 0xb3, 0x36, 0xde, 0xab } } 1.19 + 1.20 +class nsIScriptContext; 1.21 +class nsIScriptGlobalObject; 1.22 +class nsIDOMEventListener; 1.23 + 1.24 +typedef nsXPCClassInfo* (*nsDOMClassInfoExternalConstructorFnc) 1.25 + (const char* aName); 1.26 + 1.27 +class nsIDOMScriptObjectFactory : public nsISupports { 1.28 +public: 1.29 + NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOM_SCRIPT_OBJECT_FACTORY_IID) 1.30 + 1.31 + NS_IMETHOD_(nsISupports *) GetClassInfoInstance(nsDOMClassInfoID aID) = 0; 1.32 + NS_IMETHOD_(nsISupports *) GetExternalClassInfoInstance(const nsAString& aName) = 0; 1.33 + 1.34 + // Register the info for an external class. aName must be static 1.35 + // data, it will not be deleted by the DOM code. aProtoChainInterface 1.36 + // must be registered in the JAVASCRIPT_DOM_INTERFACE category, or 1.37 + // prototypes for this class won't work (except if the interface 1.38 + // name starts with nsIDOM). 1.39 + NS_IMETHOD RegisterDOMClassInfo(const char *aName, 1.40 + nsDOMClassInfoExternalConstructorFnc aConstructorFptr, 1.41 + const nsIID *aProtoChainInterface, 1.42 + const nsIID **aInterfaces, 1.43 + uint32_t aScriptableFlags, 1.44 + bool aHasClassInterface, 1.45 + const nsCID *aConstructorCID) = 0; 1.46 +}; 1.47 + 1.48 +NS_DEFINE_STATIC_IID_ACCESSOR(nsIDOMScriptObjectFactory, 1.49 + NS_IDOM_SCRIPT_OBJECT_FACTORY_IID) 1.50 + 1.51 +#endif /* nsIDOMScriptObjectFactory_h__ */