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: #include "domstubs.idl" michael@0: michael@0: interface nsIURI; michael@0: interface nsIDOMWindow; michael@0: michael@0: // Implemented by the contract id @mozilla.org/system-message-internal;1 michael@0: michael@0: [scriptable, uuid(6296a314-2abf-4cd0-9097-5e81ee6832e2)] michael@0: interface nsISystemMessagesInternal : nsISupports michael@0: { michael@0: /* michael@0: * Allow any internal user to broadcast a message of a given type. michael@0: * @param type The type of the message to be sent. michael@0: * @param message The message payload. michael@0: * @param pageURI The URI of the page that will be opened. michael@0: * @param manifestURI The webapp's manifest URI. michael@0: * @param extra Extra opaque information that will be passed around in the observer michael@0: * notification to open the page. michael@0: */ michael@0: void sendMessage(in DOMString type, in jsval message, in nsIURI pageURI, in nsIURI manifestURI, [optional] in jsval extra); michael@0: michael@0: /* michael@0: * Allow any internal user to broadcast a message of a given type. michael@0: * The application that registers the message will be launched. michael@0: * @param type The type of the message to be sent. michael@0: * @param message The message payload. michael@0: * @param extra Extra opaque information that will be passed around in the observer michael@0: * notification to open the page. michael@0: */ michael@0: void broadcastMessage(in DOMString type, in jsval message, [optional] in jsval extra); michael@0: michael@0: /* michael@0: * Registration of a page that wants to be notified of a message type. michael@0: * @param type The message type. michael@0: * @param pageURI The URI of the page that will be opened. michael@0: * @param manifestURI The webapp's manifest URI. michael@0: */ michael@0: void registerPage(in DOMString type, in nsIURI pageURI, in nsIURI manifestURI); michael@0: }; michael@0: michael@0: [scriptable, uuid(002f0e82-91f0-41de-ad43-569a2b9d12df)] michael@0: interface nsISystemMessagesWrapper: nsISupports michael@0: { michael@0: /* michael@0: * Wrap a message and gives back any kind of object. michael@0: * @param message The json blob to wrap. michael@0: */ michael@0: jsval wrapMessage(in jsval message, in nsIDOMWindow window); michael@0: }; michael@0: michael@0: /* michael@0: * Implements an interface to allow specific message types to michael@0: * configure some behaviors michael@0: */ michael@0: [scriptable, uuid(a0e970f6-faa9-4605-89d6-fafae8b10a80)] michael@0: interface nsISystemMessagesConfigurator: nsISupports michael@0: { michael@0: /* michael@0: * Will be true if this type of system messages assumes/requires michael@0: * that the app will be brought to the front always. michael@0: */ michael@0: readonly attribute boolean mustShowRunningApp; michael@0: };