/* -*- 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 The Connexions Project. * * Portions created by the Initial Developer are Copyright (C) 2004-2006 * 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 "nsIDOMElement.idl" #include "diISchemaGraphNode.idl" #include "diIValidationSchema.idl" interface diISchemaParser; /** * this interface represents any pattern in a schema * this can be a base for other interface that represents specific patterns */ [scriptable, uuid(437f67d8-d836-4048-8529-483ca2b1012a)] interface diISchemaPattern : nsISupports { // main type const unsigned short RELAXNG_TYPE = 1024; const unsigned short EDITION_TYPE = 2048; const unsigned short UNKNOW_PATTERN = 1024 + 0; const unsigned short GRAMMAR_PATTERN = 1024 + 1; const unsigned short DIV_PATTERN = 1024 + 2; const unsigned short GROUP_PATTERN = 1024 + 3; const unsigned short ELEMENT_PATTERN = 1024 + 4; const unsigned short TEXT_PATTERN = 1024 + 5; const unsigned short ZEROORMORE_PATTERN = 1024 + 6; const unsigned short DEFINE_PATTERN = 1024 + 7; const unsigned short REF_PATTERN = 1024 + 8; const unsigned short START_PATTERN = 1024 + 9; const unsigned short ATTRIBUTE_PATTERN = 1024 + 10; const unsigned short CHOICE_PATTERN = 1024 + 11; const unsigned short INTERLEAVE_PATTERN = 1024 + 12; const unsigned short ONEORMORE_PATTERN = 1024 + 13; const unsigned short MIXED_PATTERN = 1024 + 14; const unsigned short OPTIONAL_PATTERN = 1024 + 15; const unsigned short EXTERNALREF_PATTERN = 1024 + 16; const unsigned short INCLUDE_PATTERN = 1024 + 17; const unsigned short PARENTREF_PATTERN = 1024 + 18; const unsigned short LIST_PATTERN = 1024 + 19; const unsigned short EXCEPT_PATTERN = 1024 + 20; const unsigned short VALUE_PATTERN = 1024 + 21; const unsigned short DATA_PATTERN = 1024 + 22; const unsigned short PARAM_PATTERN = 1024 + 23; const unsigned short EMPTY_PATTERN = 1024 + 24; const unsigned short NOTALLOWED_PATTERN = 1024 + 25; const unsigned short NAME_PATTERN = 1024 + 26; const unsigned short ANYNAME_PATTERN = 1024 + 27; const unsigned short NSNAME_PATTERN = 1024 + 28; const unsigned short EDITION_LABEL_PATTERN = 2048 + 1; const unsigned short EDITION_DESCRIPTION_PATTERN = 2048 + 2; const unsigned short EDITION_BLANK_PATTERN = 2048 + 3; const unsigned short EDITION_EDITORSTYLESHEET_PATTERN = 2048 + 4; const unsigned short EDITION_EXTERNALDOCTYPE_PATTERN = 2048 + 5; const unsigned short EDITION_PROCESSINGINSTRUCTION_PATTERN = 2048 + 6; const unsigned short EDITION_LOCALIZATIONPROPERTIES_PATTERN = 2048 + 7; /** * the identifier of the type of pattern */ readonly attribute short type; /** * a reference to the parser (initialize by the parser it self) */ attribute diISchemaParser parser; /** * this method is called when the parser found a DOMElement corresponding to the pattern * it is called before calls of the addTextValue or addChildPattern method * @param aDomElt the domelement found * @return boolean true if the parser should parse child elements of aDomElt or not */ boolean initPattern (in nsIDOMElement aDomElt); /** * if the parser found some text as a child of the DOMElement , it calls this method */ void addTextValue (in AString aText); /** * if the parser found a child pattern, it calls this method */ void addChildPattern (in diISchemaPattern aPattern); /** * calls by the parser after the analyse of all child patterns */ void endPattern (); /** * this method is used to get the beginning of the graph corresponding to the pattern (and its subpatterns) * it could be call by the parent pattern * @return the first node of the graph */ diISchemaGraphNode getGraphEntry (); /** * this method is used to get the positive end of the graph corresponding to the pattern (and its subpatterns) * it could be call by the parent pattern * @return the last positive node of the graph */ diISchemaGraphNode getGraphTrueExit (); /** * this method is used to get the negative end of the graph corresponding to the pattern (and its subpatterns) * it could be call by the parent pattern * @return the last negative node of the graph */ diISchemaGraphNode getGraphFalseExit (); }; /** * */ [scriptable, uuid(e4017747-402a-482d-958e-210f9d71d733)] interface diIStringPattern: nsISupports { /** * this method is used to get the beginning of the string graph corresponding to the pattern (and its subpatterns) * it could be call by the parent pattern * @return the first node of the string graph */ diIStringGraphNode getStringGraphEntry (); /** * this method is used to get the positive end of the string graph corresponding to the pattern (and its subpatterns) * it could be call by the parent pattern * @return the last positive node of the string graph */ diIStringGraphNode getStringGraphTrueExit (); /** * this method is used to get the negative end of the string graph corresponding to the pattern (and its subpatterns) * it could be call by the parent pattern * @return the last negative node of the string graph */ diIStringGraphNode getStringGraphFalseExit (); };