storage/public/mozIStorageStatementCallback.idl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/storage/public/mozIStorageStatementCallback.idl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,48 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
     1.5 + * vim: sw=2 ts=2 sts=2 expandtab 
     1.6 + * This Source Code Form is subject to the terms of the Mozilla Public
     1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.9 +
    1.10 +#include "nsISupports.idl"
    1.11 +
    1.12 +interface mozIStorageResultSet;
    1.13 +interface mozIStorageError;
    1.14 +
    1.15 +[scriptable, uuid(29383d00-d8c4-4ddd-9f8b-c2feb0f2fcfa)]
    1.16 +interface mozIStorageStatementCallback : nsISupports {
    1.17 +
    1.18 +  /**
    1.19 +   * Called when some result is obtained from the database.  This function can
    1.20 +   * be called more than once with a different storageIResultSet each time for
    1.21 +   * any given asynchronous statement.
    1.22 +   *
    1.23 +   * @param aResultSet
    1.24 +   *        The result set containing the data from the database.
    1.25 +   */
    1.26 +  void handleResult(in mozIStorageResultSet aResultSet);
    1.27 +
    1.28 +  /**
    1.29 +   * Called when some error occurs while executing the statement.  This function
    1.30 +   * may be called more than once with a different storageIError each time for
    1.31 +   * any given asynchronous statement.
    1.32 +   *
    1.33 +   * @param aError
    1.34 +   *        An object containing information about the error.
    1.35 +   */
    1.36 +  void handleError(in mozIStorageError aError);
    1.37 +
    1.38 +  /**
    1.39 +   * Called when the statement has finished executing.  This function will only
    1.40 +   * be called once for any given asynchronous statement.
    1.41 +   *
    1.42 +   * @param aReason
    1.43 +   *        Indicates if the statement is no longer executing because it either
    1.44 +   *        finished (REASON_FINISHED), was canceled (REASON_CANCELED), or
    1.45 +   *        a fatal error occurred (REASON_ERROR).
    1.46 +   */
    1.47 +  const unsigned short REASON_FINISHED = 0;
    1.48 +  const unsigned short REASON_CANCELED = 1;
    1.49 +  const unsigned short REASON_ERROR = 2;
    1.50 +  void handleCompletion(in unsigned short aReason);
    1.51 +};

mercurial