mozilla

Revision 126212 of mozIStorageStatementCallback

  • Revision slug: MozIStorageStatementCallback
  • Revision title: MozIStorageStatementCallback
  • Revision id: 126212
  • Created:
  • Creator: Sheppy
  • Is current revision? No
  • Comment no wording changes

Revision Content

{{ fx_minversion_header("3") }}

The mozIStorageStatementCallback interface represents a callback handler that the Storage API calls with result, error, and completion notifications while handling asynchronous database queries.

{{ InterfaceStatus("mozIStorageStatementCallback", "storage/public/mozIStorageStatementCallback.idl", "unfrozen", "Mozilla 1.9.1", "yes") }}

Inherits from: {{ Interface("nsISupports") }}

Method overview

void handleCompletion(in unsigned short aReason);
void handleError(in {{ interface("mozIStorageError") }} aError);
void handleResult(in {{template.interface("mozIStorageResultSet")}} aResultSet);

Constants

Constant Value Description
REASON_FINISHED 0 The statement has finished executing normally.
REASON_CANCELED 1 The statement stopped executing because it was canceled.
REASON_ERROR 2 The statement stopped executing because an error occurred.

Methods

handleCompletion()

Called when a statement finishes executing.

 void handleCompletion(
   in unsigned short aReason
 );
Parameters
aReason
The reason the statement stopped executing; see the list of possible values in the {{ anch("Constants") }} section.

handleError()

Called when an error occurs while executing a statement.

 void handleError(
   in mozIStorageError aError
 );
Parameters
aError
A {{ interface("mozIStorageError") }} object describing the error that occurred.

handleResult()

Called when results from the statement are available.

 void handleResult(
   in mozIStorageResultSet aResultSet
 );
Parameters
aResultSet
An {{ interface("mozIStorageResultSet") }} object describing the available results from the statement's execution.

See also

  • Storage
  • {{ interface("mozIStorageStatement") }}

Revision Source

<p>{{ fx_minversion_header("3") }}</p>
<p>The <code>mozIStorageStatementCallback</code> interface represents a callback handler that the <a class="internal" href="/En/Storage" title="En/Storage">Storage API</a> calls with result, error, and completion notifications while handling asynchronous database queries.</p>
<p>{{ InterfaceStatus("mozIStorageStatementCallback", "storage/public/mozIStorageStatementCallback.idl", "unfrozen", "Mozilla 1.9.1", "yes") }}</p>
<p>Inherits from: {{ Interface("nsISupports") }}</p>
<h2 name="Method_overview">Method overview</h2>
<table class="standard-table"> <tbody> <tr> <td><code>void handleCompletion(in unsigned short aReason);<br> </code></td> </tr> <tr> <td><code>void handleError(in {{ interface("mozIStorageError") }} aError);<br> </code></td> </tr> <tr> <td><code>void handleResult(in {{template.interface("</code><code>mozIStorageResultSet")}} aResultSet);<br> </code></td> </tr> </tbody>
</table><h2>Constants</h2>
<table class="standard-table"> <tbody> <tr> <td class="header">Constant</td> <td class="header">Value</td> <td class="header">Description</td> </tr> <tr> <td><code>REASON_FINISHED</code></td> <td>0</td> <td>The statement has finished executing normally.</td> </tr> <tr> <td><code>REASON_CANCELED</code></td> <td>1</td> <td>The statement stopped executing because it was canceled.</td> </tr> <tr> <td><code>REASON_ERROR</code></td> <td>2</td> <td>The statement stopped executing because an error occurred.</td> </tr> </tbody>
</table>
<h2 name="Methods">Methods</h2>
<h3 name="eatCookie.28.29">handleCompletion()</h3>
<p>Called when a statement finishes executing.</p>
<pre class="eval"> void handleCompletion(
   in unsigned short aReason
 );
</pre>
<h6 name="Parameters">Parameters</h6>
<dl><dt><code>aReason</code> </dt><dd>The reason the statement stopped executing; see the list of possible values in the {{ anch("Constants") }} section. </dd></dl>
<h3 name="eatCookie.28.29">handleError()</h3>
<p>Called when an error occurs while executing a statement.</p>
<pre class="eval"> void handleError(
   in mozIStorageError aError
 );
</pre>
<h6 name="Parameters">Parameters</h6>
<dl><dt><code>aError</code> </dt><dd>A {{ interface("mozIStorageError") }} object describing the error that occurred. </dd></dl>
<h3 name="eatCookie.28.29">handleResult()</h3>
<p>Called when results from the statement are available.</p>
<pre class="eval"> void handleResult(
   in mozIStorageResultSet aResultSet
 );
</pre>
<h6 name="Parameters">Parameters</h6>
<dl><dt><code>aResultSet</code> </dt><dd>An {{ interface("mozIStorageResultSet") }} object describing the available results from the statement's execution. </dd></dl>
<h2>See also</h2>
<ul> <li>Storage</li> <li>{{ interface("mozIStorageStatement") }}</li>
</ul>
Revert to this revision