我们的志愿者还没有将这篇文章翻译为 中文 (简体)。加入我们帮助完成翻译!
nsISupports
Last changed in Gecko 1.7 Method overview
|
|
void readUserPrefs(in nsIFile aFile); |
void resetPrefs(); |
void resetUserPrefs(); |
void savePrefFile(in nsIFile aFile); |
Methods
getBranch()
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.
nsIPrefBranch getBranch( in string aPrefRoot );
Parameters
-
aPrefRoot
- The 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".
Return value
nsIPrefBranch
- The object representing the requested branch.
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.
nsIPrefBranch getDefaultBranch( in string aPrefRoot );
Parameters
-
aPrefRoot
- The 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".
Return value
nsIPrefBranch
- The object representing the requested default branch.
readUserPrefs()
Called to read in the preferences specified in a user preference file.
nsnull
is passed in for the aFile
parameter the default preferences file(s) [prefs.js, user.js] will be read and processed.void readUserPrefs( in nsIFile aFile );
Parameters
-
aFile
- The file to be read.
resetPrefs()
Called to completely flush and re-initialize the preferences system.
void resetPrefs();
Parameters
None.
resetUserPrefs()
Called to reset all preferences with user set values back to the application default values.
void resetUserPrefs();
Parameters
None.
savePrefFile()
Called to write current preferences state to a file.
void savePrefFile( in nsIFile aFile );
Parameters
-
aFile
- The file to be written.