Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions
nsIPrefService Interface Reference

The nsIPrefService interface is the main entry point into the back end preferences management library. More...

import "nsIPrefService.idl";

Inheritance diagram for nsIPrefService:
Inheritance graph
[legend]
Collaboration diagram for nsIPrefService:
Collaboration graph
[legend]

List of all members.

Public Member Functions

void readUserPrefs (in nsIFile aFile)
 Called to read in the preferences specified in a user preference file.
void resetPrefs ()
 Called to completely flush and re-initialize the preferences system.
void resetUserPrefs ()
 Called to reset all preferences with user set values back to the application default values.
void savePrefFile (in nsIFile aFile)
 Called to write current preferences state to a file.
nsIPrefBranch getBranch (in string aPrefRoot)
 Call to get a Preferences "Branch" which accesses user preference data.
nsIPrefBranch getDefaultBranch (in string aPrefRoot)
 Call to get a Preferences "Branch" which accesses only the default preference data.

Detailed Description

The nsIPrefService interface is the main entry point into the back end preferences management library.

The preference service is directly responsible for the management of the preferences files and also facilitates access to the preference branch object which allows the direct manipulation of the preferences themselves.

See also:
nsIPrefBranch

FROZEN

Definition at line 58 of file nsIPrefService.idl.


Member Function Documentation

Call to get a Preferences "Branch" which accesses user preference data.

Using a Set method on this object will always create or set a user preference value. When using a Get method a user set value will be returned if one exists, otherwise a default value will be returned.

Parameters:
aPrefRootThe preference "root" on which to base this "branch". For example, if the root "browser.startup." is used, the branch will be able to easily access the preferences "browser.startup.page", "browser.startup.homepage", or "browser.startup.homepage_override" by simply requesting "page", "homepage", or "homepage_override". nsnull or "" may be used to access to the entire preference "tree".
Returns:
nsIPrefBranch The object representing the requested branch.
See also:
getDefaultBranch

Call to get a Preferences "Branch" which accesses only the default preference data.

Using a Set method on this object will always create or set a default preference value. When using a Get method a default value will always be returned.

Parameters:
aPrefRootThe preference "root" on which to base this "branch". For example, if the root "browser.startup." is used, the branch will be able to easily access the preferences "browser.startup.page", "browser.startup.homepage", or "browser.startup.homepage_override" by simply requesting "page", "homepage", or "homepage_override". nsnull or "" may be used to access to the entire preference "tree".
Note:
Few consumers will want to create default branch objects. Many of the branch methods do nothing on a default branch because the operations only make sense when applied to user set preferences.
Returns:
nsIPrefBranch The object representing the requested default branch.
See also:
getBranch

Called to read in the preferences specified in a user preference file.

Parameters:
aFileThe file to be read.
Note:
If nsnull is passed in for the aFile parameter the default preferences file(s) [prefs.js, user.js] will be read and processed.
Returns:
NS_OK File was read and processed.
Other File failed to read or contained invalid data.
See also:
savePrefFile
nsIFile

Called to completely flush and re-initialize the preferences system.

Returns:
NS_OK The preference service was re-initialized correctly.
Other The preference service failed to restart correctly.

Called to reset all preferences with user set values back to the application default values.

Returns:
NS_OK Always.

Called to write current preferences state to a file.

Parameters:
aFileThe file to be written.
Note:
If nsnull is passed in for the aFile parameter the preference data is written out to the current preferences file (usually prefs.js.)
Returns:
NS_OK File was written.
Other File failed to write.
See also:
readUserPrefs
nsIFile

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