nsIPref

IID:a22ad7b0-ca86-11d1-a9a4-00805f8a7ac4
Inherits From:nsISupports

This interface is implemented by the following components:


Constants

PRInt32 ePrefInvalid = 0
PRInt32 ePrefLocked = 1
PRInt32 ePrefUserset = 2
PRInt32 ePrefConfig = 4
PRInt32 ePrefRemote = 8
PRInt32 ePrefLilocal = 16
PRInt32 ePrefString = 32
PRInt32 ePrefInt = 64
PRInt32 ePrefBool = 128
PRInt32 ePrefValuetypeMask = 224

Properties

readonly char* root


Methods

void addObserver ( char* domain , nsIObserver observer , PRBool holdWeak ) void ClearUserPref ( char* prefName ) char* CopyCharPref ( char* pref ) char* CopyDefaultCharPref ( char* pref ) PRUnichar* CopyDefaultUnicharPref ( char* pref ) PRUnichar* CopyUnicharPref ( char* pref ) void DeleteBranch ( char* startingAt ) [noscript] void EnumerateChildren ( char* parent , PrefEnumerationFunc callback , voidPtr* data ) PRBool GetBoolPref ( char* prefName ) nsIPrefBranch getBranch ( char* prefRoot ) char* GetCharPref ( char* prefName ) void getChildList ( char* startingAt , out PRUint32 count , out arrayof char* childArray ) void getComplexValue ( char* prefName , nsIIDRef type , out nsQIResult* value ) PRBool GetDefaultBoolPref ( char* pref ) nsIPrefBranch getDefaultBranch ( char* prefRoot ) PRInt32 GetDefaultIntPref ( char* pref ) PRUnichar* getDefaultLocalizedUnicharPref ( char* pref ) nsIFileSpec GetFilePref ( char* pref ) nsILocalFile getFileXPref ( char* pref ) PRInt32 GetIntPref ( char* prefName ) PRUnichar* getLocalizedUnicharPref ( char* pref ) PRInt32 GetPrefType ( char* prefName ) void lockPref ( char* prefName ) PRBool PrefIsLocked ( char* prefName ) void readUserPrefs ( nsIFile file ) [noscript] void RegisterCallback ( char* domain , PrefChangedFunc callback , voidPtr* closure ) void removeObserver ( char* domain , nsIObserver observer ) void resetBranch ( char* startingAt ) void ResetPrefs ( ) void ResetUserPrefs ( ) void savePrefFile ( nsIFile file ) void SetBoolPref ( char* prefName , PRInt32 value ) void SetCharPref ( char* prefName , char* value ) void setComplexValue ( char* prefName , nsIIDRef type , nsISupports value ) void SetDefaultBoolPref ( char* pref , PRBool value ) void SetDefaultCharPref ( char* pref , char* value ) void SetDefaultIntPref ( char* pref , PRInt32 value ) void SetDefaultUnicharPref ( char* pref , PRUnichar* value ) void SetFilePref ( char* pref , nsIFileSpec value , PRBool setDefault ) void setFileXPref ( char* pref , nsILocalFile value ) void SetIntPref ( char* prefName , PRInt32 value ) void SetUnicharPref ( char* pref , PRUnichar* value ) void unlockPref ( char* prefName ) [noscript] void UnregisterCallback ( char* domain , PrefChangedFunc callback , voidPtr* closure )

void addObserver ( char* domain , nsIObserver observer , PRBool holdWeak )

Arguments:
domain
observer
holdWeak

void ClearUserPref ( char* prefName )

Arguments:
prefName

char* CopyCharPref ( char* pref )

Arguments:
pref

char* CopyDefaultCharPref ( char* pref )

Arguments:
pref

PRUnichar* CopyDefaultUnicharPref ( char* pref )

Arguments:
pref

PRUnichar* CopyUnicharPref ( char* pref )

Arguments:
pref

void DeleteBranch ( char* startingAt )

Arguments:
startingAt

