/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM $SRCDIR/netwerk/protocol/websocket/nsIWebSocketEventService.idl
 */

#ifndef __gen_nsIWebSocketEventService_h__
#define __gen_nsIWebSocketEventService_h__


#include "domstubs.h"

#include "nsISupports.h"

#include "js/GCAnnotations.h"

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


/* starting interface:    nsIWebSocketFrame */
#define NS_IWEBSOCKETFRAME_IID_STR "6714a6be-2265-4f73-a988-d78a12416037"

#define NS_IWEBSOCKETFRAME_IID \
  {0x6714a6be, 0x2265, 0x4f73, \
    { 0xa9, 0x88, 0xd7, 0x8a, 0x12, 0x41, 0x60, 0x37 }}

class NS_NO_VTABLE MOZ_BINDING(binding_to, idl, class, XPIDL_nsIWebSocketFrame) nsIWebSocketFrame : public nsISupports {
 public:

  NS_INLINE_DECL_STATIC_IID(NS_IWEBSOCKETFRAME_IID)

  /* Used by ToJSValue to check which scriptable interface is implemented. */
  using ScriptableInterfaceType = nsIWebSocketFrame;

  /* [must_use] readonly attribute DOMHighResTimeStamp timeStamp; */
  MOZ_BINDING(binding_to, idl, getter, XPIDL_nsIWebSocketFrame_timeStamp)
  [[nodiscard]] NS_IMETHOD GetTimeStamp(DOMHighResTimeStamp *aTimeStamp) = 0;

  /* [must_use] readonly attribute boolean finBit; */
  MOZ_BINDING(binding_to, idl, getter, XPIDL_nsIWebSocketFrame_finBit)
  [[nodiscard]] NS_IMETHOD GetFinBit(bool *aFinBit) = 0;

  /* [must_use] readonly attribute boolean rsvBit1; */
  MOZ_BINDING(binding_to, idl, getter, XPIDL_nsIWebSocketFrame_rsvBit1)
  [[nodiscard]] NS_IMETHOD GetRsvBit1(bool *aRsvBit1) = 0;

  /* [must_use] readonly attribute boolean rsvBit2; */
  MOZ_BINDING(binding_to, idl, getter, XPIDL_nsIWebSocketFrame_rsvBit2)
  [[nodiscard]] NS_IMETHOD GetRsvBit2(bool *aRsvBit2) = 0;

  /* [must_use] readonly attribute boolean rsvBit3; */
  MOZ_BINDING(binding_to, idl, getter, XPIDL_nsIWebSocketFrame_rsvBit3)
  [[nodiscard]] NS_IMETHOD GetRsvBit3(bool *aRsvBit3) = 0;

  /* [must_use] readonly attribute unsigned short opCode; */
  MOZ_BINDING(binding_to, idl, getter, XPIDL_nsIWebSocketFrame_opCode)
  [[nodiscard]] NS_IMETHOD GetOpCode(uint16_t *aOpCode) = 0;

  /* [must_use] readonly attribute boolean maskBit; */
  MOZ_BINDING(binding_to, idl, getter, XPIDL_nsIWebSocketFrame_maskBit)
  [[nodiscard]] NS_IMETHOD GetMaskBit(bool *aMaskBit) = 0;

  /* [must_use] readonly attribute unsigned long mask; */
  MOZ_BINDING(binding_to, idl, getter, XPIDL_nsIWebSocketFrame_mask)
  [[nodiscard]] NS_IMETHOD GetMask(uint32_t *aMask) = 0;

  /* [must_use] readonly attribute ACString payload; */
  MOZ_BINDING(binding_to, idl, getter, XPIDL_nsIWebSocketFrame_payload)
  [[nodiscard]] NS_IMETHOD GetPayload(nsACString& aPayload) = 0;

