1 /****************************************************************************
3 ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
6 ** This file is part of the QtXmlPatterns module of the Qt Toolkit.
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.
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.
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.
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.
40 ****************************************************************************/
42 #include "qxsdelement_p.h"
46 using namespace QPatternist;
48 void XsdElement::Scope::setVariety(Variety variety)
53 XsdElement::Scope::Variety XsdElement::Scope::variety() const
58 void XsdElement::Scope::setParent(const NamedSchemaComponent::Ptr &parent)
63 NamedSchemaComponent::Ptr XsdElement::Scope::parent() const
68 void XsdElement::ValueConstraint::setVariety(Variety variety)
73 XsdElement::ValueConstraint::Variety XsdElement::ValueConstraint::variety() const
78 void XsdElement::ValueConstraint::setValue(const QString &value)
83 QString XsdElement::ValueConstraint::value() const
88 void XsdElement::ValueConstraint::setLexicalForm(const QString &form)
93 QString XsdElement::ValueConstraint::lexicalForm() const
98 void XsdElement::TypeTable::addAlternative(const XsdAlternative::Ptr &alternative)
100 m_alternatives.append(alternative);
103 XsdAlternative::List XsdElement::TypeTable::alternatives() const
105 return m_alternatives;
108 void XsdElement::TypeTable::setDefaultTypeDefinition(const XsdAlternative::Ptr &type)
110 m_defaultTypeDefinition = type;
113 XsdAlternative::Ptr XsdElement::TypeTable::defaultTypeDefinition() const
115 return m_defaultTypeDefinition;
119 XsdElement::XsdElement()
120 : m_isAbstract(false)
124 bool XsdElement::isElement() const
129 void XsdElement::setType(const SchemaType::Ptr &type)
134 SchemaType::Ptr XsdElement::type() const
139 void XsdElement::setScope(const Scope::Ptr &scope)
144 XsdElement::Scope::Ptr XsdElement::scope() const
149 void XsdElement::setValueConstraint(const ValueConstraint::Ptr &constraint)
151 m_valueConstraint = constraint;
154 XsdElement::ValueConstraint::Ptr XsdElement::valueConstraint() const
156 return m_valueConstraint;
159 void XsdElement::setTypeTable(const TypeTable::Ptr &table)
164 XsdElement::TypeTable::Ptr XsdElement::typeTable() const
169 void XsdElement::setIsAbstract(bool abstract)
171 m_isAbstract = abstract;
174 bool XsdElement::isAbstract() const
179 void XsdElement::setIsNillable(bool nillable)
181 m_isNillable = nillable;
184 bool XsdElement::isNillable() const
189 void XsdElement::setDisallowedSubstitutions(const BlockingConstraints &substitutions)
191 m_disallowedSubstitutions = substitutions;
194 XsdElement::BlockingConstraints XsdElement::disallowedSubstitutions() const
196 return m_disallowedSubstitutions;
199 void XsdElement::setSubstitutionGroupExclusions(const SchemaType::DerivationConstraints &exclusions)
201 m_substitutionGroupExclusions = exclusions;
204 SchemaType::DerivationConstraints XsdElement::substitutionGroupExclusions() const
206 return m_substitutionGroupExclusions;
209 void XsdElement::setIdentityConstraints(const XsdIdentityConstraint::List &constraints)
211 m_identityConstraints = constraints;
214 void XsdElement::addIdentityConstraint(const XsdIdentityConstraint::Ptr &constraint)
216 m_identityConstraints.append(constraint);
219 XsdIdentityConstraint::List XsdElement::identityConstraints() const
221 return m_identityConstraints;
224 void XsdElement::setSubstitutionGroupAffiliations(const XsdElement::List &affiliations)
226 m_substitutionGroupAffiliations = affiliations;
229 XsdElement::List XsdElement::substitutionGroupAffiliations() const
231 return m_substitutionGroupAffiliations;
234 void XsdElement::addSubstitutionGroup(const XsdElement::Ptr &element)
236 m_substitutionGroups.insert(element);
239 XsdElement::List XsdElement::substitutionGroups() const
241 return m_substitutionGroups.toList();