/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* ***** 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 ETNA Relax NG validator. * * The Initial Developer of the Original Code is Disruptive Innovations. * * Portions created by the Initial Developer are Copyright (C) 2007 * the Initial Developer. All Rights Reserved. * * Contributor(s): * Laurent Jouanneau , Original author * * Alternatively, the contents of this file may be used under the terms of * either 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 "nsISupports.idl" #include "nsIArray.idl" #include "nsIMutableArray.idl" #include "domstubs.idl" #include "diISchemaBlankDocumentProperties.idl" #include "diISchemaElement.idl" /** * Container to store error informations */ [scriptable, uuid(26b7ca28-fe01-4413-b41b-da747ac42b13)] interface diIValidationError : nsISupports { readonly attribute nsIDOMNode node; readonly attribute long code; readonly attribute AString file; readonly attribute long line; }; /** * this interface represents a schema in its loaded form */ [scriptable, uuid(2a0fd0dc-f2ce-40d4-8870-14ba83f5fe76)] interface diIValidationSchema : nsISupports { /** * Label of the schema * If it is not provided by the schema, it could be the filename or else.. */ readonly attribute AString label; /** * a description of the schema */ readonly attribute AString description; /** * The URI of the CSS stylesheet which will be applied on edited documents */ readonly attribute AString editingStyleSheetURI; /** * Get the blank document corresponding to the given ID. * A schema could declared several different blank document and each one are * identified by a unique ID. * An empty ID ("") identify the default blank document. * @param aId the identifiant of a blank document * @return the blank document */ nsIDOMDocument getBlankDocument( in AString aId); /** * Returns properties of a typical blank document * @param aId the identifiant of a blank document * @return properties */ diISchemaBlankDocumentProperties getBlankDocumentProperties( in AString aId); /** * Returns the properties of all available blank documents * @return an array of diISchemaBlankDocumentProperties objects */ nsIArray getBlankDocumentList(); /** * Return all namespaces declared in the schema * @return an array of diISchemaNamespace */ nsIArray getNamespaces(); void getRootElementsList(out PRUint32 length, [retval, array, size_is(length)] out diISchemaElement eltArray); /** * Validate an XML document. * See validationErrors for errors when the document is not valid. * @param aDoc the document to validate * @param aPrepareForEditing to says if the document should be prepare for editing. For example, the * validator could attach some extra-informations on each elements, so it * will be easier for the editor to do some things * @return true if the document is valid */ boolean validateDocument( in nsIDOMDocument aDoc, in boolean aPrepareForEditing); /** * Validate an XML document stored in a file which is at the given URL. * See validationErrors for errors when the document is not valid. * @param aUrl the url of the document to validate * @return true if the document is valid */ boolean validateFile( in ACString aUrl); /** * validation errors */ readonly attribute diIValidationError validationError; void getElementsList(out PRUint32 length, [retval, array, size_is(length)] out diISchemaElement eltArray); }; %{C++ //{232a7192-dec8-4eaa-aedb-d2fc9553349c} #define DISCHEMANAMESPACE_CONTRACTID "@disruptive-innovations.com/validator/schema-namespace;1" #define DISCHEMANAMESPACE_CID { 0x232a7192, 0xdec8, 0x4eaa, { 0xae, 0xdb, 0xd2, 0xfc, 0x95, 0x53, 0x34, 0x9c } } #ifdef XP_WIN #define DI_EDITOR_SPECIAL_CHAR NS_LITERAL_STRING("\x2592") #else #define DI_EDITOR_SPECIAL_CHAR NS_LITERAL_STRING("\u2592") #endif %}