  enum {
    OPCODE_CONTINUATION MOZ_BINDING(binding_to, idl, const, XPIDL_nsIWebSocketFrame_OPCODE_CONTINUATION) = 0U,
    OPCODE_TEXT MOZ_BINDING(binding_to, idl, const, XPIDL_nsIWebSocketFrame_OPCODE_TEXT) = 1U,
    OPCODE_BINARY MOZ_BINDING(binding_to, idl, const, XPIDL_nsIWebSocketFrame_OPCODE_BINARY) = 2U,
    OPCODE_CLOSE MOZ_BINDING(binding_to, idl, const, XPIDL_nsIWebSocketFrame_OPCODE_CLOSE) = 8U,
    OPCODE_PING MOZ_BINDING(binding_to, idl, const, XPIDL_nsIWebSocketFrame_OPCODE_PING) = 9U,
    OPCODE_PONG MOZ_BINDING(binding_to, idl, const, XPIDL_nsIWebSocketFrame_OPCODE_PONG) = 10U
  };

};


/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIWEBSOCKETFRAME \
  [[nodiscard]] NS_IMETHOD GetTimeStamp(DOMHighResTimeStamp *aTimeStamp) override; \
  [[nodiscard]] NS_IMETHOD GetFinBit(bool *aFinBit) override; \
  [[nodiscard]] NS_IMETHOD GetRsvBit1(bool *aRsvBit1) override; \
  [[nodiscard]] NS_IMETHOD GetRsvBit2(bool *aRsvBit2) override; \
  [[nodiscard]] NS_IMETHOD GetRsvBit3(bool *aRsvBit3) override; \
  [[nodiscard]] NS_IMETHOD GetOpCode(uint16_t *aOpCode) override; \
  [[nodiscard]] NS_IMETHOD GetMaskBit(bool *aMaskBit) override; \
  [[nodiscard]] NS_IMETHOD GetMask(uint32_t *aMask) override; \
  [[nodiscard]] NS_IMETHOD GetPayload(nsACString& aPayload) override; \

/* Use this macro when declaring the members of this interface when the
   class doesn't implement the interface. This is useful for forwarding. */
