/* THIS FILE IS AUTOGENERATED - DO NOT EDIT */

#ifndef _gen_mozilla_idl_dictionary_helpers_h_
#define _gen_mozilla_idl_dictionary_helpers_h_

#include "jsapi.h"
#include "nsString.h"
#include "nsCOMPtr.h"

class nsIVariant;
class nsIDOMWindow;
class nsIDOMEventTarget;

namespace mozilla {
namespace dom {

class EventInit
{
public:
  EventInit() :
    bubbles(false),
    cancelable(false)
  {}

  // If aCx or aVal is null, NS_OK is returned and 
  // dictionary will use the default values. 
  nsresult Init(JSContext* aCx, const jsval* aVal);

  bool bubbles;
  bool cancelable;
};

class CustomEventInit : public EventInit
{
public:
  CustomEventInit() :
    EventInit(),
    detail(nsnull)
  {}

  // If aCx or aVal is null, NS_OK is returned and 
  // dictionary will use the default values. 
  nsresult Init(JSContext* aCx, const jsval* aVal);

  nsCOMPtr<nsIVariant> detail;
};

class PopStateEventInit : public EventInit
{
public:
  PopStateEventInit() :
    EventInit(),
    state(nsnull)
  {}

  // If aCx or aVal is null, NS_OK is returned and 
  // dictionary will use the default values. 
  nsresult Init(JSContext* aCx, const jsval* aVal);

  nsCOMPtr<nsIVariant> state;
};

class HashChangeEventInit : public EventInit
{
public:
  HashChangeEventInit() :
    EventInit(),
    oldURL(EmptyString()),
    newURL(EmptyString())
  {}

  // If aCx or aVal is null, NS_OK is returned and 
  // dictionary will use the default values. 
  nsresult Init(JSContext* aCx, const jsval* aVal);

  nsAutoString oldURL;
  nsAutoString newURL;
};

class PageTransitionEventInit : public EventInit
{
public:
  PageTransitionEventInit() :
    EventInit(),
    persisted(false)
  {}

  // If aCx or aVal is null, NS_OK is returned and 
  // dictionary will use the default values. 
  nsresult Init(JSContext* aCx, const jsval* aVal);

  bool persisted;
};

class CloseEventInit : public EventInit
{
public:
  CloseEventInit() :
    EventInit(),
    wasClean(false),
    code(0),
    reason(EmptyString())
  {}

  // If aCx or aVal is null, NS_OK is returned and 
  // dictionary will use the default values. 
  nsresult Init(JSContext* aCx, const jsval* aVal);

  bool wasClean;
  PRUint16 code;
  nsAutoString reason;
};

class UIEventInit : public EventInit
{
public:
  UIEventInit() :
    EventInit(),
    view(nsnull),
    detail(0)
  {}

  // If aCx or aVal is null, NS_OK is returned and 
  // dictionary will use the default values. 
  nsresult Init(JSContext* aCx, const jsval* aVal);

  nsCOMPtr<nsIDOMWindow> view;
  PRInt32 detail;
};

class MouseEventInit : public UIEventInit
{
public:
  MouseEventInit() :
    UIEventInit(),
    screenX(0),
    screenY(0),
    clientX(0),
    clientY(0),
    ctrlKey(false),
    shiftKey(false),
    altKey(false),
    metaKey(false),
    button(0),
    relatedTarget(nsnull)
  {}

  // If aCx or aVal is null, NS_OK is returned and 
  // dictionary will use the default values. 
  nsresult Init(JSContext* aCx, const jsval* aVal);

  PRInt32 screenX;
  PRInt32 screenY;
  PRInt32 clientX;
  PRInt32 clientY;
  bool ctrlKey;
  bool shiftKey;
  bool altKey;
  bool metaKey;
  PRUint16 button;
  nsCOMPtr<nsIDOMEventTarget> relatedTarget;
};

class IDBObjectStoreParameters
{
public:
  IDBObjectStoreParameters() :
    keyPath(JSVAL_VOID),
    autoIncrement(false)
  {}

  // If aCx or aVal is null, NS_OK is returned and 
  // dictionary will use the default values. 
  nsresult Init(JSContext* aCx, const jsval* aVal);

  JS::Value keyPath;
  bool autoIncrement;
};

class IDBIndexParameters
{
public:
  IDBIndexParameters() :
    unique(false),
    multiEntry(false)
  {}

  // If aCx or aVal is null, NS_OK is returned and 
  // dictionary will use the default values. 
  nsresult Init(JSContext* aCx, const jsval* aVal);

  bool unique;
  bool multiEntry;
};

}
}
#endif
