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 "qxsdcomplextype_p.h"
46 using namespace QPatternist;
48 void XsdComplexType::OpenContent::setMode(Mode mode)
53 XsdComplexType::OpenContent::Mode XsdComplexType::OpenContent::mode() const
58 void XsdComplexType::OpenContent::setWildcard(const XsdWildcard::Ptr &wildcard)
60 m_wildcard = wildcard;
63 XsdWildcard::Ptr XsdComplexType::OpenContent::wildcard() const
68 void XsdComplexType::ContentType::setVariety(Variety variety)
73 XsdComplexType::ContentType::Variety XsdComplexType::ContentType::variety() const
78 void XsdComplexType::ContentType::setParticle(const XsdParticle::Ptr &particle)
80 m_particle = particle;
83 XsdParticle::Ptr XsdComplexType::ContentType::particle() const
88 void XsdComplexType::ContentType::setOpenContent(const OpenContent::Ptr &content)
90 m_openContent = content;
93 XsdComplexType::OpenContent::Ptr XsdComplexType::ContentType::openContent() const
98 void XsdComplexType::ContentType::setSimpleType(const AnySimpleType::Ptr &type)
103 AnySimpleType::Ptr XsdComplexType::ContentType::simpleType() const
109 XsdComplexType::XsdComplexType()
110 : m_isAbstract(false)
111 , m_contentType(new ContentType())
113 m_contentType->setVariety(ContentType::Empty);
116 void XsdComplexType::setIsAbstract(bool abstract)
118 m_isAbstract = abstract;
121 bool XsdComplexType::isAbstract() const
126 QString XsdComplexType::displayName(const NamePool::Ptr &np) const
128 return np->displayName(name(np));
131 void XsdComplexType::setWxsSuperType(const SchemaType::Ptr &type)
136 SchemaType::Ptr XsdComplexType::wxsSuperType() const
141 void XsdComplexType::setContext(const NamedSchemaComponent::Ptr &component)
143 m_context = component;
146 NamedSchemaComponent::Ptr XsdComplexType::context() const
151 void XsdComplexType::setContentType(const ContentType::Ptr &type)
153 m_contentType = type;
156 XsdComplexType::ContentType::Ptr XsdComplexType::contentType() const
158 return m_contentType;
161 void XsdComplexType::setAttributeUses(const XsdAttributeUse::List &attributeUses)
163 m_attributeUses = attributeUses;
166 void XsdComplexType::addAttributeUse(const XsdAttributeUse::Ptr &attributeUse)
168 m_attributeUses.append(attributeUse);
171 XsdAttributeUse::List XsdComplexType::attributeUses() const
173 return m_attributeUses;
176 void XsdComplexType::setAttributeWildcard(const XsdWildcard::Ptr &wildcard)
178 m_attributeWildcard = wildcard;
181 XsdWildcard::Ptr XsdComplexType::attributeWildcard() const
183 return m_attributeWildcard;
186 XsdComplexType::TypeCategory XsdComplexType::category() const
191 void XsdComplexType::setDerivationMethod(DerivationMethod method)
193 m_derivationMethod = method;
196 XsdComplexType::DerivationMethod XsdComplexType::derivationMethod() const
198 return m_derivationMethod;
201 void XsdComplexType::setProhibitedSubstitutions(const BlockingConstraints &substitutions)
203 m_prohibitedSubstitutions = substitutions;
206 XsdComplexType::BlockingConstraints XsdComplexType::prohibitedSubstitutions() const
208 return m_prohibitedSubstitutions;
211 void XsdComplexType::setAssertions(const XsdAssertion::List &assertions)
213 m_assertions = assertions;
216 void XsdComplexType::addAssertion(const XsdAssertion::Ptr &assertion)
218 m_assertions.append(assertion);
221 XsdAssertion::List XsdComplexType::assertions() const
226 bool XsdComplexType::isDefinedBySchema() const