#define NS_DECL_NON_VIRTUAL_NSIWEBSOCKETFRAME \
  MOZ_BINDING(binding_to, idl, getter, XPIDL_nsIWebSocketFrame_timeStamp)\
  [[nodiscard]] nsresult GetTimeStamp(DOMHighResTimeStamp *aTimeStamp); \
  MOZ_BINDING(binding_to, idl, getter, XPIDL_nsIWebSocketFrame_finBit)\
  [[nodiscard]] nsresult GetFinBit(bool *aFinBit); \
  MOZ_BINDING(binding_to, idl, getter, XPIDL_nsIWebSocketFrame_rsvBit1)\
  [[nodiscard]] nsresult GetRsvBit1(bool *aRsvBit1); \
  MOZ_BINDING(binding_to, idl, getter, XPIDL_nsIWebSocketFrame_rsvBit2)\
  [[nodiscard]] nsresult GetRsvBit2(bool *aRsvBit2); \
  MOZ_BINDING(binding_to, idl, getter, XPIDL_nsIWebSocketFrame_rsvBit3)\
  [[nodiscard]] nsresult GetRsvBit3(bool *aRsvBit3); \
  MOZ_BINDING(binding_to, idl, getter, XPIDL_nsIWebSocketFrame_opCode)\
  [[nodiscard]] nsresult GetOpCode(uint16_t *aOpCode); \
  MOZ_BINDING(binding_to, idl, getter, XPIDL_nsIWebSocketFrame_maskBit)\
  [[nodiscard]] nsresult GetMaskBit(bool *aMaskBit); \
  MOZ_BINDING(binding_to, idl, getter, XPIDL_nsIWebSocketFrame_mask)\
  [[nodiscard]] nsresult GetMask(uint32_t *aMask); \
  MOZ_BINDING(binding_to, idl, getter, XPIDL_nsIWebSocketFrame_payload)\
  [[nodiscard]] nsresult GetPayload(nsACString& aPayload); \

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIWEBSOCKETFRAME(_to) \
  [[nodiscard]] NS_IMETHOD GetTimeStamp(DOMHighResTimeStamp *aTimeStamp) override { return _to GetTimeStamp(aTimeStamp); } \
  [[nodiscard]] NS_IMETHOD GetFinBit(bool *aFinBit) override { return _to GetFinBit(aFinBit); } \
  [[nodiscard]] NS_IMETHOD GetRsvBit1(bool *aRsvBit1) override { return _to GetRsvBit1(aRsvBit1); } \
  [[nodiscard]] NS_IMETHOD GetRsvBit2(bool *aRsvBit2) override { return _to GetRsvBit2(aRsvBit2); } \
  [[nodiscard]] NS_IMETHOD GetRsvBit3(bool *aRsvBit3) override { return _to GetRsvBit3(aRsvBit3); } \
  [[nodiscard]] NS_IMETHOD GetOpCode(uint16_t *aOpCode) override { return _to GetOpCode(aOpCode); } \
  [[nodiscard]] NS_IMETHOD GetMaskBit(bool *aMaskBit) override { return _to GetMaskBit(aMaskBit); } \
  [[nodiscard]] NS_IMETHOD GetMask(uint32_t *aMask) override { return _to GetMask(aMask); } \
  [[nodiscard]] NS_IMETHOD GetPayload(nsACString& aPayload) override { return _to GetPayload(aPayload); } \

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIWEBSOCKETFRAME(_to) \
  [[nodiscard]] NS_IMETHOD GetTimeStamp(DOMHighResTimeStamp *aTimeStamp) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetTimeStamp(aTimeStamp); } \
  [[nodiscard]] NS_IMETHOD GetFinBit(bool *aFinBit) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetFinBit(aFinBit); } \
  [[nodiscard]] NS_IMETHOD GetRsvBit1(bool *aRsvBit1) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetRsvBit1(aRsvBit1); } \
  [[nodiscard]] NS_IMETHOD GetRsvBit2(bool *aRsvBit2) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetRsvBit2(aRsvBit2); } \
  [[nodiscard]] NS_IMETHOD GetRsvBit3(bool *aRsvBit3) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetRsvBit3(aRsvBit3); } \
  [[nodiscard]] NS_IMETHOD GetOpCode(uint16_t *aOpCode) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetOpCode(aOpCode); } \
  [[nodiscard]] NS_IMETHOD GetMaskBit(bool *aMaskBit) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetMaskBit(aMaskBit); } \
  [[nodiscard]] NS_IMETHOD GetMask(uint32_t *aMask) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetMask(aMask); } \
  [[nodiscard]] NS_IMETHOD GetPayload(nsACString& aPayload) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetPayload(aPayload); } \


/* starting interface:    nsIWebSocketEventListener */
#define NS_IWEBSOCKETEVENTLISTENER_IID_STR "e7c005ab-e694-489b-b741-96db43ffb16f"

#define NS_IWEBSOCKETEVENTLISTENER_IID \
  {0xe7c005ab, 0xe694, 0x489b, \
    { 0xb7, 0x41, 0x96, 0xdb, 0x43, 0xff, 0xb1, 0x6f }}

class NS_NO_VTABLE MOZ_BINDING(binding_to, idl, class, XPIDL_nsIWebSocketEventListener) nsIWebSocketEventListener : public nsISupports {
 public:

  NS_INLINE_DECL_STATIC_IID(NS_IWEBSOCKETEVENTLISTENER_IID)

  /* Used by ToJSValue to check which scriptable interface is implemented. */
  using ScriptableInterfaceType = nsIWebSocketEventListener;

