michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsISupports.idl" michael@0: michael@0: /** michael@0: * Interface for associating a SAX event with a document location. michael@0: * michael@0: * Note that the results returned by the object will be valid only michael@0: * during the scope of each callback method: the application will michael@0: * receive unpredictable results if it attempts to use the locator at michael@0: * any other time, or after parsing completes. michael@0: */ michael@0: [scriptable, uuid(7a307c6c-6cc9-11da-be43-001422106990)] michael@0: interface nsISAXLocator: nsISupports { michael@0: michael@0: /** michael@0: * Return the column number where the current document event ends. michael@0: * michael@0: * Warning: The return value from the method is intended only as an michael@0: * approximation for the sake of diagnostics; it is not intended to michael@0: * provide sufficient information to edit the character content of michael@0: * the original XML document. For example, when lines contain michael@0: * combining character sequences, wide characters, surrogate pairs, michael@0: * or bi-directional text, the value may not correspond to the michael@0: * column in a text editor's display. michael@0: * michael@0: * The return value is an approximation of the column number in the michael@0: * document entity or external parsed entity where the markup michael@0: * triggering the event appears. michael@0: * michael@0: * If possible, the SAX driver should provide the line position of michael@0: * the first character after the text associated with the document michael@0: * event. The first column in each line is column 1. michael@0: * michael@0: * @return The column number, or -1 if none is available. michael@0: */ michael@0: readonly attribute long columnNumber; michael@0: michael@0: /** michael@0: * Return the line number where the current document event ends. michael@0: * Lines are delimited by line ends, which are defined in the XML michael@0: * specification. michael@0: * michael@0: * Warning: The return value from the method is intended only as an michael@0: * approximation for the sake of diagnostics; it is not intended to michael@0: * provide sufficient information to edit the character content of michael@0: * the original XML document. In some cases, these "line" numbers michael@0: * match what would be displayed as columns, and in others they may michael@0: * not match the source text due to internal entity expansion. michael@0: * michael@0: * The return value is an approximation of the line number in the michael@0: * document entity or external parsed entity where the markup michael@0: * triggering the event appears. michael@0: * michael@0: * If possible, the SAX driver should provide the line position of michael@0: * the first character after the text associated with the document michael@0: * event. The first line is line 1. michael@0: * michael@0: * @return The line number, or -1 if none is available. michael@0: */ michael@0: readonly attribute long lineNumber; michael@0: michael@0: /** michael@0: * Return the public identifier for the current document event. michael@0: * michael@0: * The return value is the public identifier of the document entity michael@0: * or of the external parsed entity in which the markup triggering michael@0: * the event appears. michael@0: * michael@0: * @return A string containing the public identifier, or michael@0: * null if none is available. michael@0: */ michael@0: readonly attribute AString publicId; michael@0: michael@0: /** michael@0: * Return the system identifier for the current document event. michael@0: * michael@0: * The return value is the system identifier of the document entity michael@0: * or of the external parsed entity in which the markup triggering michael@0: * the event appears. michael@0: * michael@0: * @return A string containing the system identifier, or null michael@0: * if none is available. michael@0: */ michael@0: readonly attribute AString systemId; michael@0: };