/* -*- 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 "diIStringGraphAutomaton.idl" /** * base interface to represent a node in the validation graph */ [scriptable, uuid(cf555ffc-255e-430c-88aa-2c80301672eb)] interface diIStringGraphNode : 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 OOMINIT_NODE = 6; const short OOMCHECKPOINT_NODE = 7; const short OOMCHECKTEST_NODE = 8; const short DATAVALUE_NODE = 9; const short REF_NODE = 10; const short TEXT_NODE = 11; const short EMPTY_NODE = 12; const short LIST_NODE = 13; /** * 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 diIStringGraphNode nextNodeTrue; /** * this is the next node where the "walker" must use if the test method return false */ attribute diIStringGraphNode 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 diIStringGraphAutomaton 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 diIStringGraphNode nextRightGraphNode; }; /** * this interface represents a node that restore a context in the automaton */ [scriptable, uuid(39a5fb5e-5ce7-40e9-b5c5-c2f88cc02f4d)] interface diIStringGraphRestoreContextNode : diIStringGraphNode { /** * 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 save the context and/or the error status in the automaton */ [scriptable, uuid(6b34dd89-2d7d-414d-8e3b-d7a4805f6dd9)] interface diIStringGraphBoolContext : nsISupports { /** * say if it have to save the context of the automaton */ attribute boolean saveContext; /** * say if it have to save the error status of the automaton */ attribute boolean saveErrorStatus; }; /** * this interface represents a node that */ [scriptable, uuid(40cce697-be51-48f4-bc6f-3d7b17941521)] interface diIStringGraphDataValueNode : diIStringGraphNode { /** * */ attribute diIDatatype datatype; /** * */ attribute diIStringGraphNode exceptGraph; }; /** * this interface represents a node that */ [scriptable, uuid(712c935e-348d-45a5-bbd4-260b9d17d1ab)] interface diIStringGraphRefNode : diIStringGraphNode { /** * */ attribute diIStringGraphNode graph; };