void EnumerateChildren ( char* parent , PrefEnumerationFunc callback , voidPtr* data )

Call back function "callback" with every preference string having prefix "parent". Pass "data" to "callback" when calling.

Arguments:
parent: A string representation of a prefix of preferences
callback: A function to call back for each matching preference
data: A piece of data to pass on to the callback

PRBool GetBoolPref ( char* prefName )

Arguments:
prefName

nsIPrefBranch getBranch ( char* prefRoot )

Arguments:
prefRoot

char* GetCharPref ( char* prefName )

Arguments:
prefName

void getChildList ( char* startingAt , out PRUint32 count , out arrayof char* childArray )

Arguments:
startingAt
count
childArray

void getComplexValue ( char* prefName , nsIIDRef type , out nsQIResult* value )

Arguments:
prefName
type
value

PRBool GetDefaultBoolPref ( char* pref )

Arguments:
pref

nsIPrefBranch getDefaultBranch ( char* prefRoot )

Arguments:
prefRoot

PRInt32 GetDefaultIntPref ( char* pref )

Arguments:
pref

PRUnichar* getDefaultLocalizedUnicharPref ( char* pref )

Arguments:
pref

nsIFileSpec GetFilePref ( char* pref )

Arguments:
pref

nsILocalFile getFileXPref ( char* pref )

Arguments:
pref

PRInt32 GetIntPref ( char* prefName )

Arguments:
prefName

PRUnichar* getLocalizedUnicharPref ( char* pref )

Arguments:
pref

PRInt32 GetPrefType ( char* prefName )

Arguments:
prefName

void lockPref ( char* prefName )

Arguments:
prefName

PRBool PrefIsLocked ( char* prefName )

Arguments:
prefName

void readUserPrefs ( nsIFile file )

Arguments:
file

void RegisterCallback ( char* domain , PrefChangedFunc callback , voidPtr* closure )

Arguments:
domain
callback
closure

void removeObserver ( char* domain , nsIObserver observer )

Arguments:
domain
observer

void resetBranch ( char* startingAt )

Arguments:
startingAt

void ResetPrefs ( )


void ResetUserPrefs ( )


void savePrefFile ( nsIFile file )

Arguments:
file

void SetBoolPref ( char* prefName , PRInt32 value )

Arguments:
prefName
value

void SetCharPref ( char* prefName , char* value )

Arguments:
prefName
value

void setComplexValue ( char* prefName , nsIIDRef type , nsISupports value )

Arguments:
prefName
type
value

void SetDefaultBoolPref ( char* pref , PRBool value )

Arguments:
pref
value

void SetDefaultCharPref ( char* pref , char* value )

Arguments:
pref
value

void SetDefaultIntPref ( char* pref , PRInt32 value )

Arguments:
pref
value

void SetDefaultUnicharPref ( char* pref , PRUnichar* value )

Arguments:
pref
value

void SetFilePref ( char* pref , nsIFileSpec value , PRBool setDefault )

Arguments:
pref
value
setDefault

void setFileXPref ( char* pref , nsILocalFile value )

Arguments:
pref
value

void SetIntPref ( char* prefName , PRInt32 value )

Arguments:
prefName
value

void SetUnicharPref ( char* pref , PRUnichar* value )

Arguments:
pref
value

void unlockPref ( char* prefName )

Arguments:
prefName

void UnregisterCallback ( char* domain , PrefChangedFunc callback , voidPtr* closure )

Arguments:
domain
callback
closure

Reference documentation is generated from Mozilla's source.

Add a note User Contributed Notes
January 27, 2005, 1:21 am jwalden at mit dot edu
Use of nsIPref is deprecated, so it is recommended that you use nsIPrefService or nsIPrefBranch instead. Another option is nsIPrefBranchInternal if you need to implement a prefs observer, although it should be noted this interface, in contrast to the previous two mentioned, is not frozen and may change beneath you.

Copyright © 1999 - 2005 XULPlanet.com