michael@0: /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* vim: set ts=2 et sw=2 tw=80: */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this file, michael@0: * You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef NETWERK_SCTP_DATACHANNEL_DATACHANNELLISTENER_H_ michael@0: #define NETWERK_SCTP_DATACHANNEL_DATACHANNELLISTENER_H_ michael@0: michael@0: #include "nsISupports.h" michael@0: #include "nsString.h" michael@0: michael@0: namespace mozilla { michael@0: michael@0: // Implemented by consumers of a Channel to receive messages. michael@0: // Can't nest it in DataChannelConnection because C++ doesn't allow forward michael@0: // refs to embedded classes michael@0: class DataChannelListener { michael@0: public: michael@0: virtual ~DataChannelListener() {} michael@0: michael@0: // Called when a DOMString message is received. michael@0: virtual nsresult OnMessageAvailable(nsISupports *aContext, michael@0: const nsACString& message) = 0; michael@0: michael@0: // Called when a binary message is received. michael@0: virtual nsresult OnBinaryMessageAvailable(nsISupports *aContext, michael@0: const nsACString& message) = 0; michael@0: michael@0: // Called when the channel is connected michael@0: virtual nsresult OnChannelConnected(nsISupports *aContext) = 0; michael@0: michael@0: // Called when the channel is closed michael@0: virtual nsresult OnChannelClosed(nsISupports *aContext) = 0; michael@0: }; michael@0: michael@0: } michael@0: michael@0: #endif