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

#ifndef __gen_flockISingleton_h__
#define __gen_flockISingleton_h__


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

#ifndef __gen_nsIRDFDataSource_h__
#include "nsIRDFDataSource.h"
#endif

#ifndef __gen_nsIRDFNode_h__
#include "nsIRDFNode.h"
#endif

#ifndef __gen_nsIRDFResource_h__
#include "nsIRDFResource.h"
#endif

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif

/* starting interface:    flockISingleton */
#define FLOCKISINGLETON_IID_STR "965622a9-db19-432a-91a3-f1cdbe597673"

#define FLOCKISINGLETON_IID \
  {0x965622a9, 0xdb19, 0x432a, \
    { 0x91, 0xa3, 0xf1, 0xcd, 0xbe, 0x59, 0x76, 0x73 }}

/**
 * A mechanism to support the "singleton" metaphor for loading of JavaScript
 * chrome contexts.  If you've got a JS chrome file that should only be loaded
 * once but accessed from multiple locations (including inside XPCOM services),
 * then use this instead of calling eg. loadSubScript.
 *
 * To invoke:
 * Components.classes["@flock.com/singleton;1"]
 *   .getService(Components.interfaces.flockISingleton)
 *   .getSingleton(aURI).wrappedJSObject;
 *
 * @see mozIJSSubScriptLoader#loadSubScript
 */
class NS_NO_VTABLE NS_SCRIPTABLE flockISingleton : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(FLOCKISINGLETON_IID)

  /**
   * @param aURI (in) URI (eg. chrome://...) of a JS script that should only be
   *        loaded once.
   * @return nsISupports object on which the caller can refer to
   *         .wrappedJSObject to access the JS context of the script.
   */
  /* nsISupports getSingleton (in AString aURI); */
  NS_SCRIPTABLE NS_IMETHOD GetSingleton(const nsAString & aURI, nsISupports **_retval) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(flockISingleton, FLOCKISINGLETON_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_FLOCKISINGLETON \
  NS_SCRIPTABLE NS_IMETHOD GetSingleton(const nsAString & aURI, nsISupports **_retval); 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_FLOCKISINGLETON(_to) \
  NS_SCRIPTABLE NS_IMETHOD GetSingleton(const nsAString & aURI, nsISupports **_retval) { return _to GetSingleton(aURI, _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_FLOCKISINGLETON(_to) \
  NS_SCRIPTABLE NS_IMETHOD GetSingleton(const nsAString & aURI, nsISupports **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetSingleton(aURI, _retval); } 

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

/* Header file */
class _MYCLASS_ : public flockISingleton
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_FLOCKISINGLETON

  _MYCLASS_();

private:
  ~_MYCLASS_();

protected:
  /* additional members */
};

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

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

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

/* nsISupports getSingleton (in AString aURI); */
NS_IMETHODIMP _MYCLASS_::GetSingleton(const nsAString & aURI, nsISupports **_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

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


#endif /* __gen_flockISingleton_h__ */
