|
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 mozIDOMApplication; |
|
8 interface mozIApplication; |
|
9 interface nsIURI; |
|
10 |
|
11 %{C++ |
|
12 #define APPS_SERVICE_CID { 0x05072afa, 0x92fe, 0x45bf, { 0xae, 0x22, 0x39, 0xb6, 0x9c, 0x11, 0x70, 0x58 } } |
|
13 #define APPS_SERVICE_CONTRACTID "@mozilla.org/AppsService;1" |
|
14 %} |
|
15 |
|
16 /* |
|
17 * This service allows accessing some DOMApplicationRegistry methods from |
|
18 * non-javascript code. |
|
19 */ |
|
20 [scriptable, uuid(93cde78d-56f6-4322-b707-9b23eb80d90d)] |
|
21 interface nsIAppsService : nsISupports |
|
22 { |
|
23 mozIApplication getAppByManifestURL(in DOMString manifestURL); |
|
24 |
|
25 /** |
|
26 * Returns the |localId| of the app associated with the |manifestURL| passed |
|
27 * in parameter. |
|
28 * Returns nsIScriptSecurityManager::NO_APP_ID if |manifestURL| isn't a valid |
|
29 * installed manifest URL. |
|
30 */ |
|
31 unsigned long getAppLocalIdByManifestURL(in DOMString manifestURL); |
|
32 |
|
33 /** |
|
34 * Returns the application associated to this localId. |
|
35 */ |
|
36 mozIApplication getAppByLocalId(in unsigned long localId); |
|
37 |
|
38 /** |
|
39 * Returns the manifest URL associated to this localId. |
|
40 */ |
|
41 DOMString getManifestURLByLocalId(in unsigned long localId); |
|
42 |
|
43 /** |
|
44 * Returns the CSP associated to this localId. |
|
45 */ |
|
46 DOMString getCSPByLocalId(in unsigned long localId); |
|
47 |
|
48 /** |
|
49 * Returns the basepath for core apps |
|
50 */ |
|
51 DOMString getCoreAppsBasePath(); |
|
52 |
|
53 /** |
|
54 * Returns the basepath for regular packaged apps |
|
55 */ |
|
56 DOMString getWebAppsBasePath(); |
|
57 |
|
58 jsval getAppInfo(in DOMString appId); |
|
59 |
|
60 /** |
|
61 * Returns a URI to redirect to when we get a redirection to 'uri'. |
|
62 * Returns null if no redirection is declared for this uri. |
|
63 */ |
|
64 nsIURI getRedirect(in unsigned long localId, in nsIURI uri); |
|
65 |
|
66 /** |
|
67 * Returns the localId if the app was installed from a store |
|
68 */ |
|
69 DOMString getAppLocalIdByStoreId(in DOMString storeID); |
|
70 }; |