PageRenderTime 4ms CodeModel.GetById 1ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/parser/htmlparser/public/nsIExpatSink.idl

http://github.com/zpao/v8monkey
IDL | 145 lines | 30 code | 11 blank | 104 comment | 0 complexity | 437a10716b1a57497309351d3ff74aca MD5 | raw file
  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
  4 *
  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/
  9 *
 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.
 14 *
 15 * The Original Code is mozilla.org code.
 16 *
 17 * The Initial Developer of the Original Code is
 18 * Netscape Communications Corporation.
 19 * Portions created by the Initial Developer are Copyright (C) 1998
 20 * the Initial Developer. All Rights Reserved.
 21 *
 22 * Contributor(s):
 23 *
 24 * Alternatively, the contents of this file may be used under the terms of
 25 * either of the GNU General Public License Version 2 or later (the "GPL"),
 26 * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 27 * in which case the provisions of the GPL or the LGPL are applicable instead
 28 * of those above. If you wish to allow use of your version of this file only
 29 * under the terms of either the GPL or the LGPL, and not to allow others to
 30 * use your version of this file under the terms of the MPL, indicate your
 31 * decision by deleting the provisions above and replace them with the notice
 32 * and other provisions required by the GPL or the LGPL. If you do not delete
 33 * the provisions above, a recipient may use your version of this file under
 34 * the terms of any one of the MPL, the GPL or the LGPL.
 35 *
 36 * ***** END LICENSE BLOCK ***** */
 37
 38#include "nsISupports.idl"
 39interface nsIScriptError;
 40
 41/**
 42 * This interface should be implemented by any content sink that wants
 43 * to get output from expat and do something with it; in other words,
 44 * by any sink that handles some sort of XML dialect.
 45 */
 46
 47[scriptable, uuid(f61c56b5-ea5b-42b4-ad3c-17416e72e238)]
 48interface nsIExpatSink : nsISupports 
 49{
 50  /**
 51   * Called to handle the opening tag of an element.
 52   * @param aName the fully qualified tagname of the element
 53   * @param aAtts the array of attribute names and values.  There are
 54   *        aAttsCount/2 names and aAttsCount/2 values, so the total number of
 55   *        elements in the array is aAttsCount.  The names and values
 56   *        alternate.  Thus, if we number attributes starting with 0,
 57   *        aAtts[2*k] is the name of the k-th attribute and aAtts[2*k+1] is
 58   *        the value of that attribute  Both explicitly specified attributes
 59   *        and attributes that are defined to have default values in a DTD are
 60   *        present in aAtts.
 61   * @param aAttsCount the number of elements in aAtts.
 62   * @param aIndex If the element has an attribute of type ID, then
 63   *        aAtts[aIndex] is the name of that attribute.  Otherwise, aIndex
 64   *        is -1
 65   * @param aLineNumber the line number of the start tag in the data stream.
 66   */
 67  void HandleStartElement(in wstring aName,
 68                          [array, size_is(aAttsCount)] in wstring aAtts,
 69                          in unsigned long aAttsCount,
 70                          in long aIndex,
 71                          in unsigned long aLineNumber);
 72
 73  /**
 74   * Called to handle the closing tag of an element.
 75   * @param aName the fully qualified tagname of the element
 76   */
 77  void HandleEndElement(in wstring aName);
 78
 79  /**
 80   * Called to handle a comment
 81   * @param aCommentText the text of the comment (not including the
 82   *        "<!--" and "-->")
 83   */ 
 84  void HandleComment(in wstring aCommentText);
 85
 86  /**
 87   * Called to handle a CDATA section
 88   * @param aData the text in the CDATA section.  This is null-terminated.
 89   * @param aLength the length of the aData string
 90   */
 91  void HandleCDataSection([size_is(aLength)] in wstring aData, 
 92                          in unsigned long aLength);
 93
 94  /**
 95   * Called to handle the doctype declaration
 96   */
 97  void HandleDoctypeDecl(in AString aSubset,
 98                         in AString aName,
 99                         in AString aSystemId,
100                         in AString aPublicId,
101                         in nsISupports aCatalogData);
102
103  /**
104   * Called to handle character data.  Note that this does NOT get
105   * called for the contents of CDATA sections.
106   * @param aData the data to handle.  aData is NOT NULL-TERMINATED.
107   * @param aLength the length of the aData string
108   */
109  void HandleCharacterData([size_is(aLength)] in wstring aData, 
110                           in unsigned long aLength);
111
112  /**
113   * Called to handle a processing instruction
114   * @param aTarget the PI target (e.g. xml-stylesheet)
115   * @param aData all the rest of the data in the PI
116   */
117  void HandleProcessingInstruction(in wstring aTarget, 
118                                   in wstring aData);
119
120  /**
121   * Handle the XML Declaration.
122   *
123   * @param aVersion    The version string, can be null if not specified.
124   * @param aEncoding   The encoding string, can be null if not specified.
125   * @param aStandalone -1, 0, or 1 indicating respectively that there was no
126   *                    standalone parameter in the declaration, that it was
127   *                    given as no, or that it was given as yes.
128   */
129  void HandleXMLDeclaration(in wstring aVersion,
130                            in wstring aEncoding,
131                            in long aStandalone);
132
133  /**
134   * Ask the content sink if the expat driver should log an error to the console.
135   *
136   * @param aErrorText  Error message to pass to content sink.
137   * @param aSourceText Source text of the document we're parsing.
138   * @param aError      Script error object with line number & column number
139   *
140   * @retval True if the expat driver should report the error.
141   */
142  boolean ReportError(in wstring aErrorText,
143                      in wstring aSourceText,
144                      in nsIScriptError aError);
145};