  /* [must_use] void webSocketCreated (in unsigned long aWebSocketSerialID, in AString aURI, in ACString aProtocols); */
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIWebSocketEventListener_webSocketCreated)
  JS_HAZ_CAN_RUN_SCRIPT [[nodiscard]] NS_IMETHOD WebSocketCreated(uint32_t aWebSocketSerialID, const nsAString& aURI, const nsACString& aProtocols) = 0;

  /* [must_use] void webSocketOpened (in unsigned long aWebSocketSerialID, in AString aEffectiveURI, in ACString aProtocols, in ACString aExtensions, in uint64_t aHttpChannelId); */
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIWebSocketEventListener_webSocketOpened)
  JS_HAZ_CAN_RUN_SCRIPT [[nodiscard]] NS_IMETHOD WebSocketOpened(uint32_t aWebSocketSerialID, const nsAString& aEffectiveURI, const nsACString& aProtocols, const nsACString& aExtensions, uint64_t aHttpChannelId) = 0;

  enum {
    TYPE_STRING MOZ_BINDING(binding_to, idl, const, XPIDL_nsIWebSocketEventListener_TYPE_STRING) = 0U,
    TYPE_BLOB MOZ_BINDING(binding_to, idl, const, XPIDL_nsIWebSocketEventListener_TYPE_BLOB) = 1U,
    TYPE_ARRAYBUFFER MOZ_BINDING(binding_to, idl, const, XPIDL_nsIWebSocketEventListener_TYPE_ARRAYBUFFER) = 2U
  };

  /* [must_use] void webSocketMessageAvailable (in unsigned long aWebSocketSerialID, in ACString aMessage, in unsigned short aType); */
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIWebSocketEventListener_webSocketMessageAvailable)
  JS_HAZ_CAN_RUN_SCRIPT [[nodiscard]] NS_IMETHOD WebSocketMessageAvailable(uint32_t aWebSocketSerialID, const nsACString& aMessage, uint16_t aType) = 0;

  /* [must_use] void webSocketClosed (in unsigned long aWebSocketSerialID, in uint64_t aHttpChannelId, in boolean aWasClean, in unsigned short aCode, in AString aReason); */
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIWebSocketEventListener_webSocketClosed)
  JS_HAZ_CAN_RUN_SCRIPT [[nodiscard]] NS_IMETHOD WebSocketClosed(uint32_t aWebSocketSerialID, uint64_t aHttpChannelId, bool aWasClean, uint16_t aCode, const nsAString& aReason) = 0;

  /* [must_use] void frameReceived (in unsigned long aWebSocketSerialID, in uint64_t aHttpChannelId, in nsIWebSocketFrame aFrame); */
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIWebSocketEventListener_frameReceived)
  JS_HAZ_CAN_RUN_SCRIPT [[nodiscard]] NS_IMETHOD FrameReceived(uint32_t aWebSocketSerialID, uint64_t aHttpChannelId, nsIWebSocketFrame *aFrame) = 0;

  /* [must_use] void frameSent (in unsigned long aWebSocketSerialID, in uint64_t aHttpChannelId, in nsIWebSocketFrame aFrame); */
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIWebSocketEventListener_frameSent)
  JS_HAZ_CAN_RUN_SCRIPT [[nodiscard]] NS_IMETHOD FrameSent(uint32_t aWebSocketSerialID, uint64_t aHttpChannelId, nsIWebSocketFrame *aFrame) = 0;

};


/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIWEBSOCKETEVENTLISTENER \
  [[nodiscard]] NS_IMETHOD WebSocketCreated(uint32_t aWebSocketSerialID, const nsAString& aURI, const nsACString& aProtocols) override; \
  [[nodiscard]] NS_IMETHOD WebSocketOpened(uint32_t aWebSocketSerialID, const nsAString& aEffectiveURI, const nsACString& aProtocols, const nsACString& aExtensions, uint64_t aHttpChannelId) override; \
  [[nodiscard]] NS_IMETHOD WebSocketMessageAvailable(uint32_t aWebSocketSerialID, const nsACString& aMessage, uint16_t aType) override; \
  [[nodiscard]] NS_IMETHOD WebSocketClosed(uint32_t aWebSocketSerialID, uint64_t aHttpChannelId, bool aWasClean, uint16_t aCode, const nsAString& aReason) override; \
  [[nodiscard]] NS_IMETHOD FrameReceived(uint32_t aWebSocketSerialID, uint64_t aHttpChannelId, nsIWebSocketFrame *aFrame) override; \
  [[nodiscard]] NS_IMETHOD FrameSent(uint32_t aWebSocketSerialID, uint64_t aHttpChannelId, nsIWebSocketFrame *aFrame) override; 

