tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

nsIPrefOverrideMap.idl (1680B)


      1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
      2 /* This Source Code Form is subject to the terms of the Mozilla Public
      3 * License, v. 2.0. If a copy of the MPL was not distributed with this
      4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      5 
      6 #include "nsISupports.idl"
      7 #include "nsISupportsPrimitives.idl"
      8 
      9 /**
     10 * Represents a C++ map of pref names to values that is constructable from JS.
     11 * The entries in this map must be known prefs and the type of the jsval
     12 * values must match the known type of the pref.  We currently use this to
     13 * overlay alternative values atop the current pref values during
     14 * backupPrefFile, for prefs that we don't want to back up, or that we do want
     15 * to back up, but with values different than the current ones.
     16 */
     17 [scriptable, builtinclass, uuid(56ba17e3-4bfd-4804-bdf7-9c6e70170279)]
     18 interface nsIPrefOverrideMap : nsISupports
     19 {
     20  /**
     21   * Add value to the map.
     22   * @param aPrefName  Must be a known pref.
     23   * @param aPrefValue Type must be a boolean, an integer, or a string and must
     24   *                   match the known type of the pref.  Regardless of type,
     25   *                   this can always be null.
     26   * @throws If aPrefName is not a valid pref name, if aPrefValue is not of the
     27   *         right type for the pref, or on OOM
     28   */
     29  [implicit_jscontext]
     30  void addEntry(in ACString aPrefName, in jsval aPrefValue);
     31 
     32  /**
     33   * Retrieve a value from the map.
     34   * @param aPrefName  Must be a known pref.
     35   * @returns A boolean, an integer, or a string.
     36   * @throws  If aPrefName is not in the map or on OOM.
     37   */
     38  [implicit_jscontext]
     39  jsval getEntry(in ACString aPrefName);
     40 };