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

#ifndef mozilla_dom_MozMobileConnectionBinding_h
#define mozilla_dom_MozMobileConnectionBinding_h

#include "js/RootingAPI.h"
#include "jspubtd.h"
#include "mozilla/ErrorResult.h"
#include "mozilla/dom/BindingDeclarations.h"
#include "mozilla/dom/Nullable.h"
#include "mozilla/dom/UnionTypes.h"

namespace mozilla {
namespace dom {

class MobileConnection;
struct MobileConnectionAtoms;
struct MozCallBarringOptionsAtoms;
struct MozCallForwardingOptionsAtoms;
struct MozClirStatusAtoms;
struct MozMMIResultAtoms;
struct NativePropertyHooks;
class OwningUnsignedShortOrObject;
class ProtoAndIfaceCache;
class UnsignedShortOrObject;

} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {

MOZ_BEGIN_ENUM_CLASS(MobileNetworkSelectionMode, uint32_t)
  Automatic,
  Manual,
  EndGuard_
MOZ_END_ENUM_CLASS(MobileNetworkSelectionMode)

namespace MobileNetworkSelectionModeValues {
extern const EnumEntry strings[3];
} // namespace MobileNetworkSelectionModeValues


MOZ_BEGIN_ENUM_CLASS(MobileRadioState, uint32_t)
  Enabling,
  Enabled,
  Disabling,
  Disabled,
  EndGuard_
MOZ_END_ENUM_CLASS(MobileRadioState)

namespace MobileRadioStateValues {
extern const EnumEntry strings[5];
} // namespace MobileRadioStateValues


MOZ_BEGIN_ENUM_CLASS(MobileNetworkType, uint32_t)
  Gsm,
  Wcdma,
  Cdma,
  Evdo,
  Lte,
  EndGuard_
MOZ_END_ENUM_CLASS(MobileNetworkType)

namespace MobileNetworkTypeValues {
extern const EnumEntry strings[6];
} // namespace MobileNetworkTypeValues


MOZ_BEGIN_ENUM_CLASS(MobilePreferredNetworkType, uint32_t)
  Wcdma_gsm,
  Gsm,
  Wcdma,
  Wcdma_gsm_auto,
  Cdma_evdo,
  Cdma,
  Evdo,
  Wcdma_gsm_cdma_evdo,
  Lte_cdma_evdo,
  Lte_wcdma_gsm,
  Lte_wcdma_gsm_cdma_evdo,
  Lte,
  EndGuard_
MOZ_END_ENUM_CLASS(MobilePreferredNetworkType)

namespace MobilePreferredNetworkTypeValues {
extern const EnumEntry strings[13];
} // namespace MobilePreferredNetworkTypeValues


MOZ_BEGIN_ENUM_CLASS(MobileRoamingMode, uint32_t)
  Home,
  Affiliated,
  Any,
  EndGuard_
MOZ_END_ENUM_CLASS(MobileRoamingMode)

namespace MobileRoamingModeValues {
extern const EnumEntry strings[4];
} // namespace MobileRoamingModeValues


struct MozCallBarringOptions : public DictionaryBase
{
  Optional<Nullable<bool>> mEnabled;
  Optional<nsString> mNewPin;
  Optional<nsString> mPassword;
  Optional<nsString> mPin;
  Optional<Nullable<uint16_t>> mProgram;
  Optional<Nullable<uint16_t>> mServiceClass;

  MozCallBarringOptions();

  explicit inline MozCallBarringOptions(const MozCallBarringOptions& aOther)
  {
    *this = aOther;
  }

protected:
  explicit inline MozCallBarringOptions(int )
  {
    // Do nothing here; this is used by our "Fast" subclass
  }

private:
  static bool
  InitIds(JSContext* cx, MozCallBarringOptionsAtoms* atomsCache);

public:
  bool
  Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);

  bool
  Init(const nsAString& aJSON);

  bool
  ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;

  bool
  ToJSON(nsAString& aJSON) const;

  void
  TraceDictionary(JSTracer* trc);

  void
  operator=(const MozCallBarringOptions& aOther);
};

namespace binding_detail {
struct FastMozCallBarringOptions : public MozCallBarringOptions
{
  inline FastMozCallBarringOptions()
    : MozCallBarringOptions(42)
  {
    // Doesn't matter what int we pass to the parent constructor
  }
};
} // namespace binding_detail


struct MozCallForwardingOptions : public DictionaryBase
{
  Optional<Nullable<uint16_t>> mAction;
  Optional<Nullable<bool>> mActive;
  Optional<nsString> mNumber;
  Optional<Nullable<uint16_t>> mReason;
  Optional<Nullable<uint16_t>> mServiceClass;
  Optional<Nullable<uint16_t>> mTimeSeconds;

  MozCallForwardingOptions();

