1 /****************************************************************************
3 ** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
4 ** All rights reserved.
5 ** Contact: Nokia Corporation (qt-info@nokia.com)
7 ** This file is part of the QtXmlPatterns module of the Qt Toolkit.
9 ** $QT_BEGIN_LICENSE:LGPL$
10 ** GNU Lesser General Public License Usage
11 ** This file may be used under the terms of the GNU Lesser General Public
12 ** License version 2.1 as published by the Free Software Foundation and
13 ** appearing in the file LICENSE.LGPL included in the packaging of this
14 ** file. Please review the following information to ensure the GNU Lesser
15 ** General Public License version 2.1 requirements will be met:
16 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
18 ** In addition, as a special exception, Nokia gives you certain additional
19 ** rights. These rights are described in the Nokia Qt LGPL Exception
20 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
22 ** GNU General Public License Usage
23 ** Alternatively, this file may be used under the terms of the GNU General
24 ** Public License version 3.0 as published by the Free Software Foundation
25 ** and appearing in the file LICENSE.GPL included in the packaging of this
26 ** file. Please review the following information to ensure the GNU General
27 ** Public License version 3.0 requirements will be met:
28 ** http://www.gnu.org/copyleft/gpl.html.
31 ** Alternatively, this file may be used in accordance with the terms and
32 ** conditions contained in a signed written agreement between you and Nokia.
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();