Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 3 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 4 | |
michael@0 | 5 | #include "domstubs.idl" |
michael@0 | 6 | #include "nsIDOMEventTarget.idl" |
michael@0 | 7 | |
michael@0 | 8 | interface nsIDOMDOMRequest; |
michael@0 | 9 | |
michael@0 | 10 | [scriptable, uuid(f8cb08ed-588e-465f-b2b3-a4b0afde711a)] |
michael@0 | 11 | interface mozIDOMApplication : nsISupports |
michael@0 | 12 | { |
michael@0 | 13 | readonly attribute jsval manifest; |
michael@0 | 14 | readonly attribute jsval updateManifest; |
michael@0 | 15 | readonly attribute DOMString manifestURL; |
michael@0 | 16 | readonly attribute jsval receipts; /* an array of strings */ |
michael@0 | 17 | readonly attribute DOMString origin; |
michael@0 | 18 | readonly attribute DOMString installOrigin; |
michael@0 | 19 | readonly attribute unsigned long long installTime; |
michael@0 | 20 | readonly attribute boolean removable; |
michael@0 | 21 | |
michael@0 | 22 | /** |
michael@0 | 23 | * The current progress when downloading an offline cache. |
michael@0 | 24 | */ |
michael@0 | 25 | readonly attribute double progress; |
michael@0 | 26 | |
michael@0 | 27 | /** |
michael@0 | 28 | * The application installation state : |
michael@0 | 29 | * "pending" : The application is being installed (eg, we're downloading the |
michael@0 | 30 | * offline cache or the package). |
michael@0 | 31 | * "installed" : The application is installed and ready to be launched. |
michael@0 | 32 | * "updating" : We are updating the offline-cache or the package. |
michael@0 | 33 | */ |
michael@0 | 34 | readonly attribute DOMString installState; |
michael@0 | 35 | |
michael@0 | 36 | /** |
michael@0 | 37 | * fires a nsIDOMApplicationEvent when a change in appcache download or |
michael@0 | 38 | * package download happens. |
michael@0 | 39 | */ |
michael@0 | 40 | attribute nsIDOMEventListener onprogress; |
michael@0 | 41 | |
michael@0 | 42 | /** |
michael@0 | 43 | * The date of the last update check. |
michael@0 | 44 | */ |
michael@0 | 45 | readonly attribute unsigned long long lastUpdateCheck; |
michael@0 | 46 | |
michael@0 | 47 | /** |
michael@0 | 48 | * The date of the last updated manifest. |
michael@0 | 49 | */ |
michael@0 | 50 | readonly attribute unsigned long long updateTime; |
michael@0 | 51 | |
michael@0 | 52 | /** |
michael@0 | 53 | * Starts the process of looking for an update. |
michael@0 | 54 | */ |
michael@0 | 55 | nsIDOMDOMRequest checkForUpdate(); |
michael@0 | 56 | |
michael@0 | 57 | readonly attribute boolean downloadAvailable; |
michael@0 | 58 | readonly attribute boolean downloading; |
michael@0 | 59 | readonly attribute boolean readyToApplyDownload; |
michael@0 | 60 | readonly attribute long downloadSize; |
michael@0 | 61 | |
michael@0 | 62 | // This is a DOMError |
michael@0 | 63 | readonly attribute nsISupports downloadError; |
michael@0 | 64 | |
michael@0 | 65 | attribute nsIDOMEventListener ondownloadsuccess; |
michael@0 | 66 | attribute nsIDOMEventListener ondownloaderror; |
michael@0 | 67 | attribute nsIDOMEventListener ondownloadavailable; |
michael@0 | 68 | |
michael@0 | 69 | /** |
michael@0 | 70 | * Will fire once the mgmt.applyDownload() call succeeds. |
michael@0 | 71 | */ |
michael@0 | 72 | attribute nsIDOMEventListener ondownloadapplied; |
michael@0 | 73 | |
michael@0 | 74 | /** |
michael@0 | 75 | * Starts to download an update. If |downloading| is true, this |
michael@0 | 76 | * is a no-op. |
michael@0 | 77 | */ |
michael@0 | 78 | void download(); |
michael@0 | 79 | |
michael@0 | 80 | /** |
michael@0 | 81 | * Cancels an ongoing update download. |
michael@0 | 82 | */ |
michael@0 | 83 | void cancelDownload(); |
michael@0 | 84 | |
michael@0 | 85 | /* startPoint will be used when several launch_path exists for an app */ |
michael@0 | 86 | nsIDOMDOMRequest launch([optional] in DOMString startPoint); |
michael@0 | 87 | |
michael@0 | 88 | /** |
michael@0 | 89 | * Clear data that has been collected through mozbrowser elements. |
michael@0 | 90 | * onsuccess will be called once data is actually cleared. |
michael@0 | 91 | */ |
michael@0 | 92 | nsIDOMDOMRequest clearBrowserData(); |
michael@0 | 93 | |
michael@0 | 94 | /** |
michael@0 | 95 | * Inter-App Communication APIs. |
michael@0 | 96 | * |
michael@0 | 97 | * https://wiki.mozilla.org/WebAPI/Inter_App_Communication_Alt_proposal |
michael@0 | 98 | */ |
michael@0 | 99 | nsISupports connect(in DOMString keyword, |
michael@0 | 100 | [optional] in jsval rules); // nsISupports is a Promise. |
michael@0 | 101 | |
michael@0 | 102 | nsISupports getConnections(); // nsISupports is a Promise. |
michael@0 | 103 | |
michael@0 | 104 | /* Receipts handling functions */ |
michael@0 | 105 | nsIDOMDOMRequest addReceipt(in DOMString receipt); |
michael@0 | 106 | nsIDOMDOMRequest removeReceipt(in DOMString receipt); |
michael@0 | 107 | nsIDOMDOMRequest replaceReceipt(in DOMString oldReceipt, in DOMString newReceipt); |
michael@0 | 108 | }; |
michael@0 | 109 | |
michael@0 | 110 | [scriptable, uuid(cf742022-5ba3-11e2-868f-03310341b006)] |
michael@0 | 111 | interface mozIDOMApplicationMgmt : nsISupports |
michael@0 | 112 | { |
michael@0 | 113 | /** |
michael@0 | 114 | * the request will return the all the applications installed. Only accessible |
michael@0 | 115 | * to privileged callers. |
michael@0 | 116 | */ |
michael@0 | 117 | nsIDOMDOMRequest getAll(); |
michael@0 | 118 | |
michael@0 | 119 | /** |
michael@0 | 120 | * the request will return the applications acquired from all origins but |
michael@0 | 121 | * which are not launchable (e.g. by not being natively installed), or null. |
michael@0 | 122 | */ |
michael@0 | 123 | nsIDOMDOMRequest getNotInstalled(); |
michael@0 | 124 | |
michael@0 | 125 | /** |
michael@0 | 126 | * event listener to get notified of application installs. Only settable by |
michael@0 | 127 | * privileged callers. |
michael@0 | 128 | * the event will be a mozIDOMApplicationEvent |
michael@0 | 129 | */ |
michael@0 | 130 | attribute nsIDOMEventListener oninstall; |
michael@0 | 131 | |
michael@0 | 132 | /** |
michael@0 | 133 | * event listener to get notified of application uninstalls. Only settable by |
michael@0 | 134 | * privileged callers. |
michael@0 | 135 | * the event will be a mozIDOMApplicationEvent |
michael@0 | 136 | */ |
michael@0 | 137 | attribute nsIDOMEventListener onuninstall; |
michael@0 | 138 | |
michael@0 | 139 | /** |
michael@0 | 140 | * Applies a downloaded update. |
michael@0 | 141 | * This function is a no-op if it's passed an app object which doesn't have |
michael@0 | 142 | * |readyToApplyDownload| set to true. |
michael@0 | 143 | */ |
michael@0 | 144 | void applyDownload(in mozIDOMApplication app); |
michael@0 | 145 | |
michael@0 | 146 | /** |
michael@0 | 147 | * Uninstall a web app. |
michael@0 | 148 | * |
michael@0 | 149 | * @param app : the app object of the web app to be uninstalled. |
michael@0 | 150 | * @returns : A DOMRequest object, returning the app's origin in |result| |
michael@0 | 151 | * if uninstall succeeds; returning "NOT_INSTALLED" error otherwise. |
michael@0 | 152 | */ |
michael@0 | 153 | nsIDOMDOMRequest uninstall(in mozIDOMApplication app); |
michael@0 | 154 | }; |
michael@0 | 155 | |
michael@0 | 156 | [scriptable, uuid(52710c5f-b2a2-4b27-b5b9-f679a1bcc79b)] |
michael@0 | 157 | interface mozIDOMApplicationRegistry : nsISupports |
michael@0 | 158 | { |
michael@0 | 159 | /** |
michael@0 | 160 | * Install a web app. |
michael@0 | 161 | * |
michael@0 | 162 | * @param manifestUrl : the URL of the webapps manifest. |
michael@0 | 163 | * @param parameters : A structure with optional information. |
michael@0 | 164 | * { |
michael@0 | 165 | * receipts: ... Will be used to specify the payment receipts for this installation. |
michael@0 | 166 | * categories: ... Will be used to specify the categories of the webapp. |
michael@0 | 167 | * } |
michael@0 | 168 | * @returns : A DOMRequest object, returning the app object in |result| if install succeeds. |
michael@0 | 169 | */ |
michael@0 | 170 | nsIDOMDOMRequest install(in DOMString manifestUrl, [optional] in jsval parameters); |
michael@0 | 171 | |
michael@0 | 172 | /** |
michael@0 | 173 | * the request will return the application currently installed, or null. |
michael@0 | 174 | */ |
michael@0 | 175 | nsIDOMDOMRequest getSelf(); |
michael@0 | 176 | |
michael@0 | 177 | /** |
michael@0 | 178 | * the request will return the application if the app from that origin is installed |
michael@0 | 179 | */ |
michael@0 | 180 | nsIDOMDOMRequest checkInstalled(in DOMString manifestUrl); |
michael@0 | 181 | |
michael@0 | 182 | /** |
michael@0 | 183 | * the request will return the applications installed from this origin, or null. |
michael@0 | 184 | */ |
michael@0 | 185 | nsIDOMDOMRequest getInstalled(); |
michael@0 | 186 | |
michael@0 | 187 | /** |
michael@0 | 188 | * Install a packaged web app. |
michael@0 | 189 | * |
michael@0 | 190 | * @param packageUrl : the URL of the webapps manifest. |
michael@0 | 191 | * @param parameters : A structure with optional information. |
michael@0 | 192 | * { |
michael@0 | 193 | * receipts: ... Will be used to specify the payment receipts for this installation. |
michael@0 | 194 | * categories: ... Will be used to specify the categories of the webapp. |
michael@0 | 195 | * } |
michael@0 | 196 | * @returns : A DOMRequest object, returning the app object in |result| if install succeeds. |
michael@0 | 197 | */ |
michael@0 | 198 | nsIDOMDOMRequest installPackage(in DOMString packageUrl, [optional] in jsval parameters); |
michael@0 | 199 | |
michael@0 | 200 | readonly attribute mozIDOMApplicationMgmt mgmt; |
michael@0 | 201 | }; |