mozilla

Revision 125464 of extIPreference

  • Revision slug: Toolkit_API/extIPreference
  • Revision title: extIPreference
  • Revision id: 125464
  • Created:
  • Creator: Clarkbw
  • Is current revision? No
  • Comment add note about exception; 30 words added

Revision Content

{{ Fx_minversion_header("3") }}

{{ tb_minversion_header("3") }}

The extIPreference interface accesses a single preference. The data is not cached. All reads access the current state of the preference. extIPreference is defined in {{ source("toolkit/components/exthelper/extIApplication.idl") }}.

Implemented via XPCOM service for extIApplication: see the instructions on the FUEL (Firefox), STEEL (Thunderbird) and SMILE (SeaMonkey) pages.

Method overview

void reset()

Attributes

Attribute Type Description
name readonly attribute AString The name of the preference.
type readonly attribute AString A string representing the type of preference (String, Boolean, or Number).
value attribute nsIVariant Get/Set the value of the preference.
locked attribute boolean Get the locked state of the preference. Set to a boolean value to (un)lock it.
modified readonly attribute boolean Check if a preference has been modified by the user, or not.
branch readonly attribute extIPreferenceBranch The preference branch that contains this preference.
events readonly attribute extIEvents The events object for this preference. supports: "change"

Methods

reset()

Resets a preference back to its default values. 

This will raise an exception if the preference doesn't exist or is the default value.  You should wrap this call in a try/catch block.

void reset()
Parameters
Return value

See also

 FUEL (Firefox), STEEL (Thunderbird) and SMILE (SeaMonkey)

{{ languages( { "es": "es/FUEL/Preference", "fr": "fr/FUEL/Preference", "ja": "ja/FUEL/Preference" } ) }}

Revision Source

<p>{{ Fx_minversion_header("3") }}</p>
<p>{{ tb_minversion_header("3") }}</p>
<p>The <code>extIPreference</code> interface accesses a single preference. The data is not cached. All reads access the current state of the preference. <code>extIPreference</code> is defined in {{ source("toolkit/components/exthelper/extIApplication.idl") }}.</p>
<p>Implemented via XPCOM service for <a class="internal" href="/en/Toolkit_API/extIApplication" title="en/Toolkit API/extIApplication"><code>extIApplication</code></a>: see the instructions on the <a class="internal" href="/en/FUEL" title="en/FUEL">FUEL</a> (Firefox), <a class="internal" href="/en/Thunderbird/STEEL" title="en/Thunderbird/STEEL">STEEL</a> (Thunderbird) and <a class="internal" href="/en/SeaMonkey/SMILE" title="en/SeaMonkey/SMILE">SMILE</a> (SeaMonkey) pages.</p>
<h2 name="Method_overview">Method overview</h2>
<table class="standard-table"> <tbody> <tr> <td><code>void <a href="#reset.28.29">reset</a>()</code></td> </tr> </tbody>
</table>
<h2 name="Attributes">Attributes</h2>
<table class="standard-table"> <tbody> <tr> <td class="header">Attribute</td> <td class="header">Type</td> <td class="header">Description</td> </tr> <tr> <td><code>name</code></td> <td><code>readonly attribute AString</code></td> <td>The name of the preference.</td> </tr> <tr> <td><code>type</code></td> <td><code>readonly attribute AString</code></td> <td>A string representing the type of preference (String, Boolean, or Number).</td> </tr> <tr> <td><code>value</code></td> <td><code>attribute nsIVariant</code></td> <td>Get/Set the value of the preference.</td> </tr> <tr> <td><code>locked</code></td> <td><code>attribute boolean</code></td> <td>Get the locked state of the preference. Set to a boolean value to (un)lock it.</td> </tr> <tr> <td><code>modified</code></td> <td><code>readonly attribute boolean</code></td> <td>Check if a preference has been modified by the user, or not.</td> </tr> <tr> <td><code>branch</code></td> <td><code>readonly attribute <a href="/en/Toolkit_API/extIPreferenceBranch" title="en/FUEL/PreferenceBranch">extIPreferenceBranch</a></code></td> <td>The preference branch that contains this preference.</td> </tr> <tr> <td><code>events</code></td> <td><code>readonly attribute <a href="/en/Toolkit_API/extIEvents" title="en/FUEL/Events">extIEvents</a></code></td> <td>The events object for this preference. supports: "change"</td> </tr> </tbody>
</table>
<h2 name="Methods">Methods</h2>
<h3 name="reset.28.29">reset()</h3>
<p>Resets a preference back to its default values.  </p>
<p>This will raise an exception if the preference doesn't exist or is the default value.  You should wrap this call in a try/catch block.</p>
<pre class="eval">void reset()
</pre>
<h6 name="Parameters">Parameters</h6>
<h6 name="Return_value">Return value</h6>
<h2 name="See_also">See also</h2>
<p> <a class="internal" href="/en/FUEL" title="en/FUEL">FUEL</a> (Firefox), <a class="internal" href="/en/Thunderbird/STEEL" title="en/Thunderbird/STEEL">STEEL</a> (Thunderbird) and <a class="internal" href="/en/SeaMonkey/SMILE" title="en/SeaMonkey/SMILE">SMILE</a> (SeaMonkey)</p>
<p>{{ languages( { "es": "es/FUEL/Preference", "fr": "fr/FUEL/Preference", "ja": "ja/FUEL/Preference" } ) }}</p>
Revert to this revision