/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM e:/builds/moz2_slave/m-aurora-w32-xr/build/content/base/public/nsIEventSource.idl
 */

#ifndef __gen_nsIEventSource_h__
#define __gen_nsIEventSource_h__


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

#include "jspubtd.h"

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

class nsIPrincipal; /* forward declaration */

class nsIScriptContext; /* forward declaration */

class nsPIDOMWindow; /* forward declaration */


/* starting interface:    nsIEventSource */
#define NS_IEVENTSOURCE_IID_STR "778e5ae3-c72c-4d4b-9dc7-4a6477651957"

#define NS_IEVENTSOURCE_IID \
  {0x778e5ae3, 0xc72c, 0x4d4b, \
    { 0x9d, 0xc7, 0x4a, 0x64, 0x77, 0x65, 0x19, 0x57 }}

class NS_NO_VTABLE nsIEventSource : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IEVENTSOURCE_IID)

  /* readonly attribute DOMString url; */
  NS_IMETHOD GetUrl(nsAString & aUrl) = 0;

  enum {
    CONNECTING = 0U,
    OPEN = 1U,
    CLOSED = 2U
  };

  /* readonly attribute long readyState; */
  NS_IMETHOD GetReadyState(int32_t *aReadyState) = 0;

  /* readonly attribute boolean withCredentials; */
  NS_IMETHOD GetWithCredentials(bool *aWithCredentials) = 0;

  /* [implicit_jscontext] attribute jsval onopen; */
  NS_IMETHOD GetOnopen(JSContext* cx, JS::Value *aOnopen) = 0;
  NS_IMETHOD SetOnopen(JSContext* cx, const JS::Value & aOnopen) = 0;

  /* [implicit_jscontext] attribute jsval onmessage; */
  NS_IMETHOD GetOnmessage(JSContext* cx, JS::Value *aOnmessage) = 0;
  NS_IMETHOD SetOnmessage(JSContext* cx, const JS::Value & aOnmessage) = 0;

  /* [implicit_jscontext] attribute jsval onerror; */
  NS_IMETHOD GetOnerror(JSContext* cx, JS::Value *aOnerror) = 0;
  NS_IMETHOD SetOnerror(JSContext* cx, const JS::Value & aOnerror) = 0;

  /* void close (); */
  NS_IMETHOD Close(void) = 0;

  /* [noscript] void init (in nsIPrincipal principal, in nsIScriptContext scriptContext, in nsPIDOMWindow ownerWindow, in DOMString url, in boolean withCredentials); */
  NS_IMETHOD Init(nsIPrincipal *principal, nsIScriptContext *scriptContext, nsPIDOMWindow *ownerWindow, const nsAString & url, bool withCredentials) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIEventSource, NS_IEVENTSOURCE_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIEVENTSOURCE \
  NS_IMETHOD GetUrl(nsAString & aUrl); \
  NS_IMETHOD GetReadyState(int32_t *aReadyState); \
  NS_IMETHOD GetWithCredentials(bool *aWithCredentials); \
  NS_IMETHOD GetOnopen(JSContext* cx, JS::Value *aOnopen); \
  NS_IMETHOD SetOnopen(JSContext* cx, const JS::Value & aOnopen); \
  NS_IMETHOD GetOnmessage(JSContext* cx, JS::Value *aOnmessage); \
  NS_IMETHOD SetOnmessage(JSContext* cx, const JS::Value & aOnmessage); \
  NS_IMETHOD GetOnerror(JSContext* cx, JS::Value *aOnerror); \
  NS_IMETHOD SetOnerror(JSContext* cx, const JS::Value & aOnerror); \
  NS_IMETHOD Close(void); \
  NS_IMETHOD Init(nsIPrincipal *principal, nsIScriptContext *scriptContext, nsPIDOMWindow *ownerWindow, const nsAString & url, bool withCredentials); 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIEVENTSOURCE(_to) \
  NS_IMETHOD GetUrl(nsAString & aUrl) { return _to GetUrl(aUrl); } \
  NS_IMETHOD GetReadyState(int32_t *aReadyState) { return _to GetReadyState(aReadyState); } \
  NS_IMETHOD GetWithCredentials(bool *aWithCredentials) { return _to GetWithCredentials(aWithCredentials); } \
  NS_IMETHOD GetOnopen(JSContext* cx, JS::Value *aOnopen) { return _to GetOnopen(cx, aOnopen); } \
  NS_IMETHOD SetOnopen(JSContext* cx, const JS::Value & aOnopen) { return _to SetOnopen(cx, aOnopen); } \
  NS_IMETHOD GetOnmessage(JSContext* cx, JS::Value *aOnmessage) { return _to GetOnmessage(cx, aOnmessage); } \
  NS_IMETHOD SetOnmessage(JSContext* cx, const JS::Value & aOnmessage) { return _to SetOnmessage(cx, aOnmessage); } \
  NS_IMETHOD GetOnerror(JSContext* cx, JS::Value *aOnerror) { return _to GetOnerror(cx, aOnerror); } \
  NS_IMETHOD SetOnerror(JSContext* cx, const JS::Value & aOnerror) { return _to SetOnerror(cx, aOnerror); } \
  NS_IMETHOD Close(void) { return _to Close(); } \
  NS_IMETHOD Init(nsIPrincipal *principal, nsIScriptContext *scriptContext, nsPIDOMWindow *ownerWindow, const nsAString & url, bool withCredentials) { return _to Init(principal, scriptContext, ownerWindow, url, withCredentials); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIEVENTSOURCE(_to) \
  NS_IMETHOD GetUrl(nsAString & aUrl) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetUrl(aUrl); } \
  NS_IMETHOD GetReadyState(int32_t *aReadyState) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetReadyState(aReadyState); } \
  NS_IMETHOD GetWithCredentials(bool *aWithCredentials) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetWithCredentials(aWithCredentials); } \
  NS_IMETHOD GetOnopen(JSContext* cx, JS::Value *aOnopen) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetOnopen(cx, aOnopen); } \
  NS_IMETHOD SetOnopen(JSContext* cx, const JS::Value & aOnopen) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetOnopen(cx, aOnopen); } \
  NS_IMETHOD GetOnmessage(JSContext* cx, JS::Value *aOnmessage) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetOnmessage(cx, aOnmessage); } \
  NS_IMETHOD SetOnmessage(JSContext* cx, const JS::Value & aOnmessage) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetOnmessage(cx, aOnmessage); } \
  NS_IMETHOD GetOnerror(JSContext* cx, JS::Value *aOnerror) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetOnerror(cx, aOnerror); } \
  NS_IMETHOD SetOnerror(JSContext* cx, const JS::Value & aOnerror) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetOnerror(cx, aOnerror); } \
  NS_IMETHOD Close(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->Close(); } \
  NS_IMETHOD Init(nsIPrincipal *principal, nsIScriptContext *scriptContext, nsPIDOMWindow *ownerWindow, const nsAString & url, bool withCredentials) { return !_to ? NS_ERROR_NULL_POINTER : _to->Init(principal, scriptContext, ownerWindow, url, withCredentials); } 

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

