/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM xpcIJSModuleLoader.idl
 */

#ifndef __gen_xpcIJSModuleLoader_h__
#define __gen_xpcIJSModuleLoader_h__


#ifndef __gen_nsISupports_h__
#include "nsISupports.h"
#endif

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
class nsIXPCNativeCallContext; /* forward declaration */

struct JSObject;

/* starting interface:    xpcIJSModuleLoader */
#define XPCIJSMODULELOADER_IID_STR "bb66b661-4cdf-40d5-b4f6-0be2e195ef7c"

#define XPCIJSMODULELOADER_IID \
  {0xbb66b661, 0x4cdf, 0x40d5, \
    { 0xb4, 0xf6, 0x0b, 0xe2, 0xe1, 0x95, 0xef, 0x7c }}

class NS_NO_VTABLE xpcIJSModuleLoader : public nsISupports {
 public: 

  NS_DEFINE_STATIC_IID_ACCESSOR(XPCIJSMODULELOADER_IID)

  /**
   * To be called from JS only.
   *
   * importModule(moduleURL, [optional] targetObj) synchronously loads
   * and evaluates the js file located at 'registryLocation' with a
   * new, fully privileged global object. It then looks for a property
   * 'EXPORTED_SYMBOLS' on the global object.  'EXPORTED_SYMBOLS' is
   * expected to be an array of strings identifying properties on the
   * global object. If present, these properties will be installed as
   * properties on 'targetObj' (if != null), or, if 'targetObj' is not
   * given, on the caller's global object.  Finally, the global object
   * will be returned.
   *
   * The implementation maintains a hash of registryLocation->global
   * obj. Subsequent invocations of importModule with the same
   * 'registryLocation' will not cause the file to be re-evaluated,
   * but the symbols in EXPORTED_SYMBOLS will be exported into the
   * specified target object and the global object returned as above.
   */
  /* void import (in AUTF8String registryLocation); */
  NS_IMETHOD Import(const nsACString & registryLocation) = 0;

  /**
   * Imports the JS module at 'registryLocation' to the JS object
   * 'targetObj' (if != null) as described for importModule() and
   * returns the module's global object.
   */
  /* [noscript] JSObjectPtr importInto (in AUTF8String registryLocation, in JSObjectPtr targetObj, in nsIXPCNativeCallContext cc); */
  NS_IMETHOD ImportInto(const nsACString & registryLocation, JSObject * targetObj, nsIXPCNativeCallContext *cc, JSObject * *_retval) = 0;

};

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_XPCIJSMODULELOADER \
  NS_IMETHOD Import(const nsACString & registryLocation); \
  NS_IMETHOD ImportInto(const nsACString & registryLocation, JSObject * targetObj, nsIXPCNativeCallContext *cc, JSObject * *_retval); 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_XPCIJSMODULELOADER(_to) \
  NS_IMETHOD Import(const nsACString & registryLocation) { return _to Import(registryLocation); } \
  NS_IMETHOD ImportInto(const nsACString & registryLocation, JSObject * targetObj, nsIXPCNativeCallContext *cc, JSObject * *_retval) { return _to ImportInto(registryLocation, targetObj, cc, _retval); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_XPCIJSMODULELOADER(_to) \
  NS_IMETHOD Import(const nsACString & registryLocation) { return !_to ? NS_ERROR_NULL_POINTER : _to->Import(registryLocation); } \
  NS_IMETHOD ImportInto(const nsACString & registryLocation, JSObject * targetObj, nsIXPCNativeCallContext *cc, JSObject * *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->ImportInto(registryLocation, targetObj, cc, _retval); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class _MYCLASS_ : public xpcIJSModuleLoader
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_XPCIJSMODULELOADER

  _MYCLASS_();

private:
  ~_MYCLASS_();

protected:
  /* additional members */
};

/* Implementation file */
NS_IMPL_ISUPPORTS1(_MYCLASS_, xpcIJSModuleLoader)

_MYCLASS_::_MYCLASS_()
{
  /* member initializers and constructor code */
}

_MYCLASS_::~_MYCLASS_()
{
  /* destructor code */
}

/* void import (in AUTF8String registryLocation); */
NS_IMETHODIMP _MYCLASS_::Import(const nsACString & registryLocation)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* [noscript] JSObjectPtr importInto (in AUTF8String registryLocation, in JSObjectPtr targetObj, in nsIXPCNativeCallContext cc); */
NS_IMETHODIMP _MYCLASS_::ImportInto(const nsACString & registryLocation, JSObject * targetObj, nsIXPCNativeCallContext *cc, JSObject * *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif


#endif /* __gen_xpcIJSModuleLoader_h__ */
