/* -*- 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 "domstubs.idl" #include "diIRelaxNGValidationContext.idl" #include "diIContentLocation.idl" interface diIRelaxNGPatternBuilder; interface diIRelaxNGRootGrammar; /** * base interface for all patterns */ [scriptable, uuid(1293be33-e547-4cd7-8d63-20cb4354da3d)] interface diIRelaxNGPattern: nsISupports { /* values for contentType */ const short CT_NOT = 0; const short CT_EMPTY = 1; const short CT_COMPLEX = 2; const short CT_SIMPLE = 3; /* values for type */ const short REF_PATTERN = 1; const short ELEMENT_PATTERN = 2; const short ATTRIBUTE_PATTERN = 3; const short ONEORMORE_PATTERN = 4; const short CHOICE_PATTERN = 5; const short GROUP_PATTERN = 6; const short INTERLEAVE_PATTERN = 7; const short VALUE_PATTERN = 8; const short DATA_PATTERN = 9; const short TEXT_PATTERN = 10; const short NOTALLOWED_PATTERN = 11; const short LIST_PATTERN = 12; const short NAME_PATTERN = 13; const short ANYNAME_PATTERN = 14; const short NSNAME_PATTERN = 15; const short EXCEPT_PATTERN = 16; const short EMPTY_PATTERN = 17; const short REF_ELEMENT_PATTERN = 18; /* values returned by generateContent */ const short CG_IMPOSSIBLE = 0; const short CG_NOTALLOWED = 1; const short CG_EMPTY = 2; const short CG_TEXT = 3; const short CG_ATTRIBUTE = 4; const short CG_ELEMENT = 5; readonly attribute short type; readonly attribute short contentType; attribute diIContentLocation location; /** * do a derivation on the pattern against the given dom node */ diIRelaxNGPattern deriv(in nsIDOMNode aNode, in diIRelaxNGValidationContext aContext); diIRelaxNGPattern textDeriv(in nsIDOMNode aNode, in diIRelaxNGValidationContext aContext); diIRelaxNGPattern attDeriv(in nsIDOMNode aNode, in diIRelaxNGValidationContext aContext); boolean isNullable(); diIRelaxNGPattern simplify(in diIRelaxNGRootGrammar aGrammar); void simplifyRef(in diIRelaxNGRootGrammar aGrammar); void checkRestriction(in diIRelaxNGRootGrammar aGrammar); boolean matchLocalNameNs (in AString aLocalName, in AString aNs); boolean acceptNC (in diIRelaxNGPattern p1, in diIRelaxNGPattern p2); boolean containsName (in AString aLocalName, in AString aNs); void computeLocalNameNS (out AString aLocalName, out AString aNs); boolean needOneOrMore (); void endOfParsing(in diIRelaxNGRootGrammar aGrammar); void dump(); short generateContent(in nsIDOMDocument aDocument, in nsIDOMNode aNode); }; /** * base interface for all patterns which have a single child pattern */ [scriptable, uuid(83d6f21e-fa5d-4175-9689-3dcea7b1cdb3)] interface diIRelaxNGPatternUnary: diIRelaxNGPattern { readonly attribute diIRelaxNGPattern child; }; /** * base interface for all patterns which have two children patterns */ [scriptable, uuid(a0767560-f5fc-459e-b9e9-52462bfd0a1a)] interface diIRelaxNGPatternBinary: diIRelaxNGPattern { readonly attribute diIRelaxNGPattern child1; readonly attribute diIRelaxNGPattern child2; }; %{C++ #define DI_FORWARD_DIIRELAXNGPATTERNUNARY_MIN(_to) \ DI_FORWARD_DIIRELAXNGPATTERN_MIN(_to) \ NS_FORWARD_DIIRELAXNGPATTERNUNARY(_to) #define DI_FORWARD_DIIRELAXNGPATTERNBINARY_MIN(_to) \ DI_FORWARD_DIIRELAXNGPATTERN_MIN(_to) \ NS_FORWARD_DIIRELAXNGPATTERNBINARY(_to) %}