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 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 5#include "nsISupports.idl" 6#include "nsIURI.idl" 7 8[scriptable, uuid(6a568972-cc91-4bf5-963e-3768f3319b8a)] 9interface nsIEnterprisePolicies : nsISupports 10{ 11 const short UNINITIALIZED = -1; 12 const short INACTIVE = 0; 13 const short ACTIVE = 1; 14 const short FAILED = 2; 15 16 readonly attribute short status; 17 18 bool isAllowed(in ACString feature); 19 20 /** 21 * Get the active policies that have been successfully parsed. 22 * 23 * @returns A JS object that contains the policies names and 24 * their corresponding parameters. 25 */ 26 jsval getActivePolicies(); 27 28 /** 29 * Get the contents of the support menu (if applicable) 30 * 31 * @returns A JS object that contains the url and label or null. 32 */ 33 jsval getSupportMenu(); 34 35 /** 36 * Get the policy for a given extensionID (if available) 37 * 38 * @returns A JS object that contains the storage or null if unavailable. 39 */ 40 jsval getExtensionPolicy(in ACString extensionID); 41 42 /** 43 * Retrieves the ExtensionSettings policy for the given extensionID. 44 * 45 * If there is no policy for the extension, it returns the global policy. 46 * 47 * If there is no global policy, it returns null. 48 * 49 * @returns A JS object that settings or null if unavailable. 50 */ 51 jsval getExtensionSettings(in ACString extensionID); 52 53 /** 54 * Uses the whitelist, blacklist and settings to determine if an extension 55 * may be installed. 56 * 57 * @returns A boolean - true of the extension may be installed. 58 */ 59 bool mayInstallAddon(in jsval addon); 60 61 /** 62 * Uses install_sources to determine if an extension can be installed 63 * from the given URI. 64 * 65 * @returns A boolean - true of the extension may be installed. 66 */ 67 bool allowedInstallSource(in nsIURI uri); 68}; 69