Change copyrights from Nokia to Digia
[profile/ivi/qtxmlpatterns.git] / src / xmlpatterns / schema / qxsdcomplextype.cpp
1 /****************************************************************************
2 **
3 ** Copyright (C) 2012 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 #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