Update copyright year in license headers.
[profile/ivi/qtxmlpatterns.git] / src / xmlpatterns / schema / qxsdcomplextype.cpp
1 /****************************************************************************
2 **
3 ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
4 ** All rights reserved.
5 ** Contact: Nokia Corporation (qt-info@nokia.com)
6 **
7 ** This file is part of the QtXmlPatterns module of the Qt Toolkit.
8 **
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.
17 **
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.
21 **
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.
29 **
30 ** Other Usage
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.
33 **
34 **
35 **
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41
42 #include "qxsdcomplextype_p.h"
43
44 QT_BEGIN_NAMESPACE
45
46 using namespace QPatternist;
47
48 void XsdComplexType::OpenContent::setMode(Mode mode)
49 {
50     m_mode = mode;
51 }
52
53 XsdComplexType::OpenContent::Mode XsdComplexType::OpenContent::mode() const
54 {
55     return m_mode;
56 }
57
58 void XsdComplexType::OpenContent::setWildcard(const XsdWildcard::Ptr &wildcard)
59 {
60     m_wildcard = wildcard;
61 }
62
63 XsdWildcard::Ptr XsdComplexType::OpenContent::wildcard() const
64 {
65     return m_wildcard;
66 }
67
68 void XsdComplexType::ContentType::setVariety(Variety variety)
69 {
70     m_variety = variety;
71 }
72
73 XsdComplexType::ContentType::Variety XsdComplexType::ContentType::variety() const
74 {
75     return m_variety;
76 }
77
78 void XsdComplexType::ContentType::setParticle(const XsdParticle::Ptr &particle)
79 {
80     m_particle = particle;
81 }
82
83 XsdParticle::Ptr XsdComplexType::ContentType::particle() const
84 {
85     return m_particle;
86 }
87
88 void XsdComplexType::ContentType::setOpenContent(const OpenContent::Ptr &content)
89 {
90     m_openContent = content;
91 }
92
93 XsdComplexType::OpenContent::Ptr XsdComplexType::ContentType::openContent() const
94 {
95     return m_openContent;
96 }
97
98 void XsdComplexType::ContentType::setSimpleType(const AnySimpleType::Ptr &type)
99 {
100     m_simpleType = type;
101 }
102
103 AnySimpleType::Ptr XsdComplexType::ContentType::simpleType() const
104 {
105     return m_simpleType;
106 }
107
108
109 XsdComplexType::XsdComplexType()
110     : m_isAbstract(false)
111     , m_contentType(new ContentType())
112 {
113     m_contentType->setVariety(ContentType::Empty);
114 }
115
116 void XsdComplexType::setIsAbstract(bool abstract)
117 {
118     m_isAbstract = abstract;
119 }
120
121 bool XsdComplexType::isAbstract() const
122 {
123     return m_isAbstract;
124 }
125
126 QString XsdComplexType::displayName(const NamePool::Ptr &np) const
127 {
128     return np->displayName(name(np));
129 }
130
131 void XsdComplexType::setWxsSuperType(const SchemaType::Ptr &type)
132 {
133     m_superType = type;
134 }
135
136 SchemaType::Ptr XsdComplexType::wxsSuperType() const
137 {
138     return m_superType;
139 }
140
141 void XsdComplexType::setContext(const NamedSchemaComponent::Ptr &component)
142 {
143     m_context = component;
144 }
145
146 NamedSchemaComponent::Ptr XsdComplexType::context() const
147 {
148     return m_context;
149 }
150
151 void XsdComplexType::setContentType(const ContentType::Ptr &type)
152 {
153     m_contentType = type;
154 }
155
156 XsdComplexType::ContentType::Ptr XsdComplexType::contentType() const
157 {
158     return m_contentType;
159 }
160
161 void XsdComplexType::setAttributeUses(const XsdAttributeUse::List &attributeUses)
162 {
163     m_attributeUses = attributeUses;
164 }
165
166 void XsdComplexType::addAttributeUse(const XsdAttributeUse::Ptr &attributeUse)
167 {
168     m_attributeUses.append(attributeUse);
169 }
170
171 XsdAttributeUse::List XsdComplexType::attributeUses() const
172 {
173     return m_attributeUses;
174 }
175
176 void XsdComplexType::setAttributeWildcard(const XsdWildcard::Ptr &wildcard)
177 {
178     m_attributeWildcard = wildcard;
179 }
180
181 XsdWildcard::Ptr XsdComplexType::attributeWildcard() const
182 {
183     return m_attributeWildcard;
184 }
185
186 XsdComplexType::TypeCategory XsdComplexType::category() const
187 {
188     return ComplexType;
189 }
190
191 void XsdComplexType::setDerivationMethod(DerivationMethod method)
192 {
193     m_derivationMethod = method;
194 }
195
196 XsdComplexType::DerivationMethod XsdComplexType::derivationMethod() const
197 {
198     return m_derivationMethod;
199 }
200
201 void XsdComplexType::setProhibitedSubstitutions(const BlockingConstraints &substitutions)
202 {
203     m_prohibitedSubstitutions = substitutions;
204 }
205
206 XsdComplexType::BlockingConstraints XsdComplexType::prohibitedSubstitutions() const
207 {
208     return m_prohibitedSubstitutions;
209 }
210
211 void XsdComplexType::setAssertions(const XsdAssertion::List &assertions)
212 {
213     m_assertions = assertions;
214 }
215
216 void XsdComplexType::addAssertion(const XsdAssertion::Ptr &assertion)
217 {
218     m_assertions.append(assertion);
219 }
220
221 XsdAssertion::List XsdComplexType::assertions() const
222 {
223     return m_assertions;
224 }
225
226 bool XsdComplexType::isDefinedBySchema() const
227 {
228     return true;
229 }
230
231 QT_END_NAMESPACE