dom/presentation/interfaces/nsIPresentationListener.idl
author Junior Hsu <juhsu@mozilla.com>
Mon, 11 Apr 2016 11:20:55 +0800
changeset 292785 e0a1ad6c114e2540b536f414d7d277a7aa683d1a
parent 292600 51d3abb0441daebe5afd70422b465390eb94247a
child 299565 54ca84566554be8fd282e3ffc633e66bc0c39f94
permissions -rw-r--r--
Bug 1148307 - Part 4, use data channel in substitution for TCP session transport (in-process), r=smaug

/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

#include "nsISupports.idl"

[scriptable, uuid(0105f837-4279-4715-9d5b-2dc3f8b65353)]
interface nsIPresentationAvailabilityListener : nsISupports
{
  /*
   * Called when device availability changes.
   */
  void notifyAvailableChange(in bool available);
};

[scriptable, uuid(7dd48df8-8f8c-48c7-ac37-7b9fd1acf2f8)]
interface nsIPresentationSessionListener : nsISupports
{
  const unsigned short STATE_CONNECTED = 0;
  const unsigned short STATE_CLOSED = 1;
  const unsigned short STATE_TERMINATED = 2;

  /*
   * Called when session state changes.
   */
  void notifyStateChange(in DOMString sessionId,
                         in unsigned short state);

  /*
   * Called when receive messages.
   */
  void notifyMessage(in DOMString sessionId,
                     in ACString data);
};

[scriptable, uuid(27f101d7-9ed1-429e-b4f8-43b00e8e111c)]
interface nsIPresentationRespondingListener : nsISupports
{
  /*
   * Called when an incoming session connects.
   */
  void notifySessionConnect(in unsigned long long windowId,
                            in DOMString sessionId);
};