/* Use this macro when declaring the members of this interface when the
   class doesn't implement the interface. This is useful for forwarding. */
#define NS_DECL_NON_VIRTUAL_NSIWEBSOCKETEVENTLISTENER \
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIWebSocketEventListener_webSocketCreated)\
  [[nodiscard]] nsresult WebSocketCreated(uint32_t aWebSocketSerialID, const nsAString& aURI, const nsACString& aProtocols); \
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIWebSocketEventListener_webSocketOpened)\
  [[nodiscard]] nsresult WebSocketOpened(uint32_t aWebSocketSerialID, const nsAString& aEffectiveURI, const nsACString& aProtocols, const nsACString& aExtensions, uint64_t aHttpChannelId); \
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIWebSocketEventListener_webSocketMessageAvailable)\
  [[nodiscard]] nsresult WebSocketMessageAvailable(uint32_t aWebSocketSerialID, const nsACString& aMessage, uint16_t aType); \
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIWebSocketEventListener_webSocketClosed)\
  [[nodiscard]] nsresult WebSocketClosed(uint32_t aWebSocketSerialID, uint64_t aHttpChannelId, bool aWasClean, uint16_t aCode, const nsAString& aReason); \
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIWebSocketEventListener_frameReceived)\
  [[nodiscard]] nsresult FrameReceived(uint32_t aWebSocketSerialID, uint64_t aHttpChannelId, nsIWebSocketFrame *aFrame); \
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIWebSocketEventListener_frameSent)\
  [[nodiscard]] nsresult FrameSent(uint32_t aWebSocketSerialID, uint64_t aHttpChannelId, nsIWebSocketFrame *aFrame); 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIWEBSOCKETEVENTLISTENER(_to) \
  [[nodiscard]] NS_IMETHOD WebSocketCreated(uint32_t aWebSocketSerialID, const nsAString& aURI, const nsACString& aProtocols) override { return _to WebSocketCreated(aWebSocketSerialID, aURI, aProtocols); } \
  [[nodiscard]] NS_IMETHOD WebSocketOpened(uint32_t aWebSocketSerialID, const nsAString& aEffectiveURI, const nsACString& aProtocols, const nsACString& aExtensions, uint64_t aHttpChannelId) override { return _to WebSocketOpened(aWebSocketSerialID, aEffectiveURI, aProtocols, aExtensions, aHttpChannelId); } \
  [[nodiscard]] NS_IMETHOD WebSocketMessageAvailable(uint32_t aWebSocketSerialID, const nsACString& aMessage, uint16_t aType) override { return _to WebSocketMessageAvailable(aWebSocketSerialID, aMessage, aType); } \
  [[nodiscard]] NS_IMETHOD WebSocketClosed(uint32_t aWebSocketSerialID, uint64_t aHttpChannelId, bool aWasClean, uint16_t aCode, const nsAString& aReason) override { return _to WebSocketClosed(aWebSocketSerialID, aHttpChannelId, aWasClean, aCode, aReason); } \
  [[nodiscard]] NS_IMETHOD FrameReceived(uint32_t aWebSocketSerialID, uint64_t aHttpChannelId, nsIWebSocketFrame *aFrame) override { return _to FrameReceived(aWebSocketSerialID, aHttpChannelId, aFrame); } \
  [[nodiscard]] NS_IMETHOD FrameSent(uint32_t aWebSocketSerialID, uint64_t aHttpChannelId, nsIWebSocketFrame *aFrame) override { return _to FrameSent(aWebSocketSerialID, aHttpChannelId, aFrame); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIWEBSOCKETEVENTLISTENER(_to) \
  [[nodiscard]] NS_IMETHOD WebSocketCreated(uint32_t aWebSocketSerialID, const nsAString& aURI, const nsACString& aProtocols) override { return !_to ? NS_ERROR_NULL_POINTER : _to->WebSocketCreated(aWebSocketSerialID, aURI, aProtocols); } \
  [[nodiscard]] NS_IMETHOD WebSocketOpened(uint32_t aWebSocketSerialID, const nsAString& aEffectiveURI, const nsACString& aProtocols, const nsACString& aExtensions, uint64_t aHttpChannelId) override { return !_to ? NS_ERROR_NULL_POINTER : _to->WebSocketOpened(aWebSocketSerialID, aEffectiveURI, aProtocols, aExtensions, aHttpChannelId); } \
  [[nodiscard]] NS_IMETHOD WebSocketMessageAvailable(uint32_t aWebSocketSerialID, const nsACString& aMessage, uint16_t aType) override { return !_to ? NS_ERROR_NULL_POINTER : _to->WebSocketMessageAvailable(aWebSocketSerialID, aMessage, aType); } \
  [[nodiscard]] NS_IMETHOD WebSocketClosed(uint32_t aWebSocketSerialID, uint64_t aHttpChannelId, bool aWasClean, uint16_t aCode, const nsAString& aReason) override { return !_to ? NS_ERROR_NULL_POINTER : _to->WebSocketClosed(aWebSocketSerialID, aHttpChannelId, aWasClean, aCode, aReason); } \
  [[nodiscard]] NS_IMETHOD FrameReceived(uint32_t aWebSocketSerialID, uint64_t aHttpChannelId, nsIWebSocketFrame *aFrame) override { return !_to ? NS_ERROR_NULL_POINTER : _to->FrameReceived(aWebSocketSerialID, aHttpChannelId, aFrame); } \
  [[nodiscard]] NS_IMETHOD FrameSent(uint32_t aWebSocketSerialID, uint64_t aHttpChannelId, nsIWebSocketFrame *aFrame) override { return !_to ? NS_ERROR_NULL_POINTER : _to->FrameSent(aWebSocketSerialID, aHttpChannelId, aFrame); } 


/* starting interface:    nsIWebSocketEventService */
#define NS_IWEBSOCKETEVENTSERVICE_IID_STR "b89d1b90-2cf3-4d8f-ac21-5aedfb25c760"

#define NS_IWEBSOCKETEVENTSERVICE_IID \
  {0xb89d1b90, 0x2cf3, 0x4d8f, \
    { 0xac, 0x21, 0x5a, 0xed, 0xfb, 0x25, 0xc7, 0x60 }}

class NS_NO_VTABLE MOZ_BINDING(binding_to, idl, class, XPIDL_nsIWebSocketEventService) nsIWebSocketEventService : public nsISupports {
 public:

  NS_INLINE_DECL_STATIC_IID(NS_IWEBSOCKETEVENTSERVICE_IID)

  /* Used by ToJSValue to check which scriptable interface is implemented. */
  using ScriptableInterfaceType = nsIWebSocketEventService;

  /* [must_use] void sendMessage (in unsigned long aWebSocketSerialID, in AString aMessage); */
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIWebSocketEventService_sendMessage)
  [[nodiscard]] NS_IMETHOD SendMessage(uint32_t aWebSocketSerialID, const nsAString& aMessage) = 0;

  /* [must_use] void addListener (in unsigned long long aInnerWindowID, in nsIWebSocketEventListener aListener); */
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIWebSocketEventService_addListener)
  [[nodiscard]] NS_IMETHOD AddListener(uint64_t aInnerWindowID, nsIWebSocketEventListener *aListener) = 0;

  /* [must_use] void removeListener (in unsigned long long aInnerWindowID, in nsIWebSocketEventListener aListener); */
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIWebSocketEventService_removeListener)
  [[nodiscard]] NS_IMETHOD RemoveListener(uint64_t aInnerWindowID, nsIWebSocketEventListener *aListener) = 0;

  /* [must_use] boolean hasListenerFor (in unsigned long long aInnerWindowID); */
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIWebSocketEventService_hasListenerFor)
  [[nodiscard]] NS_IMETHOD HasListenerFor(uint64_t aInnerWindowID, bool *_retval) = 0;

};


