1 /****************************************************************************
3 ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
4 ** All rights reserved.
5 ** Contact: http://www.qt-project.org/
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 ****************************************************************************/
44 #include "qdaytimeduration_p.h"
45 #include "qtemplatemode_p.h"
47 #include "qdelegatingdynamiccontext_p.h"
51 using namespace QPatternist;
53 DelegatingDynamicContext::DelegatingDynamicContext(const DynamicContext::Ptr &prevContext)
54 : m_prevContext(prevContext)
56 Q_ASSERT(m_prevContext);
59 ItemCacheCell &DelegatingDynamicContext::itemCacheCell(const VariableSlotID slot)
61 return m_prevContext->itemCacheCell(slot);
64 ItemSequenceCacheCell::Vector &DelegatingDynamicContext::itemSequenceCacheCells(const VariableSlotID slot)
66 return m_prevContext->itemSequenceCacheCells(slot);
69 xsInteger DelegatingDynamicContext::contextPosition() const
71 return m_prevContext->contextPosition();
74 Item DelegatingDynamicContext::contextItem() const
76 return m_prevContext->contextItem();
79 xsInteger DelegatingDynamicContext::contextSize()
81 return m_prevContext->contextSize();
84 void DelegatingDynamicContext::setFocusIterator(const Item::Iterator::Ptr &it)
86 m_prevContext->setFocusIterator(it);
89 Item::Iterator::Ptr DelegatingDynamicContext::positionIterator(const VariableSlotID slot) const
91 return m_prevContext->positionIterator(slot);
94 void DelegatingDynamicContext::setPositionIterator(const VariableSlotID slot,
95 const Item::Iterator::Ptr &newValue)
97 m_prevContext->setPositionIterator(slot, newValue);
100 void DelegatingDynamicContext::setRangeVariable(const VariableSlotID slotNumber,
101 const Item &newValue)
103 m_prevContext->setRangeVariable(slotNumber, newValue);
106 Item::Iterator::Ptr DelegatingDynamicContext::focusIterator() const
108 return m_prevContext->focusIterator();
111 Item DelegatingDynamicContext::rangeVariable(const VariableSlotID slotNumber) const
113 return m_prevContext->rangeVariable(slotNumber);
116 void DelegatingDynamicContext::setExpressionVariable(const VariableSlotID slotNumber,
117 const Expression::Ptr &newValue)
119 m_prevContext->setExpressionVariable(slotNumber, newValue);
122 Expression::Ptr DelegatingDynamicContext::expressionVariable(const VariableSlotID slotNumber) const
124 return m_prevContext->expressionVariable(slotNumber);
127 QAbstractMessageHandler * DelegatingDynamicContext::messageHandler() const
129 return m_prevContext->messageHandler();
132 QExplicitlySharedDataPointer<DayTimeDuration> DelegatingDynamicContext::implicitTimezone() const
134 return m_prevContext->implicitTimezone();
137 QDateTime DelegatingDynamicContext::currentDateTime() const
139 return m_prevContext->currentDateTime();
142 QAbstractXmlReceiver *DelegatingDynamicContext::outputReceiver() const
144 return m_prevContext->outputReceiver();
147 NodeBuilder::Ptr DelegatingDynamicContext::nodeBuilder(const QUrl &baseURI) const
149 return m_prevContext->nodeBuilder(baseURI);
152 ResourceLoader::Ptr DelegatingDynamicContext::resourceLoader() const
154 return m_prevContext->resourceLoader();
157 ExternalVariableLoader::Ptr DelegatingDynamicContext::externalVariableLoader() const
159 return m_prevContext->externalVariableLoader();
162 NamePool::Ptr DelegatingDynamicContext::namePool() const
164 return m_prevContext->namePool();
167 QSourceLocation DelegatingDynamicContext::locationFor(const SourceLocationReflection *const reflection) const
169 return m_prevContext->locationFor(reflection);
172 void DelegatingDynamicContext::addNodeModel(const QAbstractXmlNodeModel::Ptr &nm)
174 m_prevContext->addNodeModel(nm);
177 const QAbstractUriResolver *DelegatingDynamicContext::uriResolver() const
179 return m_prevContext->uriResolver();
182 ItemCacheCell &DelegatingDynamicContext::globalItemCacheCell(const VariableSlotID slot)
184 return m_prevContext->globalItemCacheCell(slot);
187 ItemSequenceCacheCell::Vector &DelegatingDynamicContext::globalItemSequenceCacheCells(const VariableSlotID slot)
189 return m_prevContext->globalItemSequenceCacheCells(slot);
192 Item DelegatingDynamicContext::currentItem() const
194 return m_prevContext->currentItem();
197 DynamicContext::TemplateParameterHash &DelegatingDynamicContext::templateParameterStore()
199 return m_prevContext->templateParameterStore();
202 DynamicContext::Ptr DelegatingDynamicContext::previousContext() const
204 return m_prevContext;
207 QExplicitlySharedDataPointer<TemplateMode> DelegatingDynamicContext::currentTemplateMode() const
209 return m_prevContext->currentTemplateMode();