Bug 470455 - test_database_sync_embed_visits.js leaks, r=sdwilsh
[wine-gecko.git] / content / xul / templates / public / nsIXULTemplateResult.idl
blobc6bbb1f5df3a1237c44a7352034313e4829234ce
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
13 * License.
15 * The Original Code is mozilla.org code.
17 * The Initial Developer of the Original Code is Neil Deakin.
18 * Portions created by the Initial Developer are Copyright (C) 2005
19 * the Initial Developer. All Rights Reserved.
21 * Contributor(s):
23 * Alternatively, the contents of this file may be used under the terms of
24 * either of the GNU General Public License Version 2 or later (the "GPL"),
25 * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
26 * in which case the provisions of the GPL or the LGPL are applicable instead
27 * of those above. If you wish to allow use of your version of this file only
28 * under the terms of either the GPL or the LGPL, and not to allow others to
29 * use your version of this file under the terms of the MPL, indicate your
30 * decision by deleting the provisions above and replace them with the notice
31 * and other provisions required by the GPL or the LGPL. If you do not delete
32 * the provisions above, a recipient may use your version of this file under
33 * the terms of any one of the MPL, the GPL or the LGPL.
35 * ***** END LICENSE BLOCK ***** */
37 #include "nsISupports.idl"
39 interface nsIAtom;
40 interface nsIDOMNode;
41 interface nsIRDFResource;
43 /**
44 * A single result generated from a template query. Each result is identified
45 * by an id, which must be unique within the set of results produced from a
46 * query. The result may optionally be identified by an RDF resource.
48 * Generally, the result and its id will be able to uniquely identify a node
49 * in the source data, such as an RDF or XML node. In other contexts, such as
50 * a database query, a result would represent a particular record.
52 * A result is expected to only be created by a query processor.
54 * Each result also contains a set of variable bindings. The value for a
55 * particular variable may be retrieved using the getBindingFor and
56 * getBindingObjectFor methods.
58 [scriptable, uuid(ebea0230-36fa-41b7-8e31-760806057965)]
59 interface nsIXULTemplateResult : nsISupports
61 /**
62 * True if the result represents a container.
64 readonly attribute boolean isContainer;
66 /**
67 * True if the result represents an empty container.
69 readonly attribute boolean isEmpty;
71 /**
72 * True if the template builder may use this result as the reference point
73 * for additional recursive processing of the template. The template builder
74 * will reprocess the template using this result as the reference point and
75 * generate output content that is expected to be inserted as children of the
76 * output generated for this result. If false, child content is not
77 * processed. This property identifies only the default handling and may be
78 * overriden by syntax used in the template.
80 readonly attribute boolean mayProcessChildren;
82 /**
83 * ID of the result. The DOM element created for this result, if any, will
84 * have its id attribute set to this value. The id must be unique for a
85 * query.
87 readonly attribute AString id;
89 /**
90 * Resource for the result, which may be null. If set, the resource uri
91 * must be the same as the ID property.
93 readonly attribute nsIRDFResource resource;
95 /**
96 * The type of the object. The predefined value 'separator' may be used
97 * for separators. Other values may be used for application specific
98 * purposes.
100 readonly attribute AString type;
103 * Get the string representation of the value of a variable for this
104 * result. This string will be used in the action body from a template as
105 * the replacement text. For instance, if the text ?name appears in an
106 * attribute within the action body, it will be replaced with the result
107 * of this method. The question mark is considered part of the variable
108 * name, thus aVar should be ?name and not simply name.
110 * @param aVar the variable to look up
112 * @return the value for the variable or a null string if it has no value
114 AString getBindingFor(in nsIAtom aVar);
117 * Get an object value for a variable such as ?name for this result.
119 * This method may return null for a variable, even if getBindingFor returns
120 * a non-null value for the same variable. This method is provided as a
121 * convenience when sorting results.
123 * @param aVar the variable to look up
125 * @return the value for the variable or null if it has no value
127 nsISupports getBindingObjectFor(in nsIAtom aVar);
130 * Indicate that a particular rule of a query has matched and that output
131 * will be generated for it. Both the query as compiled by the query
132 * processor's compileQuery method and the XUL <rule> element are supplied.
133 * The query must always be one that was compiled by the query processor
134 * that created this result. The <rule> element must always be a child of
135 * the <query> element that was used to compile the query.
137 * @param aQuery the query that matched
138 * @param aRuleNode the rule node that matched
140 void ruleMatched(in nsISupports aQuery, in nsIDOMNode aRuleNode);
143 * Indicate that the output for a result has beeen removed and that the
144 * result is no longer being used by the builder.
146 void hasBeenRemoved();