/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is mozilla.org code. * * The Initial Developer of the Original Code is Neil Deakin. * Portions created by the Initial Developer are Copyright (C) 2005 * the Initial Developer. All Rights Reserved. * * Contributor(s): * Laurent Jouanneau * * Alternatively, the contents of this file may be used under the terms of * either of the GNU General Public License Version 2 or later (the "GPL"), * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ #include "domstubs.idl" #include "nsISupports.idl" interface nsIAtom; interface nsIArray; interface nsISimpleEnumerator; interface nsIXULTemplateResult; interface nsIXULTemplateRuleFilter; interface nsIXULTemplateBuilder; /** * A query processor takes a template query and generates results for it given * a datasource and a reference point. There is a one-to-one relationship * between a template builder and a query processor. The template builder * creates the query processor, and there is no other means to retrieve it. * * A template query is the contents inside a element within the * template. The actual syntax is opaque to the template builder and defined * by a query processor. The query is expected to consist of either text or * DOM nodes that, when executed by a call to the generateResults method, will * allow the generation of a list of results. * * The template builder will supply two variables, the reference variable and * the member variable to further indicate what part of the datasource is to * be examined in addition to the query itself. The reference is always * a placeholder for the starting point and the member is always a placeholder * for the end points (the results). * * The reference point is important when generating output recursively, as * the query will be the same for each iteration, however, the reference point * will differ. * * For instance, when examining an XML source, an XML query processor might * begin at the node referred by the reference variable and end at a list of * that node's children. * * Some queries may not need the reference variable if the syntax or the form * of the data implies the value. For instance, a datasource that holds a * table that can only produce one set of results. * * The reference variable may be specified in a template by setting the * "container" attribute on the