michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 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: #include "mozIStorageValueArray.idl" michael@0: michael@0: interface mozIStorageConnection; michael@0: interface nsIArray; michael@0: interface nsIVariant; michael@0: michael@0: /** michael@0: * mozIStorageFunction is to be implemented by storage consumers that michael@0: * wish to receive callbacks during the request execution. michael@0: * michael@0: * SQL can apply functions to values from tables. Examples of michael@0: * such functions are MIN(a1,a2) or SQRT(num). Many functions are michael@0: * implemented in SQL engine. michael@0: * michael@0: * This interface allows consumers to implement their own, michael@0: * problem-specific functions. michael@0: * These functions can be called from triggers, too. michael@0: * michael@0: */ michael@0: [scriptable, function, uuid(9ff02465-21cb-49f3-b975-7d5b38ceec73)] michael@0: interface mozIStorageFunction : nsISupports { michael@0: /** michael@0: * onFunctionCall is called when execution of a custom michael@0: * function should occur. michael@0: * michael@0: * @param aNumArguments The number of arguments michael@0: * @param aFunctionArguments The arguments passed in to the function michael@0: * michael@0: * @returns any value as Variant type. michael@0: */ michael@0: michael@0: nsIVariant onFunctionCall(in mozIStorageValueArray aFunctionArguments); michael@0: };