diff options
author | Florian Quèze <florian@queze.net> | 2019-03-23 10:02:03 -0400 |
---|---|---|
committer | Ascrod <32915892+Ascrod@users.noreply.github.com> | 2019-03-23 19:35:32 -0400 |
commit | cac3f9678de46298a93537e8913912bba28d89f7 (patch) | |
tree | f6cd6725c44d0ad3cd550a73cbbff969bb058eb9 /modules/libpref/nsIPrefBranch.idl | |
parent | 9fc25801fdae8a88e2baa68bb500b24e53d9d8bf (diff) | |
download | UXP-cac3f9678de46298a93537e8913912bba28d89f7.tar UXP-cac3f9678de46298a93537e8913912bba28d89f7.tar.gz UXP-cac3f9678de46298a93537e8913912bba28d89f7.tar.lz UXP-cac3f9678de46298a93537e8913912bba28d89f7.tar.xz UXP-cac3f9678de46298a93537e8913912bba28d89f7.zip |
Bug 1338306 - nsIPrefBranch.get*Pref should support providing a default value, r=bsmedberg.
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. |