toolkit/mozapps/extensions/amIWebInstallListener.idl

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:4307c548013f
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
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4
5 #include "nsISupports.idl"
6
7 interface nsIDOMWindow;
8 interface nsIURI;
9 interface nsIVariant;
10
11 /**
12 * amIWebInstallInfo is used by the default implementation of
13 * amIWebInstallListener to communicate with the running application and allow
14 * it to warn the user about blocked installs and start the installs running.
15 */
16 [scriptable, uuid(8710e692-3989-4dc7-b607-40d57610ae75)]
17 interface amIWebInstallInfo : nsISupports
18 {
19 readonly attribute nsIDOMWindow originatingWindow;
20 readonly attribute nsIURI originatingURI;
21 readonly attribute nsIVariant installs;
22
23 /**
24 * Starts all installs.
25 */
26 void install();
27 };
28
29 /**
30 * The registered amIWebInstallListener is used to notify about new installs
31 * triggered by websites. The default implementation displays a confirmation
32 * dialog when add-ons are ready to install and uses the observer service to
33 * notify when installations are blocked.
34 */
35 [scriptable, uuid(a5503979-89c8-441e-9e4a-321df379c172)]
36 interface amIWebInstallListener : nsISupports
37 {
38 /**
39 * Called when installation by websites is currently disabled.
40 *
41 * @param aWindow
42 * The window that triggered the installs
43 * @param aUri
44 * The URI of the site that triggered the installs
45 * @param aInstalls
46 * The AddonInstalls that were blocked
47 * @param aCount
48 * The number of AddonInstalls
49 */
50 void onWebInstallDisabled(in nsIDOMWindow aWindow, in nsIURI aUri,
51 [array, size_is(aCount)] in nsIVariant aInstalls,
52 [optional] in uint32_t aCount);
53
54 /**
55 * Called when the website is not allowed to directly prompt the user to
56 * install add-ons.
57 *
58 * @param aWindow
59 * The window that triggered the installs
60 * @param aUri
61 * The URI of the site that triggered the installs
62 * @param aInstalls
63 * The AddonInstalls that were blocked
64 * @param aCount
65 * The number of AddonInstalls
66 * @return true if the caller should start the installs
67 */
68 boolean onWebInstallBlocked(in nsIDOMWindow aWindow, in nsIURI aUri,
69 [array, size_is(aCount)] in nsIVariant aInstalls,
70 [optional] in uint32_t aCount);
71
72 /**
73 * Called when a website wants to ask the user to install add-ons.
74 *
75 * @param aWindow
76 * The window that triggered the installs
77 * @param aUri
78 * The URI of the site that triggered the installs
79 * @param aInstalls
80 * The AddonInstalls that were requested
81 * @param aCount
82 * The number of AddonInstalls
83 * @return true if the caller should start the installs
84 */
85 boolean onWebInstallRequested(in nsIDOMWindow aWindow, in nsIURI aUri,
86 [array, size_is(aCount)] in nsIVariant aInstalls,
87 [optional] in uint32_t aCount);
88 };
89
90 /**
91 * amIWebInstallPrompt is used, if available, by the default implementation of
92 * amIWebInstallInfo to display a confirmation UI to the user before running
93 * installs.
94 */
95 [scriptable, uuid(c5529918-4291-4b56-bd46-e9268900f2a3)]
96 interface amIWebInstallPrompt : nsISupports
97 {
98 /**
99 * Get a confirmation that the user wants to start the installs.
100 *
101 * @param aWindow
102 * The window that triggered the installs
103 * @param aUri
104 * The URI of the site that triggered the installs
105 * @param aInstalls
106 * The AddonInstalls that were requested
107 * @param aCount
108 * The number of AddonInstalls
109 */
110 void confirm(in nsIDOMWindow aWindow, in nsIURI aUri,
111 [array, size_is(aCount)] in nsIVariant aInstalls,
112 [optional] in uint32_t aCount);
113 };

mercurial