2012-05-16 03:40:47 -07:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
|
|
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
#include "domstubs.idl"
|
|
|
|
|
|
|
|
interface mozIDOMApplication;
|
2012-08-31 07:34:28 -07:00
|
|
|
interface mozIApplication;
|
2013-05-14 12:00:09 -07:00
|
|
|
interface nsIURI;
|
2012-05-16 03:40:47 -07:00
|
|
|
|
|
|
|
%{C++
|
|
|
|
#define APPS_SERVICE_CID { 0x05072afa, 0x92fe, 0x45bf, { 0xae, 0x22, 0x39, 0xb6, 0x9c, 0x11, 0x70, 0x58 } }
|
|
|
|
#define APPS_SERVICE_CONTRACTID "@mozilla.org/AppsService;1"
|
|
|
|
%}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This service allows accessing some DOMApplicationRegistry methods from
|
|
|
|
* non-javascript code.
|
|
|
|
*/
|
2013-07-24 06:03:25 -07:00
|
|
|
[scriptable, uuid(9b23d8f0-b2f3-46af-bff4-3df6c3cb69db)]
|
2012-05-16 03:40:47 -07:00
|
|
|
interface nsIAppsService : nsISupports
|
|
|
|
{
|
|
|
|
mozIDOMApplication getAppByManifestURL(in DOMString manifestURL);
|
2012-07-18 21:25:19 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the |localId| of the app associated with the |manifestURL| passed
|
|
|
|
* in parameter.
|
|
|
|
* Returns nsIScriptSecurityManager::NO_APP_ID if |manifestURL| isn't a valid
|
|
|
|
* installed manifest URL.
|
|
|
|
*/
|
2012-07-09 03:25:41 -07:00
|
|
|
unsigned long getAppLocalIdByManifestURL(in DOMString manifestURL);
|
2012-08-08 09:41:47 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the application associated to this localId.
|
|
|
|
*/
|
|
|
|
mozIDOMApplication getAppByLocalId(in unsigned long localId);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the manifest URL associated to this localId.
|
|
|
|
*/
|
|
|
|
DOMString getManifestURLByLocalId(in unsigned long localId);
|
2012-08-31 07:34:28 -07:00
|
|
|
|
2012-10-19 03:43:17 -07:00
|
|
|
/**
|
|
|
|
* Returns the CSP associated to this localId.
|
|
|
|
*/
|
|
|
|
DOMString getCSPByLocalId(in unsigned long localId);
|
2012-12-22 05:56:21 -08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the basepath for core apps
|
|
|
|
*/
|
|
|
|
DOMString getCoreAppsBasePath();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the basepath for regular packaged apps
|
|
|
|
*/
|
|
|
|
DOMString getWebAppsBasePath();
|
2013-01-31 13:35:13 -08:00
|
|
|
|
|
|
|
jsval getAppInfo(in DOMString appId);
|
2013-01-25 01:57:14 -08:00
|
|
|
|
2013-05-14 12:00:09 -07:00
|
|
|
/**
|
|
|
|
* Returns a URI to redirect to when we get a redirection to 'uri'.
|
|
|
|
* Returns null if no redirection is declared for this uri.
|
|
|
|
*/
|
|
|
|
nsIURI getRedirect(in unsigned long localId, in nsIURI uri);
|
|
|
|
|
2013-01-25 01:57:14 -08:00
|
|
|
/**
|
|
|
|
* Returns the localId if the app was installed from a store
|
|
|
|
*/
|
|
|
|
DOMString getAppLocalIdByStoreId(in DOMString storeID);
|
2012-05-16 03:40:47 -07:00
|
|
|
};
|