1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/interfaces/apps/nsIAppsService.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,70 @@ 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 mozIDOMApplication; 1.11 +interface mozIApplication; 1.12 +interface nsIURI; 1.13 + 1.14 +%{C++ 1.15 +#define APPS_SERVICE_CID { 0x05072afa, 0x92fe, 0x45bf, { 0xae, 0x22, 0x39, 0xb6, 0x9c, 0x11, 0x70, 0x58 } } 1.16 +#define APPS_SERVICE_CONTRACTID "@mozilla.org/AppsService;1" 1.17 +%} 1.18 + 1.19 +/* 1.20 + * This service allows accessing some DOMApplicationRegistry methods from 1.21 + * non-javascript code. 1.22 + */ 1.23 +[scriptable, uuid(93cde78d-56f6-4322-b707-9b23eb80d90d)] 1.24 +interface nsIAppsService : nsISupports 1.25 +{ 1.26 + mozIApplication getAppByManifestURL(in DOMString manifestURL); 1.27 + 1.28 + /** 1.29 + * Returns the |localId| of the app associated with the |manifestURL| passed 1.30 + * in parameter. 1.31 + * Returns nsIScriptSecurityManager::NO_APP_ID if |manifestURL| isn't a valid 1.32 + * installed manifest URL. 1.33 + */ 1.34 + unsigned long getAppLocalIdByManifestURL(in DOMString manifestURL); 1.35 + 1.36 + /** 1.37 + * Returns the application associated to this localId. 1.38 + */ 1.39 + mozIApplication getAppByLocalId(in unsigned long localId); 1.40 + 1.41 + /** 1.42 + * Returns the manifest URL associated to this localId. 1.43 + */ 1.44 + DOMString getManifestURLByLocalId(in unsigned long localId); 1.45 + 1.46 + /** 1.47 + * Returns the CSP associated to this localId. 1.48 + */ 1.49 + DOMString getCSPByLocalId(in unsigned long localId); 1.50 + 1.51 + /** 1.52 + * Returns the basepath for core apps 1.53 + */ 1.54 + DOMString getCoreAppsBasePath(); 1.55 + 1.56 + /** 1.57 + * Returns the basepath for regular packaged apps 1.58 + */ 1.59 + DOMString getWebAppsBasePath(); 1.60 + 1.61 + jsval getAppInfo(in DOMString appId); 1.62 + 1.63 + /** 1.64 + * Returns a URI to redirect to when we get a redirection to 'uri'. 1.65 + * Returns null if no redirection is declared for this uri. 1.66 + */ 1.67 + nsIURI getRedirect(in unsigned long localId, in nsIURI uri); 1.68 + 1.69 + /** 1.70 + * Returns the localId if the app was installed from a store 1.71 + */ 1.72 + DOMString getAppLocalIdByStoreId(in DOMString storeID); 1.73 +};