extIPreferenceBranch Interface Reference


Inheritance diagram for extIPreferenceBranch:
Collaboration diagram for extIPreferenceBranch:

Public Member Functions

boolean has (in AString aName)
extIPreference get (in AString aName)
nsIVariant getValue (in AString aName, in nsIVariant aDefaultValue)
void setValue (in AString aName, in nsIVariant aValue)
void reset ()

Public Attributes

readonly attribute AString root
readonly attribute nsIVariant all
readonly attribute extIEvents events

Detailed Description

Interface for simplified access to preferences. The interface has a predefined root preference branch. The root branch is set based on the context of the owner. For example, an extension's preferences have a root of "extensions.<extensionid>.", while the application level preferences have an empty root. All preference "aName" parameters used in this interface are relative to the root branch.

Definition at line 151 of file extIApplication.idl.

Member Function Documentation

extIPreference extIPreferenceBranch::get ( in AString  aName)

Gets an object representing a preference

aNameThe name of preference
a preference object, or null if the preference does not exist
nsIVariant extIPreferenceBranch::getValue ( in AString  aName,
in nsIVariant  aDefaultValue 

Gets the value of a preference. Returns a default value if the preference does not exist.

aNameThe name of preference
aDefaultValueThe value to return if preference does not exist
value of the preference or the given default value if preference does not exists.
boolean extIPreferenceBranch::has ( in AString  aName)

Check to see if a preference exists.

aNameThe name of preference
true if the preference exists, false if not
void extIPreferenceBranch::reset ( )

Resets all preferences in a branch back to their default values.

void extIPreferenceBranch::setValue ( in AString  aName,
in nsIVariant  aValue 

Sets the value of a storage item with the given name.

aNameThe name of an item
aValueThe value to assign to the item

Member Data Documentation

readonly attribute nsIVariant extIPreferenceBranch::all

Array of extIPreference listing all preferences in this branch.

Definition at line 161 of file extIApplication.idl.

readonly attribute extIEvents extIPreferenceBranch::events

The events object for the preferences supports: "change"

Definition at line 167 of file extIApplication.idl.

readonly attribute AString extIPreferenceBranch::root

The name of the branch root.

Definition at line 156 of file extIApplication.idl.

The documentation for this interface was generated from the following file: