1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/storage/public/mozIStorageFunction.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,40 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#include "nsISupports.idl" 1.10 + 1.11 +#include "mozIStorageValueArray.idl" 1.12 + 1.13 +interface mozIStorageConnection; 1.14 +interface nsIArray; 1.15 +interface nsIVariant; 1.16 + 1.17 +/** 1.18 + * mozIStorageFunction is to be implemented by storage consumers that 1.19 + * wish to receive callbacks during the request execution. 1.20 + * 1.21 + * SQL can apply functions to values from tables. Examples of 1.22 + * such functions are MIN(a1,a2) or SQRT(num). Many functions are 1.23 + * implemented in SQL engine. 1.24 + * 1.25 + * This interface allows consumers to implement their own, 1.26 + * problem-specific functions. 1.27 + * These functions can be called from triggers, too. 1.28 + * 1.29 + */ 1.30 +[scriptable, function, uuid(9ff02465-21cb-49f3-b975-7d5b38ceec73)] 1.31 +interface mozIStorageFunction : nsISupports { 1.32 + /** 1.33 + * onFunctionCall is called when execution of a custom 1.34 + * function should occur. 1.35 + * 1.36 + * @param aNumArguments The number of arguments 1.37 + * @param aFunctionArguments The arguments passed in to the function 1.38 + * 1.39 + * @returns any value as Variant type. 1.40 + */ 1.41 + 1.42 + nsIVariant onFunctionCall(in mozIStorageValueArray aFunctionArguments); 1.43 +};