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