Qt 4.8
qxsdvalidatedxmlnodemodel_p.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 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 //
43 // W A R N I N G
44 // -------------
45 //
46 // This file is not part of the Qt API. It exists purely as an
47 // implementation detail. This header file may change from version to
48 // version without notice, or even be removed.
49 //
50 // We mean it.
51 
52 #ifndef Patternist_XsdValidatedXmlNodeModel_H
53 #define Patternist_XsdValidatedXmlNodeModel_H
54 
55 #include "qabstractxmlnodemodel.h"
56 
58 #include "qitem_p.h"
59 #include "qschematype_p.h"
60 #include "qxsdelement_p.h"
61 
63 
65 
66 namespace QPatternist
67 {
79  {
80  public:
82  typedef QList<Ptr> List;
83 
88 
92  virtual ~XsdValidatedXmlNodeModel();
93 
94  virtual QUrl baseUri(const QXmlNodeModelIndex &ni) const;
95  virtual QUrl documentUri(const QXmlNodeModelIndex &ni) const;
96  virtual QXmlNodeModelIndex::NodeKind kind(const QXmlNodeModelIndex &ni) const;
98  virtual QXmlNodeModelIndex root(const QXmlNodeModelIndex &n) const;
99  virtual QXmlName name(const QXmlNodeModelIndex &ni) const;
100  virtual QString stringValue(const QXmlNodeModelIndex &n) const;
101  virtual QVariant typedValue(const QXmlNodeModelIndex &n) const;
104  virtual QPatternist::ItemTypePtr type(const QXmlNodeModelIndex &ni) const;
106  virtual bool isDeepEqual(const QXmlNodeModelIndex &ni1, const QXmlNodeModelIndex &ni2) const;
107  virtual void sendNamespaces(const QXmlNodeModelIndex &n, QAbstractXmlReceiver *const receiver) const;
109  virtual QXmlNodeModelIndex elementById(const QXmlName &NCName) const;
110  virtual QVector<QXmlNodeModelIndex> nodesByIdref(const QXmlName &NCName) const;
111  virtual void copyNodeTo(const QXmlNodeModelIndex &node, QAbstractXmlReceiver *const receiver, const NodeCopySettings &) const;
112 
116  void setAssignedElement(const QXmlNodeModelIndex &index, const XsdElement::Ptr &element);
117 
122 
126  void setAssignedAttribute(const QXmlNodeModelIndex &index, const XsdAttribute::Ptr &attribute);
127 
132 
141 
146 
150  void addIdIdRefBinding(const QString &id, const NamedSchemaComponent::Ptr &binding);
151 
156 
161 
162  protected:
163  virtual QXmlNodeModelIndex nextFromSimpleAxis(SimpleAxis axis, const QXmlNodeModelIndex &origin) const;
164  virtual QVector<QXmlNodeModelIndex> attributes(const QXmlNodeModelIndex &element) const;
165 
166  private:
172  };
173 }
174 
176 
178 
179 #endif
The QVariant class acts like a union for the most common Qt data types.
Definition: qvariant.h:92
XsdValidatedXmlNodeModel(const QAbstractXmlNodeModel *model)
virtual void sendNamespaces(const QXmlNodeModelIndex &n, QAbstractXmlReceiver *const receiver) const
virtual QXmlNodeModelIndex root(const QXmlNodeModelIndex &n) const
Returns the root node of the tree that contains the node whose index is n.
The QXmlNodeModelIndex class identifies a node in an XML node model subclassed from QAbstractXmlNodeM...
void setAssignedAttribute(const QXmlNodeModelIndex &index, const XsdAttribute::Ptr &attribute)
void setAssignedType(const QXmlNodeModelIndex &index, const SchemaType::Ptr &type)
A push interface for the XPath Data Model. Similar to SAX&#39;s ContentHandler.
virtual QPatternist::ItemTypePtr type(const QXmlNodeModelIndex &ni) const
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
#define QT_BEGIN_HEADER
Definition: qglobal.h:136
qint16 NamespaceCode
Definition: qxmlname.h:82
QHash< QXmlNodeModelIndex, XsdAttribute::Ptr > m_assignedAttributes
Due to strong interdependencies, this file contains the definitions for the classes Item...
virtual bool isDeepEqual(const QXmlNodeModelIndex &ni1, const QXmlNodeModelIndex &ni2) const
Determines whether ni1 is deep equal to ni2.
virtual QUrl baseUri(const QXmlNodeModelIndex &ni) const
Returns the base URI for the node whose index is n.
virtual QXmlName name(const QXmlNodeModelIndex &ni) const
Returns the name of ni.
virtual QExplicitlySharedDataPointer< QAbstractXmlForwardIterator< QXmlNodeModelIndex > > iterate(const QXmlNodeModelIndex &ni, QXmlNodeModelIndex::Axis axis) const
Performs navigation, starting from ni, by returning an QAbstractXmlForwardIterator that returns nodes...
virtual QPatternist::ItemIteratorPtr sequencedTypedValue(const QXmlNodeModelIndex &ni) const
The QUrl class provides a convenient interface for working with URLs.
Definition: qurl.h:61
The QString class provides a Unicode character string.
Definition: qstring.h:83
virtual QXmlName::NamespaceCode namespaceForPrefix(const QXmlNodeModelIndex &ni, const QXmlName::PrefixCode prefix) const
Returns the namespace URI on ni that corresponds to prefix.
The QHash class is a template class that provides a hash-table-based dictionary.
Definition: qdatastream.h:66
QSet< NamedSchemaComponent::Ptr > idIdRefBindings(const QString &id) const
virtual QXmlNodeModelIndex::NodeKind kind(const QXmlNodeModelIndex &ni) const
Returns a value indicating the kind of node identified by ni.
QHash< QXmlNodeModelIndex, XsdElement::Ptr > m_assignedElements
QHash< QString, QSet< NamedSchemaComponent::Ptr > > m_idIdRefBindings
SchemaType::Ptr assignedType(const QXmlNodeModelIndex &index) const
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
virtual QVector< QXmlName > namespaceBindings(const QXmlNodeModelIndex &n) const
Returns the in-scope namespaces of n.
XsdElement::Ptr assignedElement(const QXmlNodeModelIndex &index) const
QExplicitlySharedDataPointer< const QAbstractXmlNodeModel > m_internalModel
void setAssignedElement(const QXmlNodeModelIndex &index, const XsdElement::Ptr &element)
The QAbstractXmlNodeModel class is an abstract base class for modeling non-XML data to look like XML ...
DocumentOrder
Identifies the specific node comparison operator that should be used.
The QStringList class provides a list of strings.
Definition: qstringlist.h:66
The namespace for the internal API of QtXmlPatterns.
virtual QUrl documentUri(const QXmlNodeModelIndex &ni) const
Returns the document URI of n.
XsdAttribute::Ptr assignedAttribute(const QXmlNodeModelIndex &index) const
virtual QVariant typedValue(const QXmlNodeModelIndex &n) const
Returns the typed value for node node.
The QXmlName class represents the name of an XML node, in an efficient, namespace-aware way...
Definition: qxmlname.h:58
virtual QXmlNodeModelIndex nextFromSimpleAxis(SimpleAxis axis, const QXmlNodeModelIndex &origin) const
When QtXmlPatterns evaluate path expressions, it emulate them through a combination of calls with QSi...
A delegate class that wraps around a QAbstractXmlNodeModel and provides additional validation specifi...
NodeKind
Identifies a kind of node.
virtual QVector< QXmlNodeModelIndex > nodesByIdref(const QXmlName &NCName) const
Returns the elements and/or attributes that have an IDREF value equal to idref.
SimpleAxis
Four axes that each contain one node only.
virtual void copyNodeTo(const QXmlNodeModelIndex &node, QAbstractXmlReceiver *const receiver, const NodeCopySettings &) const
virtual QVector< QXmlNodeModelIndex > attributes(const QXmlNodeModelIndex &element) const
Returns the attributes of element.
quint16 index
Axis
Identify the axes emanating from a node.
QHash< QXmlNodeModelIndex, SchemaType::Ptr > m_assignedTypes
The QFlags class provides a type-safe way of storing OR-combinations of enum values.
Definition: qglobal.h:2313
virtual QXmlNodeModelIndex elementById(const QXmlName &NCName) const
Returns the index of the element identified as id.
void addIdIdRefBinding(const QString &id, const NamedSchemaComponent::Ptr &binding)
virtual QXmlNodeModelIndex::DocumentOrder compareOrder(const QXmlNodeModelIndex &ni1, const QXmlNodeModelIndex &ni2) const
This function returns the relative document order for the nodes indexed by ni1 and ni2...
#define QT_END_HEADER
Definition: qglobal.h:137
QExplicitlySharedDataPointer< XsdValidatedXmlNodeModel > Ptr
virtual QString stringValue(const QXmlNodeModelIndex &n) const
Returns the string value for node n.
NamespaceCode PrefixCode
Definition: qxmlname.h:83