dom/messages/interfaces/nsISystemMessagesInternal.idl
author Carsten "Tomcat" Book <cbook@mozilla.com>
Thu, 27 Mar 2014 11:40:32 +0100
changeset 175624 11b3e19f4eb825df8922045ad0860023e8e9946c
parent 140329 6f6a4ea042c096d36fe308ba5f84c72ddcde4e35
child 197963 90c9b3d8f5bfa3a2d33eb8ea6b13bd3d32401249
permissions -rw-r--r--
Backed out changeset 71568f10952a (bug 988326) for assertions

/* 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 "domstubs.idl"

interface nsIURI;
interface nsIDOMWindow;

// Implemented by the contract id @mozilla.org/system-message-internal;1

[scriptable, uuid(6296a314-2abf-4cd0-9097-5e81ee6832e2)]
interface nsISystemMessagesInternal : nsISupports
{
  /*
   * Allow any internal user to broadcast a message of a given type.
   * @param type        The type of the message to be sent.
   * @param message     The message payload.
   * @param pageURI     The URI of the page that will be opened.
   * @param manifestURI The webapp's manifest URI.
   * @param extra       Extra opaque information that will be passed around in the observer
   *                    notification to open the page.
   */
  void sendMessage(in DOMString type, in jsval message, in nsIURI pageURI, in nsIURI manifestURI, [optional] in jsval extra);

  /*
   * Allow any internal user to broadcast a message of a given type.
   * The application that registers the message will be launched.
   * @param type        The type of the message to be sent.
   * @param message     The message payload.
   * @param extra       Extra opaque information that will be passed around in the observer
   *                    notification to open the page.
   */
  void broadcastMessage(in DOMString type, in jsval message, [optional] in jsval extra);

  /*
   * Registration of a page that wants to be notified of a message type.
   * @param type          The message type.
   * @param pageURI       The URI of the page that will be opened.
   * @param manifestURI   The webapp's manifest URI.
   */
  void registerPage(in DOMString type, in nsIURI pageURI, in nsIURI manifestURI);
};

[scriptable, uuid(002f0e82-91f0-41de-ad43-569a2b9d12df)]
interface nsISystemMessagesWrapper: nsISupports
{
  /*
   * Wrap a message and gives back any kind of object.
   * @param message  The json blob to wrap.
   */
  jsval wrapMessage(in jsval message, in nsIDOMWindow window);
};

/*
 * Implements an interface to allow specific message types to
 * configure some behaviors
 */
[scriptable, uuid(a0e970f6-faa9-4605-89d6-fafae8b10a80)]
interface nsISystemMessagesConfigurator: nsISupports
{
  /*
   * Will be true if this type of system messages assumes/requires
   * that the app will be brought to the front always.
   */
  readonly attribute boolean mustShowRunningApp;
};