source: NonGTP/Xerces/xercesc/framework/psvi/XSConstants.hpp @ 188

Revision 188, 8.2 KB checked in by mattausch, 19 years ago (diff)

added xercesc to support

Line 
1/*
2 * The Apache Software License, Version 1.1
3 *
4 * Copyright (c) 2003 The Apache Software Foundation.  All rights
5 * reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 *
11 * 1. Redistributions of source code must retain the above copyright
12 *    notice, this list of conditions and the following disclaimer.
13 *
14 * 2. Redistributions in binary form must reproduce the above copyright
15 *    notice, this list of conditions and the following disclaimer in
16 *    the documentation and/or other materials provided with the
17 *    distribution.
18 *
19 * 3. The end-user documentation included with the redistribution,
20 *    if any, must include the following acknowledgment:
21 *       "This product includes software developed by the
22 *        Apache Software Foundation (http://www.apache.org/)."
23 *    Alternately, this acknowledgment may appear in the software itself,
24 *    if and wherever such third-party acknowledgments normally appear.
25 *
26 * 4. The names "Xerces" and "Apache Software Foundation" must
27 *    not be used to endorse or promote products derived from this
28 *    software without prior written permission. For written
29 *    permission, please contact apache\@apache.org.
30 *
31 * 5. Products derived from this software may not be called "Apache",
32 *    nor may "Apache" appear in their name, without prior written
33 *    permission of the Apache Software Foundation.
34 *
35 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
36 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
37 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
38 * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
39 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
40 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
41 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
42 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
43 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
44 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
45 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
46 * SUCH DAMAGE.
47 * ====================================================================
48 *
49 * This software consists of voluntary contributions made by many
50 * individuals on behalf of the Apache Software Foundation, and was
51 * originally based on software copyright (c) 1999, International
52 * Business Machines, Inc., http://www.ibm.com .  For more information
53 * on the Apache Software Foundation, please see
54 * <http://www.apache.org/>.
55 */
56
57/*
58 * $Log: XSConstants.hpp,v $
59 * Revision 1.3  2004/01/29 11:46:30  cargilld
60 * Code cleanup changes to get rid of various compiler diagnostic messages.
61 *
62 * Revision 1.2  2003/11/06 15:30:04  neilg
63 * first part of PSVI/schema component model implementation, thanks to David Cargill.  This covers setting the PSVIHandler on parser objects, as well as implementing XSNotation, XSSimpleTypeDefinition, XSIDCDefinition, and most of XSWildcard, XSComplexTypeDefinition, XSElementDeclaration, XSAttributeDeclaration and XSAttributeUse.
64 *
65 * Revision 1.1  2003/09/16 14:33:36  neilg
66 * PSVI/schema component model classes, with Makefile/configuration changes necessary to build them
67 *
68 */
69
70#if !defined(XSCONSTANTS_HPP)
71#define XSCONSTANTS_HPP
72
73#include <xercesc/util/RefVectorOf.hpp>
74#include <xercesc/util/RefArrayVectorOf.hpp>
75
76XERCES_CPP_NAMESPACE_BEGIN
77
78/**
79 * This contains constants needed in the schema component model.
80 */
81
82// forward definitions for typedefs
83class XSAnnotation;
84class XSAttributeUse;
85class XSFacet;
86class XSMultiValueFacet;
87class XSNamespaceItem;
88class XSParticle;
89class XSSimpleTypeDefinition;
90
91// these typedefs are intended to help hide dependence on utility
92// classes, as well as to define more intuitive names for commonly
93// used concepts.
94
95typedef RefVectorOf <XSAnnotation> XSAnnotationList;
96typedef RefVectorOf <XSAttributeUse> XSAttributeUseList;
97typedef RefVectorOf <XSFacet> XSFacetList;
98typedef RefVectorOf <XSMultiValueFacet> XSMultiValueFacetList;
99typedef RefVectorOf <XSNamespaceItem> XSNamespaceItemList;
100typedef RefVectorOf <XSParticle> XSParticleList;
101typedef RefVectorOf <XSSimpleTypeDefinition> XSSimpleTypeDefinitionList;
102typedef RefArrayVectorOf <XMLCh> StringList;
103
104class XMLPARSER_EXPORT XSConstants
105{
106public:
107
108    // XML Schema Components
109    enum COMPONENT_TYPE {
110            /**
111             * The object describes an attribute declaration.
112             */
113              ATTRIBUTE_DECLARATION     = 1,
114            /**
115             * The object describes an element declaration.
116             */
117              ELEMENT_DECLARATION       = 2,
118            /**
119             * The object describes a complex type or simple type definition.
120             */
121              TYPE_DEFINITION           = 3,
122            /**
123             * The object describes an attribute use definition.
124             */
125              ATTRIBUTE_USE             = 4,
126            /**
127             * The object describes an attribute group definition.
128             */
129              ATTRIBUTE_GROUP_DEFINITION= 5,
130            /**
131             * The object describes a model group definition.
132             */
133              MODEL_GROUP_DEFINITION    = 6,
134            /**
135             * A model group.
136             */
137              MODEL_GROUP               = 7,
138            /**
139             * The object describes a particle.
140             */
141              PARTICLE                  = 8,
142            /**
143             * The object describes a wildcard.
144             */
145              WILDCARD                  = 9,
146            /**
147             * The object describes an identity constraint definition.
148             */
149              IDENTITY_CONSTRAINT       = 10,
150            /**
151             * The object describes a notation declaration.
152             */
153              NOTATION_DECLARATION      = 11,
154            /**
155             * The object describes an annotation.
156             */
157              ANNOTATION                = 12,
158            /**
159             * The object describes a constraining facet.
160             */
161              FACET                     = 13,
162           
163            /**
164             * The object describes enumeration/pattern facets.
165             */
166              MULTIVALUE_FACET           = 14
167    };
168
169    // Derivation constants
170    enum DERIVATION_TYPE {
171            /**
172             * No constraint is available.
173             */
174             DERIVATION_NONE     = 0,
175            /**
176             * <code>XSTypeDefinition</code> final set or
177             * <code>XSElementDeclaration</code> disallowed substitution group.
178             */
179             DERIVATION_EXTENSION      = 1,
180            /**
181             * <code>XSTypeDefinition</code> final set or
182             * <code>XSElementDeclaration</code> disallowed substitution group.
183             */
184             DERIVATION_RESTRICTION    = 2,
185            /**
186             * <code>XSTypeDefinition</code> final set.
187             */
188             DERIVATION_SUBSTITUTION   = 4,
189            /**
190             * <code>XSTypeDefinition</code> final set.
191             */
192             DERIVATION_UNION          = 8,
193            /**
194             * <code>XSTypeDefinition</code> final set.
195             */
196             DERIVATION_LIST           = 16
197    };
198
199    // Scope
200    enum SCOPE {
201            /**
202             * The scope of a declaration within named model groups or attribute
203             * groups is <code>absent</code>. The scope of such declaration is
204             * determined when it is used in the construction of complex type
205             * definitions.
206             */
207             SCOPE_ABSENT              = 0,
208            /**
209             * A scope of <code>global</code> identifies top-level declarations.
210             */
211             SCOPE_GLOBAL              = 1,
212            /**
213             * <code>Locally scoped</code> declarations are available for use only
214             * within the complex type.
215             */
216             SCOPE_LOCAL               = 2
217    };
218
219    // Value Constraint
220    enum VALUE_CONSTRAINT {
221            /**
222             * Indicates that the component does not have any value constraint.
223             */
224             VC_NONE          = 0,
225            /**
226             * Indicates that there is a default value constraint.
227             */
228             VC_DEFAULT                = 1,
229            /**
230             * Indicates that there is a fixed value constraint for this attribute.
231             */
232             VC_FIXED                  = 2
233    };
234
235private:
236    // -----------------------------------------------------------------------
237    //  Unimplemented constructors and operators
238    // -----------------------------------------------------------------------
239    XSConstants();
240};
241
242XERCES_CPP_NAMESPACE_END
243
244#endif
Note: See TracBrowser for help on using the repository browser.