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 ****************************************************************************/
43 #include "qbasictypesfactory_p.h"
44 #include "qfunctionfactorycollection_p.h"
45 #include "qgenericnamespaceresolver_p.h"
46 #include "qcommonnamespaces_p.h"
47 #include "qgenericdynamiccontext_p.h"
49 #include "qstaticfocuscontext_p.h"
53 using namespace QPatternist;
55 DelegatingStaticContext::DelegatingStaticContext(const StaticContext::Ptr &context) : m_context(context)
60 NamespaceResolver::Ptr DelegatingStaticContext::namespaceBindings() const
62 return m_context->namespaceBindings();
65 FunctionFactory::Ptr DelegatingStaticContext::functionSignatures() const
67 return m_context->functionSignatures();
70 DynamicContext::Ptr DelegatingStaticContext::dynamicContext() const
72 return m_context->dynamicContext();
75 SchemaTypeFactory::Ptr DelegatingStaticContext::schemaDefinitions() const
77 return m_context->schemaDefinitions();
80 QUrl DelegatingStaticContext::baseURI() const
82 return m_context->baseURI();
85 void DelegatingStaticContext::setBaseURI(const QUrl &uri)
87 m_context->setBaseURI(uri);
90 bool DelegatingStaticContext::compatModeEnabled() const
92 return m_context->compatModeEnabled();
95 QUrl DelegatingStaticContext::defaultCollation() const
97 return m_context->defaultCollation();
100 QAbstractMessageHandler * DelegatingStaticContext::messageHandler() const
102 return m_context->messageHandler();
105 void DelegatingStaticContext::setDefaultCollation(const QUrl &uri)
107 m_context->setDefaultCollation(uri);
110 void DelegatingStaticContext::setNamespaceBindings(const NamespaceResolver::Ptr &resolver)
112 m_context->setNamespaceBindings(resolver);
115 StaticContext::BoundarySpacePolicy DelegatingStaticContext::boundarySpacePolicy() const
117 return m_context->boundarySpacePolicy();
120 void DelegatingStaticContext::setBoundarySpacePolicy(const BoundarySpacePolicy policy)
122 m_context->setBoundarySpacePolicy(policy);
125 StaticContext::ConstructionMode DelegatingStaticContext::constructionMode() const
127 return m_context->constructionMode();
130 void DelegatingStaticContext::setConstructionMode(const ConstructionMode mode)
132 m_context->setConstructionMode(mode);
135 StaticContext::OrderingMode DelegatingStaticContext::orderingMode() const
137 return m_context->orderingMode();
140 void DelegatingStaticContext::setOrderingMode(const OrderingMode mode)
142 m_context->setOrderingMode(mode);
145 StaticContext::OrderingEmptySequence DelegatingStaticContext::orderingEmptySequence() const
147 return m_context->orderingEmptySequence();
150 void DelegatingStaticContext::setOrderingEmptySequence(const OrderingEmptySequence ordering)
152 m_context->setOrderingEmptySequence(ordering);
155 QString DelegatingStaticContext::defaultFunctionNamespace() const
157 return m_context->defaultFunctionNamespace();
160 void DelegatingStaticContext::setDefaultFunctionNamespace(const QString &ns)
162 m_context->setDefaultFunctionNamespace(ns);
165 QString DelegatingStaticContext::defaultElementNamespace() const
167 return m_context->defaultElementNamespace();
170 void DelegatingStaticContext::setDefaultElementNamespace(const QString &ns)
172 m_context->setDefaultElementNamespace(ns);
175 StaticContext::InheritMode DelegatingStaticContext::inheritMode() const
177 return m_context->inheritMode();
180 void DelegatingStaticContext::setInheritMode(const InheritMode mode)
182 m_context->setInheritMode(mode);
185 StaticContext::PreserveMode DelegatingStaticContext::preserveMode() const
187 return m_context->preserveMode();
190 void DelegatingStaticContext::setPreserveMode(const PreserveMode mode)
192 m_context->setPreserveMode(mode);
195 ItemType::Ptr DelegatingStaticContext::contextItemType() const
197 return m_context->contextItemType();
200 ItemType::Ptr DelegatingStaticContext::currentItemType() const
202 return m_context->currentItemType();
205 ExternalVariableLoader::Ptr DelegatingStaticContext::externalVariableLoader() const
207 return m_context->externalVariableLoader();
210 StaticContext::Ptr DelegatingStaticContext::copy() const
212 return StaticContext::Ptr(new DelegatingStaticContext(m_context->copy()));
215 ResourceLoader::Ptr DelegatingStaticContext::resourceLoader() const
217 return m_context->resourceLoader();
220 NamePool::Ptr DelegatingStaticContext::namePool() const
222 return m_context->namePool();
225 void DelegatingStaticContext::addLocation(const SourceLocationReflection *const reflection,
226 const QSourceLocation &location)
228 m_context->addLocation(reflection, location);
231 StaticContext::LocationHash DelegatingStaticContext::sourceLocations() const
233 return m_context->sourceLocations();
236 QSourceLocation DelegatingStaticContext::locationFor(const SourceLocationReflection *const reflection) const
238 return m_context->locationFor(reflection);
241 const QAbstractUriResolver *DelegatingStaticContext::uriResolver() const
243 return m_context->uriResolver();
246 VariableSlotID DelegatingStaticContext::currentRangeSlot() const
248 return m_context->currentRangeSlot();
251 VariableSlotID DelegatingStaticContext::allocateRangeSlot()
253 return m_context->allocateRangeSlot();
256 void DelegatingStaticContext::setCompatModeEnabled(const bool newVal)
258 m_context->setCompatModeEnabled(newVal);