|
1 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
2 * License, v. 2.0. If a copy of the MPL was not distributed with this file, |
|
3 * You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
4 |
|
5 #include "domstubs.idl" |
|
6 |
|
7 interface nsIURI; |
|
8 interface nsIDOMWindow; |
|
9 |
|
10 // Implemented by the contract id @mozilla.org/system-message-internal;1 |
|
11 |
|
12 [scriptable, uuid(6296a314-2abf-4cd0-9097-5e81ee6832e2)] |
|
13 interface nsISystemMessagesInternal : nsISupports |
|
14 { |
|
15 /* |
|
16 * Allow any internal user to broadcast a message of a given type. |
|
17 * @param type The type of the message to be sent. |
|
18 * @param message The message payload. |
|
19 * @param pageURI The URI of the page that will be opened. |
|
20 * @param manifestURI The webapp's manifest URI. |
|
21 * @param extra Extra opaque information that will be passed around in the observer |
|
22 * notification to open the page. |
|
23 */ |
|
24 void sendMessage(in DOMString type, in jsval message, in nsIURI pageURI, in nsIURI manifestURI, [optional] in jsval extra); |
|
25 |
|
26 /* |
|
27 * Allow any internal user to broadcast a message of a given type. |
|
28 * The application that registers the message will be launched. |
|
29 * @param type The type of the message to be sent. |
|
30 * @param message The message payload. |
|
31 * @param extra Extra opaque information that will be passed around in the observer |
|
32 * notification to open the page. |
|
33 */ |
|
34 void broadcastMessage(in DOMString type, in jsval message, [optional] in jsval extra); |
|
35 |
|
36 /* |
|
37 * Registration of a page that wants to be notified of a message type. |
|
38 * @param type The message type. |
|
39 * @param pageURI The URI of the page that will be opened. |
|
40 * @param manifestURI The webapp's manifest URI. |
|
41 */ |
|
42 void registerPage(in DOMString type, in nsIURI pageURI, in nsIURI manifestURI); |
|
43 }; |
|
44 |
|
45 [scriptable, uuid(002f0e82-91f0-41de-ad43-569a2b9d12df)] |
|
46 interface nsISystemMessagesWrapper: nsISupports |
|
47 { |
|
48 /* |
|
49 * Wrap a message and gives back any kind of object. |
|
50 * @param message The json blob to wrap. |
|
51 */ |
|
52 jsval wrapMessage(in jsval message, in nsIDOMWindow window); |
|
53 }; |
|
54 |
|
55 /* |
|
56 * Implements an interface to allow specific message types to |
|
57 * configure some behaviors |
|
58 */ |
|
59 [scriptable, uuid(a0e970f6-faa9-4605-89d6-fafae8b10a80)] |
|
60 interface nsISystemMessagesConfigurator: nsISupports |
|
61 { |
|
62 /* |
|
63 * Will be true if this type of system messages assumes/requires |
|
64 * that the app will be brought to the front always. |
|
65 */ |
|
66 readonly attribute boolean mustShowRunningApp; |
|
67 }; |