Public Member Functions | Public Attributes

extIPreferenceBranch Interface Reference

Interface for simplified access to preferences. More...

import "extIApplication.idl";

Collaboration diagram for extIPreferenceBranch:

List of all members.

Public Member Functions

NS_SCRIPTABLE NS_IMETHOD GetRoot (nsAString &aRoot)=0
 The name of the branch root.
NS_SCRIPTABLE NS_IMETHOD GetAll (nsIVariant **aAll)=0
 Array of extIPreference listing all preferences in this branch.
NS_SCRIPTABLE NS_IMETHOD GetEvents (extIEvents **aEvents)=0
 The events object for the preferences supports: "change".
NS_SCRIPTABLE NS_IMETHOD Has (const nsAString &aName, PRBool *_retval NS_OUTPARAM)=0
 Check to see if a preference exists.
NS_SCRIPTABLE NS_IMETHOD Get (const nsAString &aName, extIPreference **_retval NS_OUTPARAM)=0
 Gets an object representing a preference.
NS_SCRIPTABLE NS_IMETHOD GetValue (const nsAString &aName, nsIVariant *aDefaultValue, nsIVariant **_retval NS_OUTPARAM)=0
 Gets the value of a preference.
NS_SCRIPTABLE NS_IMETHOD SetValue (const nsAString &aName, nsIVariant *aValue)=0
 Sets the value of a storage item with the given name.
NS_SCRIPTABLE NS_IMETHOD Reset (void)=0
 Resets all preferences in a branch back to their default values.
boolean has (in AString aName)
 Check to see if a preference exists.
extIPreference get (in AString aName)
 Gets an object representing a preference.
nsIVariant getValue (in AString aName, in nsIVariant aDefaultValue)
 Gets the value of a preference.
void setValue (in AString aName, in nsIVariant aValue)
 Sets the value of a storage item with the given name.
void reset ()
 Resets all preferences in a branch back to their default values.

Public Attributes

readonly attribute AString root
 The name of the branch root.
readonly attribute nsIVariant all
 Array of extIPreference listing all preferences in this branch.
readonly attribute extIEvents events
 The events object for the preferences supports: "change".

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.


Member Function Documentation

NS_SCRIPTABLE NS_IMETHOD extIPreferenceBranch::Get ( const nsAString aName,
extIPreference **_retval  NS_OUTPARAM 
) [pure virtual]

Gets an object representing a preference.

Parameters:
aName The name of preference
Returns:
a preference object, or null if the preference does not exist
extIPreference extIPreferenceBranch::get ( in AString  aName  ) 

Gets an object representing a preference.

Parameters:
aName The name of preference
Returns:
a preference object, or null if the preference does not exist
NS_SCRIPTABLE NS_IMETHOD extIPreferenceBranch::GetAll ( nsIVariant **  aAll  )  [pure virtual]

Array of extIPreference listing all preferences in this branch.

NS_SCRIPTABLE NS_IMETHOD extIPreferenceBranch::GetEvents ( extIEvents **  aEvents  )  [pure virtual]

The events object for the preferences supports: "change".

NS_SCRIPTABLE NS_IMETHOD extIPreferenceBranch::GetRoot ( nsAString aRoot  )  [pure virtual]

The name of the branch root.

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.

Parameters:
aName The name of preference
aDefaultValue The value to return if preference does not exist
Returns:
value of the preference or the given default value if preference does not exists.
NS_SCRIPTABLE NS_IMETHOD extIPreferenceBranch::GetValue ( const nsAString aName,
nsIVariant aDefaultValue,
nsIVariant **_retval  NS_OUTPARAM 
) [pure virtual]

Gets the value of a preference.

Returns a default value if the preference does not exist.

Parameters:
aName The name of preference
aDefaultValue The value to return if preference does not exist
Returns:
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.

Parameters:
aName The name of preference
Returns:
true if the preference exists, false if not
NS_SCRIPTABLE NS_IMETHOD extIPreferenceBranch::Has ( const nsAString aName,
PRBool *_retval  NS_OUTPARAM 
) [pure virtual]

Check to see if a preference exists.

Parameters:
aName The name of preference
Returns:
true if the preference exists, false if not
void extIPreferenceBranch::reset (  ) 

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

NS_SCRIPTABLE NS_IMETHOD extIPreferenceBranch::Reset ( void   )  [pure virtual]

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

NS_SCRIPTABLE NS_IMETHOD extIPreferenceBranch::SetValue ( const nsAString aName,
nsIVariant aValue 
) [pure virtual]

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

Parameters:
aName The name of an item
aValue The value to assign to the item
void extIPreferenceBranch::setValue ( in AString  aName,
in nsIVariant  aValue 
)

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

Parameters:
aName The name of an item
aValue The value to assign to the item

Member Data Documentation

Array of extIPreference listing all preferences in this branch.

The events object for the preferences supports: "change".

readonly attribute AString extIPreferenceBranch::root

The name of the branch root.


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