storage/public/mozIStorageAggregateFunction.idl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/storage/public/mozIStorageAggregateFunction.idl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,38 @@
     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 +interface mozIStorageConnection;
    1.12 +interface mozIStorageValueArray;
    1.13 +interface nsIArray;
    1.14 +interface nsIVariant;
    1.15 +
    1.16 +/**
    1.17 + * mozIStorageAggregateFunction represents aggregate SQL function.
    1.18 + * Common examples of aggregate functions are SUM() and COUNT().
    1.19 + *
    1.20 + * An aggregate function calculates one result for a given set of data, where
    1.21 + * a set of data is a group of tuples. There can be one group
    1.22 + * per request or many of them, if GROUP BY clause is used or not.
    1.23 + */
    1.24 +[scriptable, uuid(763217b7-3123-11da-918d-000347412e16)]
    1.25 +interface mozIStorageAggregateFunction : nsISupports {
    1.26 +  /**
    1.27 +   * onStep is called when next value should be passed to
    1.28 +   * a custom function.
    1.29 +   * 
    1.30 +   * @param aFunctionArguments    The arguments passed in to the function
    1.31 +   */
    1.32 +  void onStep(in mozIStorageValueArray aFunctionArguments);
    1.33 +
    1.34 +  /**
    1.35 +   * Called when all tuples in a group have been processed and the engine
    1.36 +   * needs the aggregate function's value.
    1.37 +   *
    1.38 +   * @returns aggregate result as Variant.
    1.39 +   */
    1.40 +  nsIVariant onFinal();
    1.41 +};

mercurial