Qt 4.8
qxsdelement_p.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the QtXmlPatterns module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
42 //
43 // W A R N I N G
44 // -------------
45 //
46 // This file is not part of the Qt API. It exists purely as an
47 // implementation detail. This header file may change from version to
48 // version without notice, or even be removed.
49 //
50 // We mean it.
51 
52 #ifndef Patternist_XsdElement_H
53 #define Patternist_XsdElement_H
54 
55 #include "qschemacomponent_p.h"
56 #include "qschematype_p.h"
57 #include "qxsdalternative_p.h"
59 #include "qxsdcomplextype_p.h"
60 
61 #include <QtCore/QList>
62 #include <QtCore/QSet>
63 
65 
67 
68 namespace QPatternist
69 {
83  class XsdElement : public XsdTerm
84  {
85  public:
89 
94  {
98  };
99 
105  class Scope : public QSharedData
106  {
107  public:
109 
113  enum Variety
114  {
117  };
118 
122  void setVariety(Variety variety);
123 
127  Variety variety() const;
128 
133 
138 
139  private:
142  };
143 
149  class TypeTable : public QSharedData
150  {
151  public:
153 
157  void addAlternative(const XsdAlternative::Ptr &alternative);
158 
162  XsdAlternative::List alternatives() const;
163 
167  void setDefaultTypeDefinition(const XsdAlternative::Ptr &type);
168 
172  XsdAlternative::Ptr defaultTypeDefinition() const;
173 
174  private:
177  };
178 
179 
186  {
187  public:
189 
193  enum Variety
194  {
196  Fixed
197  };
198 
202  void setVariety(Variety variety);
203 
207  Variety variety() const;
208 
212  void setValue(const QString &value);
213 
217  QString value() const;
218 
222  void setLexicalForm(const QString &form);
223 
227  QString lexicalForm() const;
228 
229  private:
233  };
234 
238  XsdElement();
239 
243  virtual bool isElement() const;
244 
250  void setType(const SchemaType::Ptr &type);
251 
255  SchemaType::Ptr type() const;
256 
262  void setScope(const Scope::Ptr &scope);
263 
267  Scope::Ptr scope() const;
268 
274  void setValueConstraint(const ValueConstraint::Ptr &constraint);
275 
280 
286  void setTypeTable(const TypeTable::Ptr &table);
287 
291  TypeTable::Ptr typeTable() const;
292 
298  void setIsAbstract(bool abstract);
299 
303  bool isAbstract() const;
304 
310  void setIsNillable(bool nillable);
311 
315  bool isNillable() const;
316 
324  void setDisallowedSubstitutions(const BlockingConstraints &substitutions);
325 
329  BlockingConstraints disallowedSubstitutions() const;
330 
338  void setSubstitutionGroupExclusions(const SchemaType::DerivationConstraints &exclusions);
339 
343  SchemaType::DerivationConstraints substitutionGroupExclusions() const;
344 
350  void setIdentityConstraints(const XsdIdentityConstraint::List &constraints);
351 
355  void addIdentityConstraint(const XsdIdentityConstraint::Ptr &constraint);
356 
361 
367  void setSubstitutionGroupAffiliations(const XsdElement::List &affiliations);
368 
373 
378 
383 
384  private:
391  BlockingConstraints m_disallowedSubstitutions;
392  SchemaType::DerivationConstraints m_substitutionGroupExclusions;
396  };
397 }
398 
400 
402 
403 #endif
TypeTable::Ptr typeTable() const
void addSubstitutionGroup(const XsdElement::Ptr &elements)
XsdElement::WeakList substitutionGroups() const
void setSubstitutionGroupAffiliations(const XsdElement::List &affiliations)
Represents a XSD element object.
Definition: qxsdelement_p.h:83
Base class for W3C XML Schema types.
Definition: qschematype_p.h:78
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
#define QT_BEGIN_HEADER
Definition: qglobal.h:136
The element is defined locally as child of a complex type or model group definition.
QList< XsdElement::Ptr > List
Definition: qxsdelement_p.h:87
XsdAlternative::Ptr m_defaultTypeDefinition
XsdIdentityConstraint::List identityConstraints() const
void addIdentityConstraint(const XsdIdentityConstraint::Ptr &constraint)
BlockingConstraints m_disallowedSubstitutions
QExplicitlySharedDataPointer< Scope > Ptr
XsdElement::List substitutionGroupAffiliations() const
XsdElement::List m_substitutionGroupAffiliations
The QString class provides a Unicode character string.
Definition: qstring.h:83
void setSubstitutionGroupExclusions(const SchemaType::DerivationConstraints &exclusions)
The value of the element has no constraints.
Definition: qxsdelement_p.h:95
SchemaType::Ptr type() const
The element has a default value set.
SchemaType::DerivationConstraints m_substitutionGroupExclusions
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
A base class for all particles of a model group.
Definition: qxsdterm_p.h:75
QList< XsdElement * > WeakList
Definition: qxsdelement_p.h:88
XsdAlternative::List m_alternatives
SchemaType::DerivationConstraints substitutionGroupExclusions() const
The element has a default value set.
Definition: qxsdelement_p.h:96
The namespace for the internal API of QtXmlPatterns.
QExplicitlySharedDataPointer< TypeTable > Ptr
void setIdentityConstraints(const XsdIdentityConstraint::List &constraints)
XsdIdentityConstraint::List m_identityConstraints
void setIsAbstract(bool abstract)
void setType(const SchemaType::Ptr &type)
void setVariety(Variety variety)
Definition: qxsdelement.cpp:48
ValueConstraint::Ptr m_valueConstraint
void setDisallowedSubstitutions(const BlockingConstraints &substitutions)
void setIsNillable(bool nillable)
The QSharedData class is a base class for shared data objects.
Definition: qshareddata.h:56
The element has a fixed value set.
Definition: qxsdelement_p.h:97
void setScope(const Scope::Ptr &scope)
virtual bool isElement() const
TypeTable::Ptr m_typeTable
The element is defined globally as child of the schema object.
ValueConstraint::Ptr valueConstraint() const
QExplicitlySharedDataPointer< XsdElement > Ptr
Definition: qxsdelement_p.h:86
static const QTextHtmlElement elements[Html_NumElements]
BlockingConstraints disallowedSubstitutions() const
QSet< XsdElement * > m_substitutionGroups
QExplicitlySharedDataPointer< ValueConstraint > Ptr
NamedSchemaComponent::Ptr parent() const
Definition: qxsdelement.cpp:63
NamedSchemaComponent * m_parent
#define QT_END_HEADER
Definition: qglobal.h:137
void setTypeTable(const TypeTable::Ptr &table)
Base class for all named components that can appear in a W3C XML Schema.
void setValueConstraint(const ValueConstraint::Ptr &constraint)
Scope::Ptr scope() const
void setParent(const NamedSchemaComponent::Ptr &parent)
Definition: qxsdelement.cpp:58