/* Header file */
class nsEventSource : public nsIEventSource
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIEVENTSOURCE

  nsEventSource();

private:
  ~nsEventSource();

protected:
  /* additional members */
};

/* Implementation file */
NS_IMPL_ISUPPORTS1(nsEventSource, nsIEventSource)

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

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

/* readonly attribute DOMString url; */
NS_IMETHODIMP nsEventSource::GetUrl(nsAString & aUrl)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* readonly attribute long readyState; */
NS_IMETHODIMP nsEventSource::GetReadyState(int32_t *aReadyState)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* readonly attribute boolean withCredentials; */
NS_IMETHODIMP nsEventSource::GetWithCredentials(bool *aWithCredentials)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* [implicit_jscontext] attribute jsval onopen; */
NS_IMETHODIMP nsEventSource::GetOnopen(JSContext* cx, JS::Value *aOnopen)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsEventSource::SetOnopen(JSContext* cx, const JS::Value & aOnopen)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* [implicit_jscontext] attribute jsval onmessage; */
NS_IMETHODIMP nsEventSource::GetOnmessage(JSContext* cx, JS::Value *aOnmessage)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsEventSource::SetOnmessage(JSContext* cx, const JS::Value & aOnmessage)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* [implicit_jscontext] attribute jsval onerror; */
NS_IMETHODIMP nsEventSource::GetOnerror(JSContext* cx, JS::Value *aOnerror)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsEventSource::SetOnerror(JSContext* cx, const JS::Value & aOnerror)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void close (); */
NS_IMETHODIMP nsEventSource::Close()
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* [noscript] void init (in nsIPrincipal principal, in nsIScriptContext scriptContext, in nsPIDOMWindow ownerWindow, in DOMString url, in boolean withCredentials); */
NS_IMETHODIMP nsEventSource::Init(nsIPrincipal *principal, nsIScriptContext *scriptContext, nsPIDOMWindow *ownerWindow, const nsAString & url, bool withCredentials)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

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


#endif /* __gen_nsIEventSource_h__ */
