/* -*- 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 "diIDatatypeLibrary.idl" #include "diISchemaGraphAutomaton.idl" #include "diIStringGraphNode.idl" interface diISchemaElementProperties; interface diISchemaAttributeProperties; /** * base interface to represent a node in the validation graph */ [scriptable, uuid(936f911f-7477-48e9-a207-e5eed86ce2a6)] interface diISchemaGraphNode : nsISupports { const short GRAPH_NODE = 0; const short POSITIVEEND_NODE = 1; const short NEGATIVEEND_NODE = 2; const short SAVECONTEXT_NODE = 3; const short UNDOSAVECONTEXT_NODE = 4; const short RESTORECONTEXT_NODE = 5; const short TAG_NODE = 6; const short ATTRIBUTE_NODE = 7; const short TEXT_NODE = 8; const short INTERLEAVEINIT_NODE = 9; const short INTERLEAVECHECKPOINT_NODE = 10; const short INTERLEAVECOMPLETE_NODE = 11; const short INTERLEAVERESTORE_NODE = 12; const short OOMINIT_NODE = 13; const short OOMCHECKPOINT_NODE = 14; const short OOMCHECKTEST_NODE = 15; const short REF_NODE = 16; const short TAGNAME_NODE = 17; const short ATTRNAME_NODE = 18; const short TAGDATA_NODE = 19; const short STRINGGRAPH_NODE = 20; const short ZOMINIT_NODE = 21; const short ZOMENDROUND_NODE = 22; const short ZOMENDLOOP_NODE = 23; const short CHOICEINIT_NODE = 24; const short CHOICEPOSCHECKPOINT_NODE = 25; const short CHOICENEGCHECKPOINT_NODE = 26; const short CHOICEPOSEND_NODE = 27; const short CHOICENEGEND_NODE = 28; const short EMPTY_NODE = 29; const short NOTALLOWED_NODE = 30; const short ANYNAME_NODE = 31; /** * the type of the node */ readonly attribute short type; /** * this is the next node where the "walker" must use if the test method return true */ attribute diISchemaGraphNode nextNodeTrue; /** * this is the next node where the "walker" must use if the test method return false */ attribute diISchemaGraphNode nextNodeFalse; /** * a method that perform something. return true or * @return a boolean to say which of the two node (nextNode*) we have to test next time */ boolean test(in diISchemaGraphAutomaton aAutomaton); /** * this is the next node for a "walker" that would want walk throw a minimum valid graph * to know for example, the "blank" content of a element. * (in fact, following this nodes show the minimal right way in the graph that a * validator should follow when it validates a good content) */ attribute diISchemaGraphNode nextRightGraphNode; /** * this attribute could be used during the use of an enumerator such diGraphEnumerator, * to store counter or else.. */ attribute short anyValue; }; /** * this interface represents a node that launch a validation of a subgraph * (used for a ref pattern) */ [scriptable, uuid(ad3f58e8-e0ae-48d6-80ab-2a92ad87b217)] interface diISchemaGraphRefNode : diISchemaGraphNode { /** * the subgraph where the ref pattern point to. */ attribute diISchemaGraphNode graph; }; /** * the diISchemaGraphTagNode interface represents a node that test a DOMElement node */ [scriptable, uuid(268716f9-51ce-4bf9-9e52-a193bca832c3)] interface diISchemaGraphTagNode : diISchemaGraphNode { /** * the element data container */ readonly attribute diISchemaElementProperties elementProperties; }; /** * the diISchemaGraphTagNode interface represents a node that test an attribute of a DOMElement node */ [scriptable, uuid(9a3b2379-de50-41e7-b864-219f375a558c)] interface diISchemaGraphAttributeNode : diISchemaGraphNode { /** * the container of datas attribute */ readonly attribute diISchemaAttributeProperties attributeProperties; }; /** * this interface represents a node that restore a context in the automaton */ [scriptable, uuid(c6b339ed-89ec-4e65-98d6-1f71e3cf45ef)] interface diISchemaGraphRestoreContextNode : diISchemaGraphNode { /** * the value that the test method should return */ attribute boolean returnValue; /** * say if it have to restore the error status in the automaton */ attribute boolean restoreErrorStatus; /** * the error code of the error generated when the test method return false */ attribute short errorCode; }; /** * this interface represents a node that test a name of a DOMElement or DOMAttribute */ [scriptable, uuid(d03ab430-ce69-4fbf-8a78-957d6ef4525f)] interface diISchemaGraphNameNode : diISchemaGraphNode { /** * the name that the dom node should have */ attribute AString localName; /** * the namespace URI that the dom node should have */ attribute AString namespaceURI; }; /** * the diISchemaGraphChoiceNode is the interface for a choiceInit node */ [scriptable, uuid(ff6ed211-acd0-45e2-bd0a-f7167eb918b8)] interface diISchemaGraphChoiceNode : diISchemaGraphNode { attribute diISchemaGraphNode choiceEndNode; attribute boolean hasEmptyChoice; attribute boolean hasTextChoice; }; /** * this interface represents a node that save/restore/undo some context value in the automaton */ [scriptable, uuid(2b687782-7bbf-485a-b177-66208650cf51)] interface diISchemaGraphBoolContext : nsISupports { /** * say if it have to save the context of the automaton */ attribute boolean saveContext; /** * say if the error status has to be saved or is saved */ attribute boolean saveErrorStatus; /** * say if it have to save the match mode of the automaton */ attribute boolean saveMatchMode; }; /** * this interface represents a node that test a part of a DOMText node value */ [scriptable, uuid(c171e981-879e-430d-9c07-953c40b4ea02)] interface diISchemaGraphDataValueNode : diISchemaGraphNode { /** * */ attribute diIDatatype datatype; /** * */ attribute diIStringGraphNode exceptGraph; }; /** * this interface represents a node that test the content of the tag against a string graph */ [scriptable, uuid(2508175a-844b-4442-bb87-3ef400a68a7e)] interface diISchemaGraphStringGraphNode : diISchemaGraphNode { /** * */ attribute diIStringGraphNode stringGraph; };