diff options
author | Moonchild <mcwerewolf@wolfbeast.com> | 2019-03-24 11:54:50 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-24 11:54:50 +0100 |
commit | 834ea744c2bf56d951c0134f6043f692b28c36ef (patch) | |
tree | f6cd6725c44d0ad3cd550a73cbbff969bb058eb9 /modules/libpref/nsIPrefBranch.idl | |
parent | 9fc25801fdae8a88e2baa68bb500b24e53d9d8bf (diff) | |
parent | cac3f9678de46298a93537e8913912bba28d89f7 (diff) | |
download | UXP-834ea744c2bf56d951c0134f6043f692b28c36ef.tar UXP-834ea744c2bf56d951c0134f6043f692b28c36ef.tar.gz UXP-834ea744c2bf56d951c0134f6043f692b28c36ef.tar.lz UXP-834ea744c2bf56d951c0134f6043f692b28c36ef.tar.xz UXP-834ea744c2bf56d951c0134f6043f692b28c36ef.zip |
Merge pull request #1021 from Ascrod/default-pref
Bug 1338306 - nsIPrefBranch.get*Pref should support providing a default value
Diffstat (limited to 'modules/libpref/nsIPrefBranch.idl')
-rw-r--r-- | modules/libpref/nsIPrefBranch.idl | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/modules/libpref/nsIPrefBranch.idl b/modules/libpref/nsIPrefBranch.idl index ee0c11ef0..900806b42 100644 --- a/modules/libpref/nsIPrefBranch.idl +++ b/modules/libpref/nsIPrefBranch.idl @@ -57,12 +57,16 @@ interface nsIPrefBranch : nsISupports * Called to get the state of an individual boolean preference. * * @param aPrefName The boolean preference to get the state of. + * @param aDefaultValue The value to return if the preference is not set. * * @return boolean The value of the requested boolean preference. * * @see setBoolPref */ - boolean getBoolPref(in string aPrefName); + [optional_argc,binaryname(GetBoolPrefWithDefault)] + boolean getBoolPref(in string aPrefName, [optional] in boolean aDefaultValue); + [noscript,binaryname(GetBoolPref)] + boolean getBoolPrefXPCOM(in string aPrefName); /** * Called to set the state of an individual boolean preference. @@ -83,23 +87,31 @@ interface nsIPrefBranch : nsISupports * are converted to floating point numbers. * * @param aPrefName The floating point preference to get the state of. + * @param aDefaultValue The value to return if the preference is not set. * * @return float The value of the requested floating point preference. * * @see setCharPref */ - float getFloatPref(in string aPrefName); + [optional_argc,binaryname(GetFloatPrefWithDefault)] + float getFloatPref(in string aPrefName, [optional] in float aDefaultValue); + [noscript,binaryname(GetFloatPref)] + float getFloatPrefXPCOM(in string aPrefName); /** * Called to get the state of an individual string preference. * * @param aPrefName The string preference to retrieve. + * @param aDefaultValue The string to return if the preference is not set. * * @return string The value of the requested string preference. * * @see setCharPref */ - string getCharPref(in string aPrefName); + [optional_argc,binaryname(GetCharPrefWithDefault)] + string getCharPref(in string aPrefName, [optional] in string aDefaultValue); + [noscript,binaryname(GetCharPref)] + string getCharPrefXPCOM(in string aPrefName); /** * Called to set the state of an individual string preference. @@ -118,12 +130,16 @@ interface nsIPrefBranch : nsISupports * Called to get the state of an individual integer preference. * * @param aPrefName The integer preference to get the value of. + * @param aDefaultValue The value to return if the preference is not set. * * @return long The value of the requested integer preference. * * @see setIntPref */ - long getIntPref(in string aPrefName); + [optional_argc,binaryname(GetIntPrefWithDefault)] + long getIntPref(in string aPrefName, [optional] in long aDefaultValue); + [noscript,binaryname(GetIntPref)] + long getIntPrefXPCOM(in string aPrefName); /** * Called to set the state of an individual integer preference. |