  explicit inline MozCallForwardingOptions(const MozCallForwardingOptions& aOther)
  {
    *this = aOther;
  }

protected:
  explicit inline MozCallForwardingOptions(int )
  {
    // Do nothing here; this is used by our "Fast" subclass
  }

private:
  static bool
  InitIds(JSContext* cx, MozCallForwardingOptionsAtoms* atomsCache);

public:
  bool
  Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);

  bool
  Init(const nsAString& aJSON);

  bool
  ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;

  bool
  ToJSON(nsAString& aJSON) const;

  void
  TraceDictionary(JSTracer* trc);

  void
  operator=(const MozCallForwardingOptions& aOther);
};

namespace binding_detail {
struct FastMozCallForwardingOptions : public MozCallForwardingOptions
{
  inline FastMozCallForwardingOptions()
    : MozCallForwardingOptions(42)
  {
    // Doesn't matter what int we pass to the parent constructor
  }
};
} // namespace binding_detail


struct MozClirStatus : public DictionaryBase
{
  Optional<uint16_t> mM;
  Optional<uint16_t> mN;

  MozClirStatus();

  explicit inline MozClirStatus(const MozClirStatus& aOther)
  {
    *this = aOther;
  }

protected:
  explicit inline MozClirStatus(int )
  {
    // Do nothing here; this is used by our "Fast" subclass
  }

private:
  static bool
  InitIds(JSContext* cx, MozClirStatusAtoms* atomsCache);

public:
  bool
  Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);

  bool
  Init(const nsAString& aJSON);

  bool
  ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;

  bool
  ToJSON(nsAString& aJSON) const;

  void
  TraceDictionary(JSTracer* trc);

  void
  operator=(const MozClirStatus& aOther);
};

namespace binding_detail {
struct FastMozClirStatus : public MozClirStatus
{
  inline FastMozClirStatus()
    : MozClirStatus(42)
  {
    // Doesn't matter what int we pass to the parent constructor
  }
};
} // namespace binding_detail


struct MozMMIResult : public DictionaryBase
{
  Optional<OwningUnsignedShortOrObject> mAdditionalInformation;
  nsString mServiceCode;
  nsString mStatusMessage;

  MozMMIResult();

protected:
  explicit inline MozMMIResult(int )
  {
    // Do nothing here; this is used by our "Fast" subclass
  }

private:
  MozMMIResult(const MozMMIResult&) MOZ_DELETE;
  void operator=(const MozMMIResult) MOZ_DELETE;

  static bool
  InitIds(JSContext* cx, MozMMIResultAtoms* atomsCache);

public:
  bool
  Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);

  bool
  Init(const nsAString& aJSON);

  bool
  ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;

  bool
  ToJSON(nsAString& aJSON) const;

  void
  TraceDictionary(JSTracer* trc);
};

namespace binding_detail {
struct FastMozMMIResult : public MozMMIResult
{
  inline FastMozMMIResult()
    : MozMMIResult(42)
  {
    // Doesn't matter what int we pass to the parent constructor
  }
};
} // namespace binding_detail


namespace MozMobileConnectionBinding {

  typedef mozilla::dom::MobileConnection NativeType;

  // We declare this as an array so that retrieving a pointer to this
  // binding's property hooks only requires compile/link-time resolvable
  // address arithmetic.  Declaring it as a pointer instead would require
  // doing a run-time load to fetch a pointer to this binding's property
  // hooks.  And then structures which embedded a pointer to this structure
  // would require a run-time load for proper initialization, which would
  // then induce static constructors.  Lots of static constructors.
  extern const NativePropertyHooks sNativePropertyHooks[];

  JSObject*
  DefineDOMInterface(JSContext* aCx, JS::Handle<JSObject*> aGlobal, JS::Handle<jsid> id, bool aDefineOnGlobal);

  bool
  ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj);

  const JSClass*
  GetJSClass();

  JSObject*
  Wrap(JSContext* aCx, mozilla::dom::MobileConnection* aObject, nsWrapperCache* aCache);

  template <class T>
  inline JSObject* Wrap(JSContext* aCx, T* aObject)
  {
    return Wrap(aCx, aObject, aObject);
  }

  void
  ClearCachedSupportedNetworkTypesValue(mozilla::dom::MobileConnection* aObject);

  void
  CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);

  JS::Handle<JSObject*>
  GetProtoObjectHandle(JSContext* aCx, JS::Handle<JSObject*> aGlobal);

  JS::Handle<JSObject*>
  GetConstructorObjectHandle(JSContext* aCx, JS::Handle<JSObject*> aGlobal, bool aDefineOnGlobal = true);

  JSObject*
  GetConstructorObject(JSContext* aCx, JS::Handle<JSObject*> aGlobal);

} // namespace MozMobileConnectionBinding



} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_MozMobileConnectionBinding_h
