michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- michael@0: * vim: sw=2 ts=2 sts=2 expandtab michael@0: * This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsISupports.idl" michael@0: michael@0: interface mozIStorageResultSet; michael@0: interface mozIStorageError; michael@0: michael@0: [scriptable, uuid(29383d00-d8c4-4ddd-9f8b-c2feb0f2fcfa)] michael@0: interface mozIStorageStatementCallback : nsISupports { michael@0: michael@0: /** michael@0: * Called when some result is obtained from the database. This function can michael@0: * be called more than once with a different storageIResultSet each time for michael@0: * any given asynchronous statement. michael@0: * michael@0: * @param aResultSet michael@0: * The result set containing the data from the database. michael@0: */ michael@0: void handleResult(in mozIStorageResultSet aResultSet); michael@0: michael@0: /** michael@0: * Called when some error occurs while executing the statement. This function michael@0: * may be called more than once with a different storageIError each time for michael@0: * any given asynchronous statement. michael@0: * michael@0: * @param aError michael@0: * An object containing information about the error. michael@0: */ michael@0: void handleError(in mozIStorageError aError); michael@0: michael@0: /** michael@0: * Called when the statement has finished executing. This function will only michael@0: * be called once for any given asynchronous statement. michael@0: * michael@0: * @param aReason michael@0: * Indicates if the statement is no longer executing because it either michael@0: * finished (REASON_FINISHED), was canceled (REASON_CANCELED), or michael@0: * a fatal error occurred (REASON_ERROR). michael@0: */ michael@0: const unsigned short REASON_FINISHED = 0; michael@0: const unsigned short REASON_CANCELED = 1; michael@0: const unsigned short REASON_ERROR = 2; michael@0: void handleCompletion(in unsigned short aReason); michael@0: };