summaryrefslogtreecommitdiffstats
path: root/dom/presentation/interfaces/nsIPresentationDeviceProvider.idl
blob: b2c5e530cd0c30b86f09fb97005eddb04e65404e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/* 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"

interface nsIPresentationDevice;
interface nsIPresentationControlChannel;

%{C++
#define PRESENTATION_DEVICE_PROVIDER_CATEGORY "presentation-device-provider"
%}

/*
 * The callbacks for any device updates and session request.
 */
[scriptable, uuid(46fd372b-2e40-4179-9b36-0478d141e440)]
interface nsIPresentationDeviceListener: nsISupports
{
  void addDevice(in nsIPresentationDevice device);
  void removeDevice(in nsIPresentationDevice device);
  void updateDevice(in nsIPresentationDevice device);

  /*
   * Callback while the remote device is requesting to start a presentation session.
   * @param device The remote device that sent session request.
   * @param url The URL requested to open by remote device.
   * @param presentationId The Id for representing this session.
   * @param controlChannel The control channel for this session.
   */
  void onSessionRequest(in nsIPresentationDevice device,
                        in DOMString url,
                        in DOMString presentationId,
                        in nsIPresentationControlChannel controlChannel);

  /*
   * Callback while the remote device is requesting to terminate a presentation session.
   * @param device The remote device that sent session request.
   * @param presentationId The Id for representing this session.
   * @param controlChannel The control channel for this session.
   * @param aIsFromReceiver true if termination is initiated by receiver.
   */
  void onTerminateRequest(in nsIPresentationDevice device,
                          in DOMString presentationId,
                          in nsIPresentationControlChannel controlChannel,
                          in boolean aIsFromReceiver);

  /*
   * Callback while the remote device is requesting to reconnect a presentation session.
   * @param device The remote device that sent session request.
   * @param aUrl The URL requested to open by remote device.
   * @param presentationId The Id for representing this session.
   * @param controlChannel The control channel for this session.
   */
  void onReconnectRequest(in nsIPresentationDevice device,
                          in DOMString url,
                          in DOMString presentationId,
                          in nsIPresentationControlChannel controlChannel);
};

/*
 * Device provider for any device protocol, can be registered as default
 * providers by adding its contractID to category "presentation-device-provider".
 */
[scriptable, uuid(3db2578a-0f50-44ad-b01b-28427b71b7bf)]
interface nsIPresentationDeviceProvider: nsISupports
{
  // The listener for handling any device update.
  attribute nsIPresentationDeviceListener listener;

  /*
   * Force to update device information.
   */
  void forceDiscovery();
};