/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIWEBSOCKETEVENTSERVICE \
  [[nodiscard]] NS_IMETHOD SendMessage(uint32_t aWebSocketSerialID, const nsAString& aMessage) override; \
  [[nodiscard]] NS_IMETHOD AddListener(uint64_t aInnerWindowID, nsIWebSocketEventListener *aListener) override; \
  [[nodiscard]] NS_IMETHOD RemoveListener(uint64_t aInnerWindowID, nsIWebSocketEventListener *aListener) override; \
  [[nodiscard]] NS_IMETHOD HasListenerFor(uint64_t aInnerWindowID, bool *_retval) override; 

/* Use this macro when declaring the members of this interface when the
   class doesn't implement the interface. This is useful for forwarding. */
#define NS_DECL_NON_VIRTUAL_NSIWEBSOCKETEVENTSERVICE \
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIWebSocketEventService_sendMessage)\
  [[nodiscard]] nsresult SendMessage(uint32_t aWebSocketSerialID, const nsAString& aMessage); \
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIWebSocketEventService_addListener)\
  [[nodiscard]] nsresult AddListener(uint64_t aInnerWindowID, nsIWebSocketEventListener *aListener); \
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIWebSocketEventService_removeListener)\
  [[nodiscard]] nsresult RemoveListener(uint64_t aInnerWindowID, nsIWebSocketEventListener *aListener); \
  MOZ_BINDING(binding_to, idl, method, XPIDL_nsIWebSocketEventService_hasListenerFor)\
  [[nodiscard]] nsresult HasListenerFor(uint64_t aInnerWindowID, bool *_retval); 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIWEBSOCKETEVENTSERVICE(_to) \
  [[nodiscard]] NS_IMETHOD SendMessage(uint32_t aWebSocketSerialID, const nsAString& aMessage) override { return _to SendMessage(aWebSocketSerialID, aMessage); } \
  [[nodiscard]] NS_IMETHOD AddListener(uint64_t aInnerWindowID, nsIWebSocketEventListener *aListener) override { return _to AddListener(aInnerWindowID, aListener); } \
  [[nodiscard]] NS_IMETHOD RemoveListener(uint64_t aInnerWindowID, nsIWebSocketEventListener *aListener) override { return _to RemoveListener(aInnerWindowID, aListener); } \
  [[nodiscard]] NS_IMETHOD HasListenerFor(uint64_t aInnerWindowID, bool *_retval) override { return _to HasListenerFor(aInnerWindowID, _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_NSIWEBSOCKETEVENTSERVICE(_to) \
  [[nodiscard]] NS_IMETHOD SendMessage(uint32_t aWebSocketSerialID, const nsAString& aMessage) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SendMessage(aWebSocketSerialID, aMessage); } \
  [[nodiscard]] NS_IMETHOD AddListener(uint64_t aInnerWindowID, nsIWebSocketEventListener *aListener) override { return !_to ? NS_ERROR_NULL_POINTER : _to->AddListener(aInnerWindowID, aListener); } \
  [[nodiscard]] NS_IMETHOD RemoveListener(uint64_t aInnerWindowID, nsIWebSocketEventListener *aListener) override { return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveListener(aInnerWindowID, aListener); } \
  [[nodiscard]] NS_IMETHOD HasListenerFor(uint64_t aInnerWindowID, bool *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->HasListenerFor(aInnerWindowID, _retval); } 


#endif /* __gen_nsIWebSocketEventService_h__ */
