1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/messages/interfaces/nsISystemMessagesInternal.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,67 @@ 1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this file, 1.6 + * You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.7 + 1.8 +#include "domstubs.idl" 1.9 + 1.10 +interface nsIURI; 1.11 +interface nsIDOMWindow; 1.12 + 1.13 +// Implemented by the contract id @mozilla.org/system-message-internal;1 1.14 + 1.15 +[scriptable, uuid(6296a314-2abf-4cd0-9097-5e81ee6832e2)] 1.16 +interface nsISystemMessagesInternal : nsISupports 1.17 +{ 1.18 + /* 1.19 + * Allow any internal user to broadcast a message of a given type. 1.20 + * @param type The type of the message to be sent. 1.21 + * @param message The message payload. 1.22 + * @param pageURI The URI of the page that will be opened. 1.23 + * @param manifestURI The webapp's manifest URI. 1.24 + * @param extra Extra opaque information that will be passed around in the observer 1.25 + * notification to open the page. 1.26 + */ 1.27 + void sendMessage(in DOMString type, in jsval message, in nsIURI pageURI, in nsIURI manifestURI, [optional] in jsval extra); 1.28 + 1.29 + /* 1.30 + * Allow any internal user to broadcast a message of a given type. 1.31 + * The application that registers the message will be launched. 1.32 + * @param type The type of the message to be sent. 1.33 + * @param message The message payload. 1.34 + * @param extra Extra opaque information that will be passed around in the observer 1.35 + * notification to open the page. 1.36 + */ 1.37 + void broadcastMessage(in DOMString type, in jsval message, [optional] in jsval extra); 1.38 + 1.39 + /* 1.40 + * Registration of a page that wants to be notified of a message type. 1.41 + * @param type The message type. 1.42 + * @param pageURI The URI of the page that will be opened. 1.43 + * @param manifestURI The webapp's manifest URI. 1.44 + */ 1.45 + void registerPage(in DOMString type, in nsIURI pageURI, in nsIURI manifestURI); 1.46 +}; 1.47 + 1.48 +[scriptable, uuid(002f0e82-91f0-41de-ad43-569a2b9d12df)] 1.49 +interface nsISystemMessagesWrapper: nsISupports 1.50 +{ 1.51 + /* 1.52 + * Wrap a message and gives back any kind of object. 1.53 + * @param message The json blob to wrap. 1.54 + */ 1.55 + jsval wrapMessage(in jsval message, in nsIDOMWindow window); 1.56 +}; 1.57 + 1.58 +/* 1.59 + * Implements an interface to allow specific message types to 1.60 + * configure some behaviors 1.61 + */ 1.62 +[scriptable, uuid(a0e970f6-faa9-4605-89d6-fafae8b10a80)] 1.63 +interface nsISystemMessagesConfigurator: nsISupports 1.64 +{ 1.65 + /* 1.66 + * Will be true if this type of system messages assumes/requires 1.67 + * that the app will be brought to the front always. 1.68 + */ 1.69 + readonly attribute boolean mustShowRunningApp; 1.70 +};