michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this file, michael@0: * You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "domstubs.idl" michael@0: michael@0: interface mozIDOMApplication; michael@0: interface mozIApplication; michael@0: interface nsIURI; michael@0: michael@0: %{C++ michael@0: #define APPS_SERVICE_CID { 0x05072afa, 0x92fe, 0x45bf, { 0xae, 0x22, 0x39, 0xb6, 0x9c, 0x11, 0x70, 0x58 } } michael@0: #define APPS_SERVICE_CONTRACTID "@mozilla.org/AppsService;1" michael@0: %} michael@0: michael@0: /* michael@0: * This service allows accessing some DOMApplicationRegistry methods from michael@0: * non-javascript code. michael@0: */ michael@0: [scriptable, uuid(93cde78d-56f6-4322-b707-9b23eb80d90d)] michael@0: interface nsIAppsService : nsISupports michael@0: { michael@0: mozIApplication getAppByManifestURL(in DOMString manifestURL); michael@0: michael@0: /** michael@0: * Returns the |localId| of the app associated with the |manifestURL| passed michael@0: * in parameter. michael@0: * Returns nsIScriptSecurityManager::NO_APP_ID if |manifestURL| isn't a valid michael@0: * installed manifest URL. michael@0: */ michael@0: unsigned long getAppLocalIdByManifestURL(in DOMString manifestURL); michael@0: michael@0: /** michael@0: * Returns the application associated to this localId. michael@0: */ michael@0: mozIApplication getAppByLocalId(in unsigned long localId); michael@0: michael@0: /** michael@0: * Returns the manifest URL associated to this localId. michael@0: */ michael@0: DOMString getManifestURLByLocalId(in unsigned long localId); michael@0: michael@0: /** michael@0: * Returns the CSP associated to this localId. michael@0: */ michael@0: DOMString getCSPByLocalId(in unsigned long localId); michael@0: michael@0: /** michael@0: * Returns the basepath for core apps michael@0: */ michael@0: DOMString getCoreAppsBasePath(); michael@0: michael@0: /** michael@0: * Returns the basepath for regular packaged apps michael@0: */ michael@0: DOMString getWebAppsBasePath(); michael@0: michael@0: jsval getAppInfo(in DOMString appId); michael@0: michael@0: /** michael@0: * Returns a URI to redirect to when we get a redirection to 'uri'. michael@0: * Returns null if no redirection is declared for this uri. michael@0: */ michael@0: nsIURI getRedirect(in unsigned long localId, in nsIURI uri); michael@0: michael@0: /** michael@0: * Returns the localId if the app was installed from a store michael@0: */ michael@0: DOMString getAppLocalIdByStoreId(in DOMString storeID); michael@0: };